H.
Swaih
Basic Router Configuration
Figure shows the network topology for the configuration that follows, which shows a
basic router configuration:
Boston Router
No Command Purpose
1 Router> enable =Router> enab = Enter privileged mode
Router>en
Example:
Router> enable
2 Router#clock set 14:30:00 05 Nov 2017 Sets the local time on the router
3 Router#configure terminal = Enters global configuration mode
Router#config t
Example:
Router#configure terminal
Router(config)#
4 hostname name Specifies the name for the router, in this configuration, sets
the router name to Boston
Example:
Router(config)#hostname Boston
Boston(config)#
5 no ip domain-lookup Disables the router from translating unfamiliar words (spelling
mistake) into IP addresses.
Example:
Boston(config)#no ip domain-lookup
Boston(config)#
H.Swaih 1
H.Swaih
6 banner motd #message# # is known as a delimiting character. The delimiting character
must surround the banner message. This MOTD (message of
Example: the day (MOTD) banner is displayed to all terminals connected
and is useful for sending messages that affect all users (such as
Boston(config)#banner motd #This is the
Boston Router. Authorized Access only # impending system shutdowns). Use the no banner motd
command to disable the MOTD banner on a line. The MOTD
banner displays before the login prompt and the login banner, if
one has been created.
7 Boston(config)# clock timezone EST -5 Sets time zone to eastern standard time (-5 form UTC
“Coordinated Universal Time”). It can be set different time
zones, like Greenwich Mean Time (UTC) “clock timezone
GMT” [clock timezone zone hours-offset [minutes-offset]]
8 enable secret password Specifies an encrypted password to prevent unauthorized
access to the router.
Example:
Boston(config)# enable secret cisco
Boston(config)#
9 service password-encryption This command causes the encryption of passwords. The
purpose of this command is to keep unauthorized individuals
Example from viewing passwords in the configuration file.
Boston(config)# service password-
encryption
9 Boston(config)# line console 0 Move to line console configuration mode.
Boston(config-line)#
10 Boston(config-line)# logging Turns on synchronous logging. Information items sent to
synchronous console will not interrupt the command you are typing. The
command will be moved to a new line.
Boston(config-line)#
11 Boston(config-line)# password class Sets the password to class
12 Boston(config-line)# login Enable password checking at login.
13 Boston(config-line)# line vty 0 4 Move to virtual telnet line 0 through 4
14 Boston(config-line)# password class Sets the password to class
15 Boston(config-line)# login Enable password checking at login
16 Boston(config-line)# line aux 0 Move to line auxiliary mode
17 Boston(config-line)# password class Sets the password to class
18 Boston(config-line)# login Enable password checking at login
19 Boston(config-line)# exit Move back to global configuration mode.
Boston(config)#
20 Boston(config)#no service password- Turns off password encryption
encryption
21 Boston(config)#Interface fastethernet 0/0 Move to interface fast Ethernet 0/0 configuration mode.
H.Swaih 2
H.Swaih
22 Description Optional: Sets locally significant description of the interface.
Example:
Boston(config-if)#description LAN one
23 Boston(config-if)# ip address 172.16.10.1 Assign an IP address and subnet mask to the interface
255.255.255.0
24 Boston(config-if)# no shutdown Turns on interface
25 Boston(config-if)# interface serial 0/0/0 Moves directly to interface serial 0/0/0 configuration mode.
26 Boston(config-if)#description link to next Optional ;Sets locally significant description of the interface.
router
Boston(config-if)# ip address 172.16.20.1 Assign an IP address and subnet mask to the interface
255.255.255.252
27
28 Boston(config-if)#clock rate 56000 Sets a clock rate for serial transmission. The DCE* cable
must be plugged into this interface
29 Boston(config-if)# no shutdown Turns on the interface
30 Boston(config-if)# exit Move back to global configuration mode.
Boston(config)#
31 Boston(config)#ip host buffalo 172.16.20.2 Sets a local host name resolution to IP address 172.16.20.2,
After this assignment, you can use the host name rather than
an IP address when trying to Telnet or ping to that address.
32 Boston(config)# exit Move back to privileged mode.
Boston#
32 Boston#Copy running-config startup- Saves the running configuration to NVRAM “Non-volatile
config random-access memory”
Configuring a Gigabit Ethernet Interface
To configure the Gigabit Ethernet interface, you can replace no:21,22,23 and 24 from
above table to:
21 Boston(config)#Interface gigabitethernet Move to interface gigabitethernet 0/0configuration mode.
0/0
22 Description Optional: Sets locally significant description of the interface.
Example:
Boston(config-if)#description LAN one
23 Boston(config-if)# ip address 172.16.10.1 Assign an IP address and subnet mask to the interface
255.255.255.0
24 Boston(config-if)# no shutdown Turns on the interface
H.Swaih 3
H.Swaih
exec-timeout Command
Boston(config)# line console
Boston(config-line)#exec-timeout 0 0 Sets time limit when console automatically logs off. Set to 0 0
(minutes seconds) means console never logs off
Boston (config-line)#
CAUTION : exec‐timeout 0 0 is great for a lab because the console never logs out. This is
very dangerous in the real world (bad security).
CAUTION(see no 8): Enable secret password command is encrypted by default. Enable
password command is not. For this reason, recommended practice is that you never use
the enable password. Use only the enable secret password in a router configuration.
CAUTION(see no 8): You cannot set both enable secret and enable password to the
same password. Doing so defeats the use of encryption.
CAUTION(see no 20): If you have turned on service password encryption, used it, and
then turned it off, any passwords that you have encrypted will stay encrypted. New
passwords will remain unencrypted
TIP (see no 28):The clock rate command is need only on a serial interface that has a DCE
cable plugged into it. There must a clock rate set on every serial link between routers. It
dose not matter which router has the DCE cable plugged into it or which interface the
cable is plugged into. Serial 0 on one router can be plugged into serial 1 on another
router.
■ Data communications equipment (DCE): A device that supplies the clocking services
to another device. Typically, this device is at the WAN access provider end of the link.
■ Data terminal equipment (DTE): A device that receives clocking services from another
device and adjusts accordingly. Typically, this device is at the WAN customer or user end
of the link.
TIP(see no 31): The default port number in the ip host command is 23, or Telnet. If you
want to Telnet to a device, just enter the IP host name itself: Router#buffalo =
Router#telnet buffalo = Router#telnet 172.16.20.2
TIP(see no 10): Ever try to type in a command and an informational line appears in the
middle of what you were typing? Lose your place? Do not know where you are in the
command, so you just press R and start all over? The logging synchronous command will
tell the router that if any informational items get displayed on the screen, your prompt
and command line should be moved to a new line, so as not to confuse you. The
informational line does not get inserted into the middle of the command you are trying
to type. If you were to continue typing, the command would execute properly, even
though it looks wrong on the screen
TIP(see no 5): Ever type in a command incorrectly and left having to wait for a minute or
two as the router tries to translate your command to a domain server of
H.Swaih 4
H.Swaih
255.255.255.255? The router is set by default to try to resolve any word that is not a
command to a DNS server at address 255.255.255.255. If you are not going to set up
DNS, turn this feature off to save you time as you type, especially if you are a poor
typist.
TIP (see no 32): The startup configuration is removed by using the erase startup‐config
command: Boston# erase startup‐config
TIP: Assuming that we have not overwritten the startup configuration with the changes,
we can replace the running configuration with the startup configuration. This is best
done by restarting the device using the reload command at the privileged EXEC mode
prompt. When initiating a reload, the IOS will detect that the running config has changes
that were not saved to startup configuration. A prompt will appear to ask whether to
save the changes made. To discard the changes, enter n or no. Example: Router# reload
Some show commands:
1 Router# show ? Lists all show commands available
2 Router# show ip interface brief Displays a summary of all interface, including status and IP
address assigned.
3 Router# show ip interface serial 0/0/0 Displays statistics for a specific interface (in this case, serial
0/0/0)
4 Router# show clock Displays time set on device
5 Router#show ip route To display the contents of IP routing table
6 Router#show controllers serial 0 Displays statistics for interface hardware. Statistics display if
the clock rate is set and if the cable is DCE, DTE, or not
attached
7 Router#show clock Displays time set on device
8 Router#show hosts Displays local host-to-IP address cache. These are the
names and addresses of hosts on the network to which you
can connect
9 Router#show users Displays all users connected to device
10 Router#show history Displays history of commands used
11 Router#show flash Displays info about Flash memory
12 Router#show version Displays info about loaded software version
13 Router#show arp Displays the ARP table
14 Router#show protocols Displays status of configured Layer 3 protocols
15 Router#show startup-config Displays configuration saved in NVRAM
16 Router#show running-config Displays configuration currently running in RAM
H.Swaih 5
H.Swaih
Some useful commands
1.Using the Tab Key to compete commands
Router#sh “press Tab Key”=Router#show
2.Using the Question Mark for Help
Router#cl? = lists all the possible choices that start with cl (clear or clock)
3.Exit command
*Router#exit or Router>exit = Logs a user off
*Router(config‐if)#exit =Router(config)# = Move you back one level
*Router(config)#exit=Router#= Move you back one level
4.Disable command
Router#disable=Router> =move you from privileged mode back to user mode
5.logout command
Router#logout= performs the same function as exit
6.Setup Mode
Router#setup= enters startup mode from the command line
7.Keyboard Help
Ctrl+a= move cursor to beginning of line
Esc+b =move cursor back one word
Ctrl+b or left arrow = move cursor back one character
Ctrl+e= move cursor to end of line
Ctrl+f or right arrow= move cursor forward one character
Esc+f= move cursor forward one word
Ctrl+z= move you from any prompt back down to privileged mode.
8.History commands
Ctrl+P or up arrow= recall commands in the history buffer in a backward sequence,
beginning with the most recent command.
Ctrl+n or down arrow= return to more recent commands in the history duffer after
recalling commands with Ctrl+P key sequence.
H.Swaih 6