Router Configuration With SYNTAX (Updated)
Router Configuration With SYNTAX (Updated)
NOTE: Depending on router’s IOS, it might use different types of interfaces. Such as –
Ethernet interface 0 → E0 or F0/0 or Gi0/0 Ethernet interface 1 → E1 or F0/1 or G0/1 Serial interface 0 → S0 or S0/0 or S0/0/0 Serial interface 1 → R1 or S0/1 or S0/0/1
To go to PRIVILEGE MODE Router> enable this prompt is known as Privilege mode (enable mode)
Router#
To go to GLOBAL MODE Router # config t this prompt is known as Global Configuration mode
Router (config) #
NOTE:
The values within { } braces are variables. So, you should change it according to your configuration need and braces are not part of commands
To assign Hostname for Router Router (config) # hostname {any name for the router such as R1} Hostname can be any, it is a variable
Router (config) # hostname R1 R1, is hostname here
To enable plain text (unencrypted) password R1(config) # enable password {any password you like to have} Password can be any. It is a variable and unencrypted.
To enable encrypted password R1(config)# enable secret {any password you like to have but must be Password can be any. It is a variable and enable secret
different from enable password} password is encrypted password.
NOTE:
If you have both ‘enable password’ and ‘enable secret’
passwords in your configuration then secret password is the
first priority among them. Hence, when you type password you
have to provide the secret password.
To go to Gigabit Interface 0/0 and to assign IP R1(config) # interface G0/0
address and Subnet Mask R1(config-if) # ip address {ip address for Gi0/0 } { S. M. for Gi0/0}
R1(config-if) # no shutdown
Once inside of the interface prompt (config-if) #, IP and SM
To go to Gigabit Interface 0/1 and to assign IP R1(config) # int G0/1
should be assigned.
address and Subnet Mask R1(config-if) # ip address {ip address for Gi0/1 } { S. M. for Gi0/1}
R1(config-if) # no shutdown
IP address is always accompanied by SM.
To go to Serial Interface 0/0/0 and to assign R1(config) # int s0/0/0
‘No Shutdown’ command is a must to activate the interface.
IP address and Subnet Mask R1(config-if) # ip address {ip address for s0/0/0 } { S. M. for s0/0/0}
R1(config-if) # no shutdown
R1(config-if) # exit
To go to Serial Interface 0/0/01 and to assign R1(config) # int s0/0/1
IP address and Subnet Mask R1(config-if) # ip address {ip address for s0/0/1 } { S. M. for s0/0/1}
R1(config-if) # no shutdown
R1(config-if) # exit
To activate remote TELNET ACCESS R1(config ) # line vty 0 4 VTY stands for Virtual Tele Type. Allows the remote users to
R1(config-line) # password {any password you like to have} access R1 router.
R1(config-line) # login Must, to have a Password to give remote users to access
R1router.
‘login’ allows to login remotely for VTY (Virtual Tele Type)
users.
NOTE:
Telnet does not encrypt the communication between remote
users and the local R1router. Transaction happens in plain text
only.
To activate remote SSH ACCESS R1(config)# ip domain-name VU21988 Allows the remote users to access R1router using Secure
R1(config)# username teacher password student Shell (SSH) with fully encrypted communication between
R1(config)# ip ssh version 2 remote and local R1router.
R1(config)# crypto key generate rsa general-keys modulus 2048
As line vty is indicating ZERO (0), it allows only one remote
R1(config)# line vty 0 SSH user to be connected to router R1in this example.
R1(config-line)# login local
‘line vty 0’ opens the remote session for 1 user only.
NOTE:
‘Login’ command allows to login to the device but asks the
password while the user is trying to login to the device.
To disable DNS lookup R1(config)# no ip domain-lookup Router will not find DNS to resolve unnecessary commands
with errors in it.
To create domain name R1(config)# ip domain-name {name of the domain} This is not URL, the domain-name holds the local database
R1(config)# ip domain-name melbournepoly.com such as username, password
To encrypt clear text password R1(config)# service password-encryption All plain text passwords will be encrypted
To save the configuration
What for Configuration Syntax Comments
To save the currently running configuration R1# copy running-config startup-config Saves content or RAM to NVRAM, where NVRAM is Non-
from RAM to startup configuration NVRAM Volatile memory. It keeps the configuration even if the router
is turned off.
Or
NOTE:
A Switch or a Router has various types of memory such as –
RAM → [Volatile]
NVRAM → [Non-Volatile]
ROM → [Permanent]
Flash → [Stores IOS files and can be us to store backup files]
To view the IPv6 routes and routing table R1# show ipv6 route It shows the IPv6 routing table so that the router can route
the packets from one interface to another interface.
To view status of IPv6 interfaces R1# show ipv6 interface brief Shows the status of all the IPv6 interfaces briefly
Dynamic Routing Protocol
To advertise the local networks/subnetworks on a Router
What for Configuration Syntax Comments
To ROUTE / To Advertise R1(config) # router eigrp {Autonomous System Number} EIGRP is Cisco proprietary dynamic routing protocol. EIGRP
is accompanied by Autonomous System Number.
(Only advertise those networks which are R1(config-router) # network {network address for G0/0} {wildcard mask}
directly connected to the router) Once inside routing prompt (config-router)# , ‘Network’
R1(config-router) # network {network address for G0/1} {wildcard mask} command is used to advertise the directly connected networks
NOTE: on the router so that the remote routers will know these
If you advertise your local networks then the R1(config-router) # network {network address for S0/0} {wildcard mask} networks via EIGRP Hello packets.
remote routers can learn your router’s local
networks. For this both local and remote R1(config-router) # network {network address for S0/1} {wildcard mask} Wild Card Mark is inverse of SM.
routers must advertise their
networks/subnetworks on the similar routing All the networks must be advertised.
protocol such as EIGRP is being used here.
EIGRP is one of a dynamic routing protocol. NOTE: NOTE:
You need to advertise your local networks only when you have 2 or There are various types of dynamic routing protocols. e.g.
IMPORTANT !!! PLEASE TAKE NOTE: more than 2 routers in your topology. RIP → Routing Information Protocol
It is not required to advertise your networks if EIGRP → Enhanced Interior Gateway Routing Protocol
all the subnets are directly connected to only OSPF → Open Shortest Path First
one router as show in the topology diagram.
A router can switch packets from one
interface to another interface without any
routing protocol.
Show commands SYNTAX
What for Configuration Syntax Comments
To view current contents of RAM (running R1# show running-config displays entire configuration of router that is currently running
configuration) on the RAM
Or
To view the current contents of non-volatile R1# show startup-config If you have not saved running-config from RAM to startup-
random-access memory (NVRAM) config i.e. NVRAM then it may say “startup-config is not present”.
Or
Hence, it is a must to do “copy running-config startup-config”
R1# show start prior to run “show start” command.
To view the contents of the FLASH R1 # show flash: shows all the contents of flash: memory. Normally flash: is the
home for IOS file(s).
NOTE:
A Switch or a Router has various types of memory such as –
RAM
NVRAM
ROM
FLASH
To view the ARP table of the router R1# show arp ARP Table displays mapping between Layer 2 (MAC address) to
Layer 3 (IP address).
R1# show version Shows the version of IOS. Here, it can be seen that the IOS version
is 15.4.1(4)M4. It also show a lot of other information such as
hardware platform of this router here is C2900.
R1# show interface gi0/0 Shows the detailed information about gi0/0 interface including
hardware address (MAC address), IP addrress, MTU (Maximum
Transmission Unit for a packet to travel), BW (Bandwidth), DLY
(Delay), reliability, Transmit load, Receive load, Encapsulation type
and many more.
To erase the start-up configuration from NVRAM
What for Configuration Syntax Comments
To erase the previously saved ‘startup’ R1# erase startup-config Erases the previously saved ‘startup’ configuration from NVRAM
configuration from NVRAM permanently. Hence, make sure that you really want to erase or
not.
NOTE:
If the running-config from RAM was not saved into NVRAM then
above command cannot be performed.