Cisco Commands : Part 1

Configuring hostname

Router#

Router#configure terminal

Router(config)#hostname R1

R1(config)#exit

R1#

Enabling telnet and configuring telnet password

R1#

R1#configure terminal

R1(config)#line vty 0 4

R1(config-line)#password zframez

R1(config-line)#login

R1(config-line)#exit

R1(config)#exit

R1#

What is “vty” stands for ?

vty stands for “Virtual teleTYpe” or “Virtual teleTYpwriter”

The command line interface (CLI) used by devices like routers,switches or even computers are called as VTY. This name comes from the term TTY or TeleTYpewriter (a device with monitor and keyboard) which was used in the early days to give inputs and get output from a central computing system. TTY is also known as Terminal. Users need to use Telnet or SSH to access the CLI orVTY of a device.

Now since we are not using a physical TTY anymore, the term Vitrual teleTYpe or VTY is used to represent the CLI of devices.

What is 0 and 4 in the command “line vty 0 4” stands for ?

Each Telnet or SSH connection is called as a line connected to the device , and “line 0 4” means 5 telnet connections (line 0 , line 1 …. line4) are allowed to the device

The maximum number of simultaneous telnet connections allowed to a cisco device varies from model to model (5 and 16 are commonly used)

Configuring enable password

R1#configure terminal

R1(config)#enable password zframez

R1(config)#exit

Note: Users are allowed to telnet to a router only after configuring telnet and enable password

SHOW commands

R1#show ip interface brief

Interface                  	IP-Address      OK? 	Method 		Status		Protocol
FastEthernet0/0            192.168.1.1    	YES 	manual 		up			up      
FastEthernet0/1            Unassigned      	YES 	unset  		down		down  

Router#show ip route

Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

C    192.168.1.0/24 is directly connected, FastEthernet0/0

R1#show cdp neighbors

Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                  S - Switch, H - Host, I - IGMP, r - Repeater

Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
R2	             Fas 0/0 

R1#show cdp neighbors detail

Device ID: R2
Entry address(es): 
  IP address: 192.168.1.2
Platform: Cisco 2691,  Capabilities: Router Switch IGMP 
Interface: FastEthernet0/0,  Port ID (outgoing port): FastEthernet0/0
Holdtime : 150 sec

Version :
Cisco IOS Software, 2600 Software (C2691-ENTSERVICESK9-M), Version 12.4(13b), RELEASE SOFTWARE (fc3)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2007 by Cisco Systems, Inc.
Compiled Tue 24-Apr-07 15:33 by prod_rel_team

advertisement version: 2
VTP Management Domain: ''
Duplex: half

R1#show ip protocols

Routing Protocol is "rip"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Sending updates every 30 seconds, next due in 0 seconds
  Invalid after 180 seconds, hold down 180, flushed after 240
  Redistributing: rip
  Default version control: send version 1, receive any version
    Interface             Send  Recv  Triggered RIP  Key-chain
    FastEthernet0/0       1     1 2                                  
  Automatic network summarization is in effect
  Maximum path: 4
  Routing for Networks:
    192.168.1.0
  Routing Information Sources:
    Gateway         Distance      Last Update
  Distance: (default is 120)

Checking configuration files

The current configuration is stored in a file “running-config” and the saved configuration which is loaded while router is booting is stored in the file “startup-config”

R1#show running-config

R1#show startup-config

To save the current configuration, you can use any one of the following commands

R1#copy running-config startup-config

R1#copy run start

R1#write

Configuring IP address and Mask in an interface

Following commands are used to configure IP and Mask in the interface “FastEthenet 0/0” of the router. “No Shutdown” command is used to enable the interface

R1#
R1#configure terminal 
R1(config)#interface fastEthernet 0/0                
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#no shutdown 
R1(config-if)#exit
R1(config)#exit
R1#

Configuring static routes

R1#
R1#configure terminal 
R1(config)#ip route 20.0.0.0 255.0.0.0 192.168.1.2
R1(config)#exit
R1#

The above "ip route" command is used to create a static route to the network 20.0.0.0/8 via the next-hop 192.168.1.2

R1#show ip route

S    20.0.0.0/8 [1/0] via 192.168.1.2
C    192.168.1.0/24 is directly connected, FastEthernet0/0
R1#

Related:

Cisco RIP configuration commands

Cisco OSPF configuration examples


CONTACT

Contact us and we'll get back to you within 24 hours.

#11, 8th cross, Indiranagar 1st stage, Bangalore, India

Queries?
You can connect with us on Whatsapp 8884 884 844