Cisco IOS and Router Command Reference

All of the information, instructions, and recommendations on this Web site are offered on a strictly "as is" basis. Remember "Murphy's Law." Please take the proper precautions before attempting any of the tips or modifications listed here.

Contents


Cisco IOS Modes of Operation
Status, Settings, and Diagnostic Commands
Interface Configuration
Configure the RIP Routing Process
Configure the OSPF Routing Process
Configure DHCP Server
Switch: VLAN (Virtual Local Area Network)
Network Simulators and Emulators
References
Computer Tips index

 


[ Top ] [ Home ]

 

Cisco IOS Modes of Operation

The Cisco IOS software provides access to several different command modes. Each command mode provides a different group of related commands.

For security purposes, the Cisco IOS software provides two levels of access to commands: user and privileged. The unprivileged user mode is called user EXEC mode. The privileged mode is called privileged EXEC mode.

The following table describes some of the most commonly used modes, the resulting prompts, and how to enter these modes. The prompt helps you identify which mode you are in and, therefore, which commands are available to you.

Mode of Operation Prompt / Mode How to Enter the Mode Usage
User EXEC (aka unprivileged mode) Router> First level accessed Change terminal settings on a temporary basis, perform basic tests, and list system information
Privileged EXEC Router# From user EXEC mode, enter enable System administration, set operating parameters
Global Configuration Router(config)# From privileged EXEC, enter configure terminal Modify configurations that affect the system as a whole
Interface Configuration Router(config-if)# From global config mode, enter:
interface <interface type> <slot>/<interface #>
Modify the operation of an interface.

 

 


[ Top ] [ Home ]

 

Status, Settings, and Diagnostic Commands

Note: The default Console/Serial/COM port settings are: 9600, 8, N, 1, none

Prompt / Mode Command Description
Router# show running-config Displays the current configuration of all parameters the router is currently using.
Router# show interfaces Displays the status of all interfaces, including if the interface is up or down and if its line protocol is up or down. Lots of details.
Router# show ip interface brief

Displays just the IP address, and the status of each interface and its line protocol. (up or down)

Check that the IP address of each interface is correct, and that "Status" and "Protocol" are both "up" for each enabled interface.

Router# show ip route

Displays the routing table.

Check that indirect routes are listed. Check that the mask and network address are correct for each "directly connected" interface.

Router# show ip protocol

Shows the details of the enabled routing protocol service.

Check that the proper number of "Type C" networks are listed, and that they have the correct values.

Router# show controller Displays the controller state that is specific to controller hardware. Generally useful for diagnostic tasks.
Router# show controller serial 0/0 Use to determine if a serial interface is DCE or DTE.
e.g. DCE => DCE V.35, clock rate 9600
e.g. DTE => DTE V.35 TX and RX clocks detected
Router# show ip arp Displays the mapping of IP addresses to MAC addresses
Router# show ip rip database [ip-address {mask}]  
Router(config)# no ip domain-lookup

Stops the router from attempting to translate unfamiliar commands (typos) into IP addresses.
Prevent "Translating. domain server (255.255.255.255)" Messages after an Invalid Command is Entered on a Router

 

 


[ Top ] [ Home ]

 

Interface Configuration

Set the IP address and enable the interface

Prompt / Mode Command Description
Router> enable  
Router# configure terminal Enter Global Configuration mode
Router(config)# interface <interface type> <slot>/<interface #> Tell the device which interface to configure
Router(config-if)# description "<text of description>" e.g. description "Connection to 2621-B"
Router(config-if)# ip address <ip address> <subnet mask> Specify IP address and subnet mask for the interface
Router(config-if)# no shutdown Enable the interface
Router(config-if)# exit or ctrl-z or end Exit from interface config mode

 

References

 


[ Top ] [ Home ]

 

Configure the RIP Routing Process

Prompt / Mode Command Description
Router> enable  
Router# configure terminal Enter Global Configuration mode
Router(config)# router rip  
Router(config-router)# network <network address> e.g. network 192.168.1.0
Router(config-router)# version 2 Set to RIP v2. Default is v1. Note: RouteSim v6.0.0 has a bug in RIP v2 that adds invalid routes to the table.
Router(config-router)# exit or ctrl-z or end  

How to remove a network/router from RIP

 

 


[ Top ] [ Home ]

 

Configure the OSPF Routing Process

Prompt / Mode Command Description
Router> enable  
Router# configure terminal Enter Global Configuration mode
Router(config)# router ospf <process- id> Process-id: Internally used identification parameter for an OSPF routing process. It is locally assigned and can be any positive integer. A unique value is assigned for each OSPF routing process.
Router(config-router)# network <network address> <wildcard mask> area <area #> A 0 octet in the wildcard mask indicates that the corresponding octet in the network must match exactly. A 255 indicates that you don’t care what the corresponding octet is in the network number.
Router(config-router)# router-id <IP or ID# as 4 octets) e.g. router-id 1.1.1.1
Router(config-router)# exit  

 

References

 


[ Top ] [ Home ]

 

Configure DHCP Server

 

Prompt / Mode Command Purpose

Router(config)#

ip dhcp excluded-address <start IP> <end IP>

Exclude a range of IP addresses to be assigned as static IP's.

Router(config)#

ip dhcp pool <poolname>

Creates a name for the DHCP server address pool and places you in DHCP pool configuration mode (identified by the config-dhcp# prompt).

Router(dhcp-config)#

network <network address> <mask>

Specifies the subnet network number and mask of the DHCP address pool.

Router(dhcp-config)#

default-router <Default Gateway IP>

 

Router(dhcp-config)#

lease <Days> <Hours> <Minutes>

e.g. 7 days 1 hour 20 minutes: 7 1 20

Router(config-dhcp)# dns-server <address> [address2 ... address8] Specifies the IP address of a DNS server that is available to a DHCP client. One IP address is required; however, you can specify up to eight IP addresses in one command line.
Router(config-dhcp)# netbios-name-server <address> [address2 ... address8] Specifies the NetBIOS WINS server that is available to a Microsoft DHCP client. One address is required; however, you can specify up to eight addresses in one command line.

Router(dhcp-config)#

end

 

 

Display IP address lease bindings on the Cisco IOS DHCP Server

DHCP Configuration for IPv6

R1(config)#ipv6 dhcp pool PoolOne
R1(config-dhcpv6)#address prefix 2001:db8:1::/64
R1(config-dhcpv6)#dns-server 2001:db8:2::100
R1(config-dhcpv6)#domain-name SampleDomain.org
R1(config-dhcpv6)#exit
R1(config)#

Then configure the interface to join the multicast group and listen for DHCP requests

R1(config)#int f0/0
R1(config-if)#ipv6 dhcp server PoolOne
R1(config-if)#ipv6 nd managed-config-flag
              (For router advertisements set the M bit to 1)
              (nd = network discovery)
R1(config-if)#end

Check the DHCP configuration

R1#show ipv6 dhcp pool
DHCPv6 pool: PoolOne
  Address allocation prefix: 2001:DB8:1::/64 valid 172800 preferred 86488 (0 in use, 0 conflicts)
  DNS server: 2001:DB8:2::100
  Doman name: SampleDomain.org
  Active clients: 0

show client that received IP

R1#show ipv6 dhcp binding

Show Interface configuration

R1#show ipv6 int f0/0

R1#show ipv6 neighbors

 


[ Top ] [ Home ]

 

Switch: VLAN (Virtual Local Area Network)

Configuring a VLAN

Prompt / Mode Command Description
Switch# configure terminal Enter Global Configuration mode
Switch(config)# vlan <number> Create a VLAN
Switch(config-vlan)# name <name/description> Add a name or description to the VLAN.
Switch(config-vlan)# exit  
Switch(config)#

interface <type> <mod/port>

Enter the interface configuration mode.
e.g. interface fastethernet0/1

Switch(config-if)# switchport mode access Configure the port mode.
Switch(config-if)# switchport access <VLAN ID> Enter the VLAN membership mode for the port.
Switch(config-if)# end  
Switch# show vlan Verify the VLAN configuration.

 

Configuring a Trunk Port

Prompt / Mode Command Description
Switch(config)# interface fa0/24  
Switch(config-if)# switchport trunk encapsulation dot1q  
Switch(config-if)# switchport mode trunk  
Switch(config-if)# end  
Switch# show interface trunk verify your trunk port
Switch# show interface Fa0/15 switchport Verify the switchport configuration

 

Configuring an IP Address on a Switch

The Management VLAN interface, is a routed interface on every Cisco switch and is called interface VLAN 1.

Prompt / Mode Command Description
Switch(config)# interface vlan 1  
Switch(config-if)# ip address 192.168.10.19 255.255.255.240  
Switch(config-if)# no shutdown  

 

References

 


[ Top ] [ Home ]

 

Network Simulators & Emulators

 


[ Top ] [ Home ]

 

References

 


[ Top ] [ Home ]

 

All items Copyright ©1996 - 2017 Chin. All Rights reserved Reproduction without explicit permission is prohibited. See: Terms of use