0% found this document useful (0 votes)
55 views9 pages

Router Configuration With SYNTAX (Updated)

The document provides configuration syntax for basic router configuration including assigning a hostname, enabling passwords, configuring interfaces with IP addresses, and enabling remote access via Telnet and SSH. The syntax shows how to navigate configuration modes and configure items like passwords, IP addresses, and interfaces.

Uploaded by

jeevi27
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views9 pages

Router Configuration With SYNTAX (Updated)

The document provides configuration syntax for basic router configuration including assigning a hostname, enabling passwords, configuring interfaces with IP addresses, and enabling remote access via Telnet and SSH. The syntax shows how to navigate configuration modes and configure items like passwords, IP addresses, and interfaces.

Uploaded by

jeevi27
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Basic Router configuration SYNTAX

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

What for Configuration Syntax Comments


Factory default Router prompt Router>  this prompt is known as User mode

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.

 ‘login local’ enforces to check the local database for


username and password while the remote user is trying to
login to the device. In this example teacher and student are
the local database.
To assign password on CONSOLE PORT R1(config ) # line con 0  ‘Console 0’ is a physical port on a router that allows to
R1(config-line) # password {any password you like to have} connect a computer to manage the router using terminal
R1(config-line) # login applications such as Putty, Hyper Terminal, SecureX, Minicom
R1(config-line) # exit etc.

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

R1# copy run start


To save the currently running configuration R1# copy running-config flash Flash is a kind of memory which stores IOS (Inter-network
from RAM to FLASH as a back up copy. Operating System). It can also keep backup files in it such as
running configuration. In order to keep the backup file, a user
must manually copy file to the FLASH memory.

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 restart the Router


What for Configuration Syntax Comments
To reboot the Router R1 # reload  Restarts the Router

Message of the Day [motd] Banner SYNTAX


What for Configuration Syntax Comments
To configure message of the day Banner R1# config t  Banner will show up when the user is trying to access or
login to the device.
R1(config)# banner motd “Authorized Access Only."
R1(config)# exit NOTE:
“Authorized Access Only." is variable here.
IPV6 SYNTAX including SHOW commads for IPv6
What for Configuration Syntax Comments
To activate IPv6 protocol on the device R1(config)# ipv6 unicast-routing  Activates IPv6 protocol on the router
To assign global IPv6 address on interfaces R1(config)# int gi0/0  Assigns IPv6 address as 2001:CAFE:FEED:1::1 where /64 is the
R1(config-if)# ipv6 address 2001:CAFE:FEED:1::1/64 subnetmask.
R1(config-if)# no shutdown
R1(config-if)# exit NOTE:
R1(config)# 2001:CAFEFEED:1 is the network portion and ::1 is the host
portion. Here, ::1 is equivalent to .1 in IPv4.
To assign Link-local IPv6 address on R1(config)# int gi0/0  Assigns IPv6 link-local address as fe80::1.
interfaces R1(config-if)# ipv6 address fe80::1 link-local
R1(config-if)# no shutdown NOTE:
R1(config-if)# exit Link-local addresses are valid within Local Area Network only.
R1(config)# Hence, it is not passed on to next subnet by the router.

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

R1# show run

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

On above example, IOS file name is -


c1900-universalk9-mz.SPA.151-4.M4.bin
Where, C1900 is the hardware platform of the router.
The other files are signature definition files.
To view status of all the interfaces briefly R1# show ip interface brief It shows brief information of all the interfaces as seen below –

It shows brief information about interfaces such as whether the IP


address has been assigned or not. Additionally, it also shows
whether the status is up or down or administratively down.
NOTE:
‘Down’ means the port is not yet up and the reason could be many
what if’s.
‘administratively down’ means the administrator has not
configured the port with the command ‘no shutdown’
To view the current routing tables R1# show ip route It shows all the active routes that are available within the router.
CDP – Cisco Discovery Protocol R1# show cdp neighbors It shows all the Cisco devices that are connected with the Cisco
To view cisco devices that are connected with router.
each other.

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.

You might also like