Chapter Two
Commands for the
Configuration of the Router
This chapter will walk you through the commands and information about the configuration of a router. You will learn how to set up the names, interfaces, passwords, host tables, and save the configurations. The router mode commands are as under.
Router Modes Commands
There are different router modes that you may experience while you are navigating through the command line. All the commands do not work in all modes. If you type something in a command and you know it is correct but you get an error instead, you should recheck if the mode you are working in is right.
-
The command Router> reflects the user mode.
-
The command Router# reflects the privileged mode.
-
The command Router(config)# reflects the global configuration mode.
-
The command Router(config-if)# reflects the interface mode.
-
The command Router(config-subif# reflects the subinterface mode.
-
The command Router(config-line)# reflects the line mode.
-
The command Router(config-router)# reflects the router configuration mode.
Configuration of the Name of the Router
You can use this command both on switches and routers.
Global Configuration Mode
-
The command Router> reflects that the limited view of the configuration mode cannot introduce any changes in the mode.
-
The command Router# reflects that the user can see how the configuration process is going on and that they can make the changes they need.
-
The command Router#config t will take you to the router configuration mode. Once you execute the command, you will see the following prompt Router(config)# which indicates that you are allowed to introduce the changes in the configuration of the system.
Commands for the Configuration of Passwords
You can use the following commands both on switches and routers. There is a variety of commands that you can use for the purpose.
-
The command Router(config)#enable password cisco will allow you to set the enable password.
-
The command Router(config)#enable secret class will allow you to set the enable secret password.
-
The command Router(config-line)#login will allow you to enter the console-line mode. It will also fix the console-line mode passed to the console. It also enables the system to check the password at the login time.
-
The command Router(config-line)#password console will allow you to enter the console-line mode. It will also fix the console-line mode passed to the console. It also enables the
system to check the password at the login time.
-
The command Router(config)#line con 0 will allow you to enter the console-line mode. It will also fix the console-line mode passed to the console. It also enables the system to check the password at the login time.
-
The command Router(config)#line vty 0 4 will allow you to pop into the vty mode for the five vty lines. This command will help you set the vty password to the telmet. You also can enable password checking at the time of login.
-
The command Router(config-line)#login will enable the password checking at the time of login.
-
The command Router(config-line)#password telmet will help you set the vty password to the telmet.
-
The command Router(config)#line aux 0 will land you in the auxiliary line mode.
-
The command Router(config-line)#password backdoor will help you to change the auxiliary line mode password into backdoor.
The enable secret password is usually encrypted by default. However, the enable password is usually not. The recommended practice should be that you must not use the enable password. You should only make use of the enable password to configure the router. If you do so, you will defeat the usage of encryption. Also, you cannot set the enable password and enable secret password to the same password. This will defeat the encryption.
Password Encryption Commands
-
The command Router(config)# service password-encryption will help you set up and apply weak encryption to your passwords.
-
The command Router(config)#no service password-encryption will block password encryption on your system.
-
The command Router(config)#enable password cisco will set up the password to cisco.
-
The command Router(config)#password cisco will continue with the passwords that you set up.
The show Commands
There are a bunch of show commands that allow you to see different statistics and numbers in the system.
-
The command Router#show ? will let you see the show commands that are available in the system.
-
The command Router#show interfaces will let you see the statistics for all the interfaces in the system.
-
The command Router#show interface serial 0 will let you see the statistics for special interfaces such as Serial 0.
-
The command Router#show clock will display the exact time on the device.
-
The command Router#show users will let you see all the users have been connected to the device.
-
The command Router#show history will let you see the history of different commands used the level of edit.
-
The command Router#show controllers serial 0 will let you see the statistics of the interface hardware. These statistics will display if the rate of the clock is set and the cable is DTE or unattached.
-
The command Router#show hosts will let you see the local host-to-IP addresses. You will see the names and the addresses of different hosts on the network to which you
have been connected.
-
The command Router#show version will let you see all the information related to the loaded version of the software concerned.
-
The command Router#show running-config will let you see the configuration that is presently running inside the RAM.
-
The command Router#show startup-config will let you see the configuration that is saved on the NVRAM.
-
The command Router#show flash will let you see all the information that is related to the Flash memory.
-
The command Router#show protocols will let you see the status of the configured layer that has 3 protocols.
-
The command Router#show arp will let you see all the ARP table.
Interface Names
Remembering the names of the interfaces is one of the biggest problems that administrators might face. Each router has a different interface name. The market is replete with many Cisco devices that are being used in the production networks in the present day. Some administrators get confused due to these interface names. You can use the command router#show ip interface brief to see which type of interface is on your computer.
Router mode: 2501. The slot number or port location is on board. The port or slot type is Ethernet. The slot numbering range is labeled as an interface-type number. An example of this interface is ethernet0(e0).
Router mode: 2501. The slot number or port location is on board. The port or slot type can be Serial. The slot numbering range is labeled as an interface-type number. An example of this
interface is serial0 (sO) & s1.
Router mode: 2514. The slot number or port location is on board. The port or slot type is Ethernet. The slot numbering range is labeled as an interface-type number. An example of this interface is e0 & e1.
Router mode: 1721. The slot number or port location is on board. The port or slot type is FastEthernet. The slot numbering range is labeled as an interface-type number. An example of this interface is fastethernet0()(fa0).
Router mode: 2514. The slot number or port location is slot 0. The port or slot type is WAC (WIN Interface Card) (Serial). The slot numbering range is labeled as an interface-type number. An example of this interface is s0 & s1.
Router mode: 1760. The slot number or port location is on board. The port or slot type is Fast Ethernet. The slot numbering range is labeled as interface-type 0/port. An example of this interface is fa0/0.
Router mode: 1760. The slot number or port location is slot 0. The port or slot type is WIC/VIC (Voice Interface Card). The slot numbering range is labeled as interface-type 0/port. An example of this interface is s0/0 & s0/1 and v0/0 & v0/1.
Router mode: 1760. The slot number or port location is slot 1. The port or slot type is WIC/VIC. The slot numbering range is labeled as interface-type 1/port. An example of this interface is s1/0 & s1/1 and v1/0 & v1/1.
Router mode: 1760. The slot number or port location is slot 2. The port or slot type is VIC. The slot numbering range is labeled as interface-type 2/port. An example of this interface is v2/0 & v2/1.
Router mode: 1760. The slot number or port location is slot 3.
The port or slot type is VIC. The slot numbering range is labeled as interface-type 3/port. An example of this interface is v3/0 & v3/1.
Router mode: 2610. The slot number or port location is on board. The port or slot type is Ethernet. The slot numbering range is labeled as interface-type 0/port. An example of this interface is e0/0.
Router mode: 2610. The slot number or port location is slot 0. The port or slot type is WIC (Serial). The slot numbering range is labeled as interface-type 0/port. An example of this interface is s0/0 & s0/1.
Router mode: 2611. The slot number or port location is on board. The port or slot type is Ethernet. The slot numbering range is labeled as interface-type 0/port. An example of this interface is e0/0 & e0/1.
Router mode: 2611. The slot number or port location is slot 0. The port or slot type is WIC (Serial). The slot numbering range is labeled as interface-type 0/port. An example of this interface is s0/0 & s0/1.
Router mode: 2620. The slot number or port location is on board. The port or slot type is FastEthernet. The slot numbering range is labeled as interface-type 0/port. An example of this interface is fa0/0.
Router mode: 2620. The slot number or port location is slot 0. The port or slot type is WIC (Serial). The slot numbering range is labeled as interface-type 0/port. An example of this interface is s0/0 & s0/1.
Router mode: 2621. The slot number or port location is on board. The port or slot type is FastEthernet. The slot numbering range is labeled as interface-type 0/port. An example of this interface is fa0/0 & fa0/1.
Router mode: 2621. The slot number or port location is slot 0. The port or slot type is WIC (Serial). The slot numbering range is labeled as interface-type 0/port. An example of this interface is s0/0 & s0/1.
Router mode: 1841. The slot number or port location is on board. The port or slot type is FastEthernet. The slot numbering range is labeled as interface-type 0/port. An example of this interface is fa0/0 & fa0/1.
Router mode: 1841. The slot number or port location is slot 0. The port or slot type is HWIC/WIC/VWIC. The slot numbering range is labeled as interface-type 0/port. An example of this interface is s0/0/0& s0/0/1.
Router mode: 1841. The slot number or port location is slot 1. The port or slot type is HWIC/WIC/VWIC. The slot numbering range is labeled as interface-type 0/port. An example of this interface is s0/1/0& s0/1/1.
Router mode: 2801. The slot number or port location is on board. The port or slot type is FastEthernet. The slot numbering range is labeled as interface-type 0/port. An example of this interface is fa0/0& fa0/1.
Router mode: 2801. The slot number or port location is slot 0. The port or slot type is VIC/VWIC(voice only). The slot numbering range is labeled as interface-type 0/slot/port. An example of this interface is voice0/0/0& voice0/0/3.
Router mode: 2801. The slot number or port location is slot 1. The port or slot type is HWIC/WIC/VWIC. The slot numbering range is labeled as interface-type 0/slot/port. The examples of this interface are 0/1/0-0/1/3(this is single-wide HWIC) and 0/1/1-0/1/7 (this is double-wide HWIC).
Router mode: 2801. The slot number or port location is slot 2. The port or slot type is WIC/VIC/VWIC. The slot numbering
range is labeled as interface-type 0/slot/port. An example of this interface is 0/2/0- 0/2/3.
Router mode: 2801. The slot number or port location is slot 3. The port or slot type is HWIC/WIC/VWIC. The slot numbering range is labeled as interface-type 0/slot/port. An example of this interface is 0/3/0- 0/3/3 for single-wide HWIC and o/3/0- 0/3/7 for double-wide HWIC.
Router mode: 2811. The slot number or port location is built into the front of the chassis. The port or slot type is USB. The slot numbering range is labeled as an interface-type port. An example of this interface is usb0& usb1.
Router mode: 2811. The slot number or port location is built into the back of the chassis. The port or slot type is FastEthernet Gigabit Ethernet. The slot numbering range is labeled as interface-type 0/port. An example of this interface is fa0/0& fa0/1 gi0/0& gi0/1.
Router mode: 2811. The slot number or port location is built into slot 0. The port or slot type is HWIC/HWIC-D/WIC/VWIC/VIC. The slot numbering range is labeled as interface-type 0/slot/port. An example of this interface is s0/0/0& s0/0/1 fa0/0/0& 0/0/1.
Router mode: 2811. The slot number or port location is built into slot 1. The port or slot type is HWIC/HWIC-D/WIC/VWIC/VIC. The slot numbering range is labeled as interface-type 0/slot/port. An example of this interface is s0/1/0& s0/1/1 fa0/1/0& 0/1/1.
Router mode: 2811. The slot number or port location is at NME slot. The port or slot type is NM/NME. The slot numbering range is labeled as interface-type 1/port. An example of this interface is gi1/0& gi1/1 s1/0& s1/1.
Navigation Through Interfaces
With the help of a few commands, you can easily navigate through the interfaces. Some commands are as under:
-
The command Router(config)#int s0 will let you move to the S0 mode of the interface.
-
The command Router(config-if)#exit will let you move from the S0 mode of the interface to E0 mode. After that you will reach the following stage Router(config)#int e0.
-
The command Router(config)#int e0 shows that you have entered the E0 interface. When you are done with a command, you will see Router(config-if)# that is a prompt and that does not change.
Configuring Interfaces
You can configure any kind of interface with the help of the following commands.
-
The command Router(config)#int s0/0 will let you move from your current interface to the Serial 0/0 mode interface.
-
The command Router(config-if)#clock rate 56000 will let you assign a set clock rate for the interface you are in.
-
The command Router(config-if)#description Link to ISP will explain the optional descriptor of the link.
-
The command Router(config-if)#no shut will let you turn on the interface.
-
The command Router(config-if)#ip address 192.168.10.1 255.255.255.0 will let you assign the subnet mask and address to the interface.
-
The command Router(config)#int fa0/0 will let you move from your current interface to the Fast Ethernet 0/0 mode interface.
-
The command Router(config-if)#description Accounting LAN will let you view your link's optional descriptor.
-
The command Router(config-if)#ip address 192.168.20.1 255.255.255.0 will let you assign subnet masks and addresses to your current interface.
-
The command Router(config-if)#int fa0/0 will let you move from your current interface to the Fast Ethernet 0/0 mode interface.
-
The command Router(config-if)#no shut will let you turn on the interface.
You can use the clock rate command only on the serial interface that possesses a DCE cable that is plugged right into it. There ought to be a clock rate that is set on each serial link in between the routers. It is of least importance as to which router has been plugged with the DCE cable or which interface has got the cable plugged into it. The Serial 0 on the one router can be plugged into Serial 1 on some other router.
Some Miscellaneous Commands
-
The command Router(config)#banner motd # You are inside a secure system. Unauthorized persons are not allowed. # is used to create banner messages and the character # is a delimiting character. The delimiting character must engulf the banner message that you want to convey. You can make it as long you want to. However, you should make sure that you do not include the # character in the body of the message or disrupt the command.
-
The command Router(config)#clock timezone EST +5 will let you set the time zone that will be displayed on the interface.
-
The command Router(config)#ip host (hostname) will let you assign the host’s name to your IP address. After you
have made the assignment, you can use the host’s name instead of the IP address when you are trying to ping or Telnet to the address.
-
The command Router(config)#no ip domain-lookup will let you turn off the domain in an effort to resolve any kind of unrecognized command to the name of the local host.
-
Enter the command Router(config)#line con 0. Then enter the command Router(config-line)#nexec-timeout 0 0. It will let you set the time limit when your console will automatically log off. You can set the time to 0 0 (minutes seconds). This means that your console will never log off. This command works well for a lab because the console is not going to log out soon. Bad security is lethal in the real world.
-
The command Router#copy run start will let you save your running-config to any kind of local NVRAM.
-
The command Router#copy run tffp will let you save your running-config from a remote location to TFTP server.
-
You can always have the option to erase the configurations from the system. The command Router#erase start will let you do that.
Basic Router Configuration
You can configure your router in a short time by pursuing the following steps.