Basic Cisco IOS Commands
Basic Cisco IOS Commands
PM Networking
Cisco IOS
IOS Basics PM Networking
1. Getting familiar with the modes:
Router>
Switch>
This is User mode. It will allow you to view the state of the router,but will not allow you to modify its configuration.
Router>enable
Router#
If you give the enable command in user mode notice the prompt changes and you move to the privilege mode. This mode allows
administrator to modify some of the configuration of the router or switch.
Router>disable
Router>
If you give the disable command in privilege mode, notice the prompt changes and you move back to the user mode.
Router#configure terminal
Router(config)#
If you give configure terminal command in privilege mode you move into global configuration mode. This mode is used commonly for
configuring most of the configurations on router or to go further into other configuration modes like interface configuration mode.
Router(config)#exit
Router#
If you want to move back to privilege mode use the command as shown.
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R1
R1(config)#
R1(config)#banner motd @
Enter TEXT message. End with the character '@'.
NOTICE
THIS IS A PRIVATE NETWORK. DON'T PROCEED FURTHER IF YOU ARE NOT AUTHORISED TO.
PM Networking
5. Saving the configuration on a router :
PM Networking
7. Enable Secret password on a Router :
R1#show running-config
Building configuration...
Current configuration : 627 bytes
hostname R1
enable password cisco
enable secret 5 $1$mERr$5.a6P4JqbNiMX01usIfka/
PM Networking
8. Configure Console password :
Console password will be asked whenever someone is trying to access the router through
console port.
R1(config)#line console 0
R1(config-line)#password cisco
R1(config-line)#login
R1(config-line)#exit
The first command here moves you into line configuration mode for console port. Then we set
cisco as the password. The login command here enables password checking or you can say that
it tells the router to ask for password when someone is trying to access through console port.
Now again this password is also shown as clear text if someone checks the running-config. So to encrypt all of our
clear text passwords we can use the below mentioned command to encrypt all of our passwords that are shown in
clear text like console password, enable password. To verify this you can use show run after this command.
R1(config)#service password-encryption
PM Networking
9. Configure IP on a router :
You can configure IP on some interface of a router. Here first we move in to the interface
configuration mode for the interface fastethernet 0/0 using the first command. There we
specify the IP address we want to assign to interface followed by the subnet mask we
intend to use.
Now by default the interface is administratively down or in other words the interface has a command
shutdown under interface configuration. To remove any command from a router we can add no in front of
that command. So we turn on the interface by no shutdown. Router can be seen displaying a log message
that it was successful in bringing the interface up.
PM Networking
10. Configure Telnet on a router :
R1(config)#line vty 0 4
#Telnet 192.168.10.2
R1(config-line)#password cisco
R1(config-line)#login
R1(config-line)#exit
R1(config)#
First we move into the line configuration mode for virtual terminal line. Here ‘0 4’ means we are configuring the
router for 0 to 4 i.e. a total of five concurrent telnet sessions. A total of 5 people can telnet this router at the
same time. Now we configure the password as cisco for telnet and just like we enabled password checking for
console using the login command, we are enabling password checking for telnet. There are these 3 sub portions
of telnet config which should be configured on to the router before you can access it through-
1. An interface with IP
2. Enable password or Enable secret
3. Vty config(which we just did)
PM Networking
11. Configure Secure Shell (SSH) on a router :
PM Networking
11. Configure Telnet on Layer-2 Switch :
PM Networking
10.0.0.1 10.0.0.2
Command on Switch
Command on PC Switch>enable
pc>telnet 10.0.0.2 Switch#config t
password: cisco Switch(config)#interface vlan 1
Switch> Switch(config-if)#no shutdown
Switch>enable Switch(config-if)#ip address 10.0.0.1 255.0.0.0
password: 123 Switch(config-if)#exi
Switch#config t Switch(config)# line vty 0 4
Switch(config)# Switch(config-line)#password cisco
Switch(config-line)#login
Switch(config-line#)exit
Now you can configure Switch(config)#enable password 123
Switch(config)#exit
Switch from PC.
PM Networking
12. Configure DHCP on a Router :
Command on Router
Command on PC1
PC1(config)#interface fastethernet 0/0
PC1(config-if)#no shutdown
PC1(config-if)#ip address dhcp
PM Networking
13. Configure DHCP Server in your LAN Network :
DHCP Server
PM Networking
Step #2:- Enable DHCP Service on Server.
192.168.10.100
DHCP Server
Step #4:- Provides Default-Gateway, DNS server ip address, Start ip address and
subnet mask.
PM Networking
DHCP Server configuration is done.
Step #5:- Client will request for ip address to DHCP Server and
DHCP Server will offer IP address.
192.168.10.100
ip 192.168.10.2
D.G 192.168.10.100 DHCP Server
PM Networking
14. Configure DHCP Relay-agent : Command on R1
Router(config)interface fastethernet 0/0
Router(config-if)ip address 192.168.10.1 255.255.255.0
192.168.10.1/24 192.168.20.1/24
Router(config-if)#no shutdown
Router(config-if)#ip helper-address 192.168.20.2
Router(config-if)exit
Router(config)#int f0/1
Router(config-if)#ip address 192.168.20.1 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#
192.168.20.2/24
D.G- 192.468.20.1
IP Configuration on
DHCP Server.
PM Networking
Enable DHCP Service on Server
192.168.10.1/24 192.168.20.1/24
192.168.20.2/24
D.G- 192.468.20.1
10.10.10.0/24
20.10.10.0/24 30.10.10.0/24
Command on R3
Router(config)interface fastethernet 0/0
Router(config-if)ip address 192.168.10.6 255.255.255.252
Router(config-if)#no shutdown
Router(config-if)exit
Router(config)#int f0/1
Router(config-if)#ip address 30.10.10.10 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#ip route 20.10.10.0 255.255.255.0 fast0/0 192.168.10.5
Router(config)#ip route 30.10.10.0 255.255.255.0 fast0/0 192.168.10.5
PM Networking