Você está na página 1de 29

Basic Router Configurations

• Router> enable
• Router#
• Router# disable
• Router>
• Router> ?
• Router# ?
• Router#sh?
Show
• Router#sh[press TAB]
 router#show
• Ctrl+A: start of a command line
• Ctrl+E: end of a command line
• Router#show version
• Router>show version
• Router# show running-config
• Router# show startup-config
• Router#show flash:
• Router# dir nvram:
• Router#configure terminal
• Router#conf t
• Router(config)# exit, end,
Ctrl+Z,Ctrl+C
• Router#
1.Hostname

• Router(config)#hostname R1
• R1#
• R1(config)# no hostname
• Router#
2.Interface
• R1(config)#interface fastEthernet 0/0

• R1(config)#int f0/0
• R1(config-if)#ip address 192.168.1.1
255.255.255.0
• R1(config-if)#no shutdown
• R1(config-if)#description To R2
• R1(config-if)#exit | end | Ctrl+Z | Ctrl+C
2.Interface
• R1#show running-config
• R1#sh run
• R1#show ip interface brief //summary state
of interfaces
• R1#show interface [f0/0|f0/1 …] // detail
information of interfaces
• R1(config)#do sh run
• R1(config)#do show ip interface brief
• R1(config)#do show interface [f0/0|f0/1 …]
2.Interface
• R1(config)#
• interface Serial0/0/0
description Connect to R2
ip address 192.168.2.1 255.255.255.0
clock rate {128000|64000|56000…}
no shutdown
exit
• R1#show controllers s0/0/0
• //show the type of cable
connected (DCE/DTE)

• R1#ping 192.168.2.2
• R2#ping 192.168.2.1
2.Interface

• interface Loopback0
description To Internet
ip address 10.0.0.2 255.255.255.0
3.The static default route
• R1(config)#ip route 0.0.0.0 0.0.0.0 S0/0/0
• R2(config)#ip route 0.0.0.0 0.0.0.0 S0/0/0

• R1#show ip route //show the routing table

• R1#ping 192.168.3.100
• R1#traceroute 192.168.3.100
• PC1: C:/>ping 192.168.3.100
• Router(config)# ip route 0.0.0.0 0.0.0.0
{outgoing interface | Next-hop ip address}

• R1(config)# ip route 0.0.0.0 0.0.0.0 s0/0


• R2(config)# ip route 0.0.0.0 0.0.0.0 s0/1
• PC1:>tracert 192.168.3.100

• R1#traceroute 192.168.3.100
3. Banner MOTD
(config)#banner motd # This is a security system !!! #

Router# exit

<Press the Enter>


4.1 console password

• (config)# line console 0


(config-line)# password cisco
(config-line)# login
• Testing:
• Router#exit
<Press the Enter>
4.2. Enable password
• R1(config)#enable password class //clear text
(non-encryption)
• R1(config)#enable secret ccna // encrypted by
MD5 hash function
• R1#show running-config
• Testing:
R1#disable
R1>enable
Password:
4.3. VTY (Virtual TeletYpe) password (for
Telnet,SSH service)
• R2(config)#line vty 0 4
R2(config-line)# password cisco
R2(config-line)# login
• Testing:
– R1# 192.168.2.2
– R1#telnet 192.168.2.2
– R1#connect 192.168.2.2
– R2# exit //disconect a Telnet session and return to R1
– R2# Ctrl+Shift+6+X //it’s temporary to exit R2, if to
press the Enter key then return to R2
4.3. VTY (Virtual TeletYpe) password (for
Telnet,SSH service)

• PC1:
• C:\> telnet 192.168.1.1
• C:\> telnet 192.168.2.2
• R2(config)#service password-encryption

• //Encrypt system passwords by the Cisco level


7 algorithm. That are weak passwords, using
the GetPass tool for cracking.
5. Backup configuration files
• 5.1. Save configurations into the NVRAM
• R2#copy running-config startup-config
• R2#copy run sta

• R2#write
• R2#wr

• R2#show startup-config
• R2# dir nvram:
5. Backup configuration files
• 5.2. Backup into a TFTP server (192.168.3.254)
• R2#ping 192.168.3.254

• R2#copy running-config tftp:


• Address or name of remote host []? 192.168.3.254
• Destination filename [R2-confg]?

• R2#copy startup-config tftp:


• Address or name of remote host []? 192.168.3.254
• Destination filename [R2-confg]?
Restore a configuration file from a TFTP server

• Router#copy tftp: running-config


• Address or name of remote host []?
192.168.3.254
• Source filename []? R2-confg
• R2#
6. Removing All Configurations
• R2#erase startup-config
• Erasing the nvram filesystem will remove all
configuration files! Continue? [confirm]
• [OK]
• Erase of nvram: complete
• %SYS-7-NV_BLOCK_INIT: Initialized the
geometry of nvram
• R2#reload
7. Logging Synchronous Command

• Router(config)#Line console 0
• Router(config-line)# Logging synchronous
• //synchronized massage output
8. Disable the DNS request
• Router(config)# no ip domain-lookup
9. Ping, Traceroute command
• Router> ping {destination}
• Router# ping {destination}
• Router(config)# do ping {destination}

• Router>traceroute {destination}
• Router#traceroute {destination}
• Router(config)#do traceroute {destination}

Você também pode gostar