General Commands


General Commands

Here is a list of the general commands. These are the basic level commands and most commonly used
no shutdown - (enables the interface)
reload - restarts the router
sh ver - Cisco IOS version, uptime of router, how the router started, where system was loaded from, the interfaces the POST found, and the configuration register
sh clock - shows date and time on router
sh history - shows the history of your commands
sh debug - shows all debugging that is currently enabled
no debug all - turns off all debugging
sh users - shows users connected to router
sh protocols - shows which protocols are configured
banner motd # Your customized message here # - Set/change banner
hostname <give router name> - use to configure the hostname of the router
clear counters - clear interface counters


Privileged Mode commands of a router

Learn how to work in the privileged mode of a router.
enable - get to privileged mode
disable - get to user mode
enable password <give password here> - sets privileged mode password
enable secret <give password here> - sets encrypted privileged mode password
Setting Passwords on router
Here you will be able to learn how to set the password on a router.
enable secret <give password here> - set encrypted password for privileged access
enable password <give password here> - set password for privileged access (used when there is no enable secret and when using older software)
Setting the password for console access:
(config)#line console 0
(config-line)#login
(config-line)#password <put password here>
Set password for virtual terminal (telnet) access (password must be set to access router through telnet):
(config)#line vty 0 4
(config-line)#login
(config-line)#password <put password here>
Set password for auxiliary (modem) access:
(config)#line aux 0
(config-line)#login
(config-line)#password <put password here>


Router Processes & Statistics

By these command you can see the statistics and different processes of the router.
sh processes - shows active processes running on router
sh process cpu - shows cpu statistics
sh mem - shows memory statistics
sh flash - describes the flash memory and displays the size of files and the amount of free flash memory
sh buffers - displays statistics for router buffer pools; shows the size of the Small, Middle, Big, Very Big, Large and Huge Buffers
sh stacks - shows reason for last reboot, monitors the stack use of processes and interrupts routines


IP Commands

Here is a list of the IP Commands
Configure IP on an interface:
int serial 0
ip address 157.89.1.3 255.255.0.0
int eth 0
ip address 2008.1.1.4 255.255.255.0


Other IP Commands:

sh ip route - view ip routing table
ip route <remote_network> <mask> <default_gateway> [administrative_distance] - configure a static IP route
ip route 0.0.0.0 0.0.0.0 <put gateway of the last resort here> - sets default gateway
ip classless - use with static routing to allow packets destined for unrecognized subnets to use the best possible route
sh arp - view arp cache; shows MAC address of connected routers
ip address 2.2.2.2 255.255.255.0 secondary - configure a 2nd ip address on an interface
sh ip protocol

CDP Commands (Cisco Discovery Protocol uses layer 2 multicast over a SNAP-capable link to send data):
sh cdp neighbor - shows directly connected neighbors
sh cdp int - shows which interfaces are running CDP
sh cdp int eth 0/0 - show CDP info for specific interface
sh cdp entry <cdp neighbor here> - shows CDP neighbor detail
cdp timer 120 - change how often CDP info is sent (default cdp timer is 60)
cp holdtime 240 - how long to wait before removing a CDP neighbor (default CDP holdtime is 180)
sh cdp run - shows if CDP turned on
no cdp run - turns off CDP for entire router (global config)
no cdp enable - turns off CDP on specific interface


IPX Commands

Enable IPX on router:
ipx routing
Configure IPX + IPX-RIP on an int:
int ser 0
ipx network 4A


Other Commands:

sh ipx route - shows IPX routing table
sh ipx int e0 - shows ipx address on int
sh ipx servers - shows SAP table
sh ipx traffic - view traffic statistics
debug ipx routing activity - debugs IPS RIP packets
debug ipx sap - debugs SAP packets


Routing Protocols

RIP, IGPR and OSPF are the routing protocols and here is a list of the commands for the working on the routing protocols.
Configure RIP:
router rip
network 157.89.0.0
network 208.1.1.0
Other RIP Commands:
debug ip rip - view RIP debugging info
Configure IGRP:
router IGRP 200
network 157.89.0.0
network 208.1.1.0
Other IGRP Commands:
debug ip igrp events - view IGRP debugging info
debug ip igrp transactions - view IGRP debugging info
Access Lists
Here is a list of the Access list command of a router.
sh ip int ser 0 - use to view which IP access lists are applies to which int
sh ipx int ser 0 - use to view which IPX access lists are applies to which int
sh appletalk int ser 0 - use to view which AppleTalk access lists are applies to which int
View access lists:
sh access-lists
sh ip access-lists
sh ipx access-lists
sh appletalk access-lists
Apply standard IP access list to int eth 0:
access-list 1 deny 200.1.1.0 0.0.0.255
access-list 1 permit any
int eth 0
ip access-group 1 in
Apply Extended IP access list to int eth 0:
access-list 100 deny tcp host 1.1.1.1 host 2.2.2.2 eq 23
access-list 100 deny tcp 3.3.3.0 0.0.0.255 any eq 80
int eth 0
ip access-group 100 out
Apply Standard IPX access list to int eth 0:
access-list 800 deny 7a 8000
access-list 800 permit -1
int eth 0
ipx access-group 800 out
Apply Standard IPX access list to int eth 0:
access-list 900 deny sap any 3378 -1
access-list 900 permit sap any all -1
int eth 0
ipx access-group 900 out


WAN Configurations Commands

Networking over WAN is the main functionality of a router. The most common use of a router is for the WAN connectivity. Here is a list of the commands for the different methods of the WAN connectivity.

PPP Configuration

Point to point protocol is a method for the WAN connectivity and you will find here some commands of PPP.
encapsulation pppppp authentication <chap or pap here>
ppp chap hostname <put router name here>
ppp pap sent-username <put user name here>
sh int ser 0 - use to view encapsulation on the interface


Frame-Relay Configuration

One of the methods for the WAN connectivity is the Frame Relay. Find here some basic commands for the WAN connectivity through Frame Relay.
encapsulation frame-relay ietf - use IETF when setting up a frame-relay network between a Ciscorouter and a non-Cisco router
frame-relay lmi-type ansi - LMI types are Cisco, ANSI, Q933A; Cisco is the default; LMI type is auto-sensed in IOS v11.2 and up
frame-relay map ip 3.3.3.3 100 broadcast - if inverse ARP won't work, map Other IP to Your DLCI # (local)
keep alive 10 - use to set keep alive
sh int ser 0 - use to show DLCI, LMI, and encapsulation info
sh frame-relay pvc - shows the configured DLCI's; shows PVC traffic stats
sh frame-relay map - shows route mapssh frame-relay lmi - shows LMI info


Miscellaneous Commands

In the last but not least here is a list of the some miscellaneous and useful commands
sh controller t1 - shows status of T1 lines
sh controller serial 1 - use to determine if DCE or DTE device
(config-if)#clock rate 6400 - set clock on DCE (bits per second)
(config-if)#bandwidth 64 - set bandwidth (kilobits)

DEFAULT ROUTING


DEFAULT ROUTING


Syntax:
Router(config)#ip route 0.0.0.0 0.0.0.0 {<Next hop IP address> or < Exit Interface type><No.>}


ON DELHI:-
DELHI #configure terminal
DELHI(config) #ip routing
DELHI(config-if)#ip route 0.0.0.0 0.0.0.0 Serial 0
DELHI(config) #exit
DELHI#
To verify, the following commands can be give on all Routers
Show commands:

Router#show ip route
Output:

Delhi#sh ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - IS-IS, 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

STATIC ROUTING – Example 2

STATIC ROUTING – Example 2

Configure Static Route to allow LAN at Delhi, Kolkata & Mumbai  to communicate with each other:


ON DELHI:   .
DELHI#configure terminal
DELHI(config)#ip routing
DELHI(config)#ip route 10.0.0.0 255.0.0.0 172.16.0.2
DELHI(config)#ip route 192.168.2.0 255.255.255.0 172.16.0.2
DELHI(config)#ip route 172.17.0.0 255.255.0.0 172.16.0.2



ON KOLKATA:   .
KOLKATA#configure terminal
KOLKATA(config)#ip routing
KOLKATA(config)#ip route 192.168.1.0 255.255.255.0 172.16.0.1
KOLKATA(config)#ip route 192.168.2.0 255.255.255.0 172.17.0.2


ON MUMBAI:   .
MUMBAI#configure terminal
MUMBAI(config)#ip routing
MUMBAI(config)#ip route 10.0.0.0 255.0.0.0 S1
MUMBAI(config)#ip route 192.168.2.0 255.255.255.0 S1
MUMBAI(config)#ip route 172.17.0.0 255.255.0.0 S1

To verify, the following commands can be give on all Routers
Show commands: 
Router#show ip route

To view the routing table for verification of static route
Syntax:
Router#show ip route


Output : 


Kolkata#sh ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - IS-IS, 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    10.0.0.0/8 is directly connected, FastEthernet0/0
C    172.16.0.0/16 is directly connected, Serial0/0/0
C    172.17.0.0/16 is directly connected, Serial0/0/1
S    192.168.1.0/24 [1/0] via 172.16.0.1
S    192.168.2.0/24 [1/0] via 172.17.0.2


'S" represents Static route. The IP Network was defined through the Static routing command.



Syntax:
Router#ping <IP of destination PC>

Output : 

Kolkata#ping 192.168.1.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 5/14/34 ms



#############################################################################

To enable the logs on telnet session give the following command."(By default logs can be seen only on Console)

Router#terminal monitor


To view logs of any changes in the routing table, use the following command: 


Router#debug ip routing


To view the source and destination of the packet, use the following command: 

Router#debug ip packet


















STATIC ROUTING

STATIC ROUTING



By default IP routing process is disabled. To enable IP Routing use the following command in Global configuration Mode:-

Command:
Router(config)#ip routing

To verify the routing table after routing is enabled.

Output:

Kolkata# sh ip route

Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, 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    10.0.0.0/8 is directly connected, FastEthernet0/0
C    172.16.0.0/16 is directly connected, Serial0/0/0
C    172.17.0.0/16 is directly connected, Serial0/0/1

Once routing is enabled the directly connected networks are automatically added into the routing table. “C” represents directly connected networks. The IP Network was learnt through the local Interface of the router.

To configure static Routing use the following Syntax:

Syntax:
Router(config)#ip route <Destination Network ID> <Destination Subnet Mask> {<Next hop IP address> or < Exit Interface type><No.>}


Dest N/W ID:              Network ID (of the remote network)
Dest Subnet Mask:    Subnet Mask (of the remote network)
Next hop IP Address: IP Address of the Next Router (directly connected)
Exit interface type & Number: outgoing interface type and number

STATIC ROUTING – Example 1


Configure Static Route to allow LAN of Delhi to communicate with LAN of Kolkata and vice-versa: 



ON DELHI:-

DELHI #configure terminal
DELHI(config) #ip routing
DELHI(config)#ip route 10.0.0.0 255.0.0.0 Serial 0
DELHI(config) #exit
DELHI#
ON KOLKATA:-

KOLKATA #configure terminal
KOLKATA(config) #ip routing
KOLKATA(config)#ip route 192.168.1.0 255.255.255.0 172.16.0.1
KOLKATA(config) #exit
To verify, the following commands can be give on all Routers
Show commands:

Router#show ip route
Output:

Delhi#sh ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - IS-IS, 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
S    10.0.0.0/8 is directly connected, Serial0/0/0
C   172.16.0.0/16 is directly connected, Serial0/0/0
C   192.168.1.0/24 is directly connected, FastEthernet0/0

WAN INTERFACE CONFIGRATION


WAN Interface Configuration


The first step to establish the WAN connection is to configure the Serial (WAN) interface.
By default the serial interface on the Router does not have IP address, encapsulation is HDLC and the interface is in shutdown state.
Note: To check the DTE or DCE interface, so that the clock rate can be configured on the DCE interface.
Syntax:
Router#show controllers serial <no>
Output:
Router#show controllers serial0/0/0
Interface Serial0/0/0
Hardware is PowerQUICC MPC860
idb at 0x81081AC4, driver data structure at 0x81084AC0
SCC Registers:
General [GSMR]=0x2:0x00000000, Protocol-specific [PSMR]=0x8
Events [SCCE]=0x0000, Mask [SCCM]=0x0000, Status [SCCS]=0x00
Transmit on Demand [TODR]=0x0, Data Sync [DSR]=0x7E7E
Interrupt Registers:
Config [CICR]=0x00367F80, Pending [CIPR]=0x0000C000
Mask   [CIMR]=0x00200000, In-srv  [CISR]=0x00000000
Command register [CR]=0x580
Port A [PADIR]=0x1030, [PAPAR]=0xFFFF [PAODR]=0x0010, [PADAT]=0xCBFF
Port B [PBDIR]=0x09C0F, [PBPAR]=0x0800E [PBODR]=0x00000, [PBDAT]=0x3FFFD
Port C [PCDIR]=0x00C, [PCPAR]=0x200 [PCSO]=0xC20,  [PCDAT]=0xDF2, [PCINT]=0x00F
Receive Ring
        rmd(68012830): status 9000 length 60C address 3B6DAC4
        rmd(68012838): status B000 length 60C address 3B6D444
Transmit Ring
 --More—
The following are the commands to assign IP, encapsulation & enable the serial port:
Syntax:
Router(config)#interface serial <no>
Router(config-if)#ip address <ip> <mask>
Router(config-if)#encapsulation <ppp> or <hdlc>
Router(config-if)#clockrate <bandwidth>
Router(config-if)#no shutdown



WAN CONFIGRATION EXAMPLE:-

ON DELHI:-

DELHI #configure terminal
DELHI(config) #interface serial 0
DELHI(config-if)#ip address 172.16.0.1 255.255.0.0
DELHI(config-if) #no shutdown
DELHI(config-if) #encapsulation hdlc
DELHI(config-if) #exit
DELHI(config) #exit
DELHI#
  
ON KOLKATA:-

KOLKATA #configure terminal
KOLKATA(config) #interface serial 0
KOLKATA(config-if)#ip address 172.16.0.2 255.255.0.0
KOLKATA(config-if) #no shutdown
KOLKATA(config-if) #encapsulation hdlc
KOLKATA(config-if) #clock rate 64000
KOLKATA(config) #exit
KOLKATA(config) #interface serial 1
KOLKATA(config-if)#ip address 172.17.0.1 255.255.0.0
KOLKATA(config-if) #no shutdown
KOLKATA(config-if) #encapsulation hdlc
KOLKATA(config-if) #clock rate 64000
KOLKATA(config) #exit
KOLKATA #
ON MUMBAI:-

MUMBAI#configure terminal
MUMBAI(config) #interface serial 0
MUMBAI(config-if)#ip address 172.17.0.2 255.255.0.0
MUMBAI(config-if) #no shutdown
MUMBAI(config-if) #encapsulation hdlc
MUMBAI(config-if) #exit
MUMBAI(config) #exit
MUMBAI#
To Verify, the following commands can be give on all Routers :-

Router#show controllers serial <number>
Router#show interface serial <number>


Check the serial interface connectivity
Syntax:

Router#show interface serial <no>
Output:-
Kolkata#show interfaces serial 0/0/0

Serial0/0/0 is up, line protocol is down (disabled)
Hardware is HD64570
Internet address is 172.16.0.2/16
MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation HDLC, loopback not set, keepalive set (10 sec)
Last input never, output never, output hang never
Last clearing of "show interface" counters never
Input queue: 0/75/0 (size/max/drops); Total output drops: 0
Queueing strategy: weighted fair
Output queue: 0/1000/64/0 (size/max total/threshold/drops)
Conversations  0/0/256 (active/max active/max total)
Reserved Conversations 0/0 (allocated/max allocated)
Available Bandwidth 1158 kilobits/sec
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
0 packets input, 0 bytes, 0 no buffer
Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
0 packets output, 0 bytes, 0 underruns
0 output errors, 0 collisions, 2 interface resets
0 output buffer failures, 0 output buffers swapped out
0 carrier transitions
DCD=up  DSR=up  DTR=up  RTS=up  CTS=up
From the output, the first line indicates the status of the serial interface, there are 4 different states:
<!--[if !supportLists]
1.      Serial 0/0 is up, line protocol is up
            (Layer 1 & Layer 2 Connectivity and configuration is fine)
2.      Serial 0/0 is administratively down, line protocol is down
                 (No Shutdown has to be given on the local router serial interface)
3.     Serial 0/0 is up, line protocol is down
             (Encapsulation mismatch, clock rate has not been given on the DCE                
              interface or Lease Line problem)
4.      Serial 0/0 is down, line protocol is down
(Problem with the v.35 cable, csu/dsu or 'no shutdown' has not been given on the remote Router)






-->