Friday, 15 June 2012

Basic Router Configuration Commands

Introduction to Router Configuration



Cisco Router configuration is done by several methods. Some of the important methods are below:

  • Through TFTP Server over a Network
  • Through the Menu Interface provided at bootup
  • Through the Menu Interface provided by using the command setup
  •  Configuration from the IOS Command-line Interface
But here i used the method of Configuration from IOS CLI. becase it is common for all CISCO Routers,  and also it is important for CCNA, CCNP exam point of view.

Getting Started

From a terminal, one can probably configure router initially. If the router is already configured and at least one port configured with an IP address need to configure and physically connected to a network, then it will be configure through telnet. If the Router is not already configured so   it can be connect directly to the terminal and with a serial cable. this will be done through hyper terminal and a serial cable which one end must be connected to a serial port of PC and other to the console port of a route. Now on the router and start configuration. With a simulator software's (Packet Tracer, GNS3, NS2) it done directly as click double on the router and select the CLI mode.

Router>

It has been previously configured with a host-name, it will look like this: here Mohsin is the Router name/ Host-name

router > enable
router # host-name MOHSIN
MOHSIN #

If you want to start the initial configuration of the router or not. type yes or no.
There are three types of modes in Cisco routers. 
  • The User Mode
  • The Privileged Mode
  • The Configuration Mode
each mode has its own commands, to show each mode command type ? in that mode like

Mohsin> ? press enter

When first time enter to a router, that is the EXEC mode. some unprivileged commands are used here like show, ping, telnet etc.  From here enter to privileged mode through enable command, result is Privileged mode in # like 

Mohsin> enable
Mohsin #

When first enter to a router there is no idea of the initial configuration. since show  is used to check the initial configuration like.

Mohsin # show ? press enter will display all show configurations commands like
Mohsin # show interfaces
Mohsin # show ip protocols
Mohsin # show ipv6 protocols
Mohsin # show ip route
Mohsin # show ipv6 route
Mohsin # show ip arp
Mohsin # show ipv6 neighbors



Other Configuration Commands

Router > enable
Router #

The enable command enters you to the privileged mode. Now we are at the privileged mode (#). Now we can do every want to our host (router). Let us enter login password, allow 5 telenet connections to access this router at a time, set clock rate of the router.

Router # configure terminal
Router (config) # hostname MOHSIN
MOHSIN (config) # ctrn^z | end | exit
MOHSIN # clock set 12:10:30 13 July 2012
MOHSIN # show clock
MOHSIN # configure terminal
MOHSIN (config) # line console 0
MOHSIN (config-line) # logging synchronous

This command is used for preventing router from console messages to interrupting user input.

MOHSIN (config-line) # exec-timeout 0 0
MOHSIN (config-line) # exit
MOHSIN (config) # exit
MOHSIN #

This command is used for inactivity timeout, this is automatic session logout if there is no user activity. Timeout 0 0 means there is 0 minutes and 0 seconds, which means that never expires. Timeout 0 0 is also equivalent to # no exec-timeout
Now I discussed about the privileged mode access password method. This is done by two commands, access password & access secret. Remember that password command was used in the earlier versions of IOS. Password saved as a plain text, while secret is saved as encrypted, since secret is more secure than password & used in current versions of IOS. If both are enabled on a router the secret will be effective. We can see the password and secret by typing the # show running-config command.

MOHSIN # configure terminal
MOHSIN (config) # enable password cisco12345
MOHSIN (config) # enable secret cisco54321
MOHSIN (config) # end
MOHSIN # show running-config

Now I discuss about how to enable telnet/SSH session. In the below example password are created for the telnet session. VTY (Virtual Tely Type) are used for telnet.

MOHSIN # config terminal
MOHSIN (config) # line console 0
MOHSIN (config-line) # password cisco12345
MOHSIN (config-line) # login
MOHSIN (config-line) # line vty 0 3
MOHSIN (config-line) # password cisco12345
MOHSIN (config-line) # login
MOHSIN (config-line) # exit
MOHSIN (config) # exit
MOHSIN # exit
MOHSIN >

Here in the above example the first password is used for console login. And the second is used for telnet login. I kept both are same, but you can set these both different.


No comments:

Post a Comment