Cisco IOS Reference

Contents

__

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 OperationPrompt / ModeHow to Enter the ModeUsage
User EXEC (aka unprivileged mode)Router>First level accessedChange terminal settings on a temporary basis, perform basic tests, and list system information
Privileged EXECRouter#From user EXEC mode, enter enableSystem administration, set operating parameters
Global ConfigurationRouter(config)#From privileged EXEC, enter configure terminalModify configurations that affect the system as a whole
Interface ConfigurationRouter(config-if)#From global config mode, enter:
interface <interface type> <slot>/<interface #>
Modify the operation of an interface.
Mode of OperationPrompt / ModeHow to Enter the ModeUsage
User EXEC (aka unprivileged mode)Router>First level accessedChange terminal settings on a temporary basis, perform basic tests, and list system information
Privileged EXECRouter#From user EXEC mode, enter enableSystem administration, set operating parameters
Global ConfigurationRouter(config)#From privileged EXEC, enter configure terminalModify configurations that affect the system as a whole
Interface ConfigurationRouter(config-if)#From global config mode, enter:
interface {interface type} {slot}/{interface #}
Modify the operation of an interface.

__

Status, Settings, and Diagnostic Commands

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

Prompt / ModeCommandDescription
Router#show running-configDisplays the current configuration of all parameters the router is currently using.
e.g. show run | section interface
Router#show interfacesDisplays 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 briefDisplays 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 routeDisplays 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 controllerDisplays the controller state that is specific to controller hardware. Generally useful for diagnostic tasks.
Router#show controller serial 0/0Use 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 arpDisplays the mapping of IP addresses to MAC addresses
Router#show ip rip database [ip-address {mask}] 
Router(config)#no ip domain-lookupPrevent “Translating. domain server (255.255.255.255)” messages after an invalid command is entered on Cisco IOS.

__

Interface Configuration

Set the IP address and enable the interface

Prompt / ModeCommandDescription
Router>enable 
Router#configure terminalEnter 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 shutdownEnable the interface
Router(config-if)#exit or ctrl-z or endExit from interface config mode

References

__

Configure the RIP Routing Process

Prompt / ModeCommandDescription
Router>enable 
Router#configure terminalEnter Global Configuration mode
Router(config)#router rip 
Router(config-router)#network <network address>e.g. network 192.168.1.0
Router(config-router)#version 2Set to RIP v2. Default is v1. Note: RouterSim 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 or RIP from a router

  • no network <network address>
    • Note: In RouterSim v5 through v8.x you cannot remove a specific network address. You’ll have to remove the routing process, and then add all the network addresses again.
  • no router rip removes the RIP routing process thus clearing all the defined networks.

__

Configure the OSPF Routing Process

Prompt / ModeCommandDescription
Router>enable 
Router#configure terminalEnter 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 maskarea<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

__

Configure DHCP Server

Prompt / ModeCommandPurpose
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

  • show ip dhcp binding

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

__

Switch: VLAN (Virtual Local Area Network)

Configuring a VLAN

Prompt / ModeCommandDescription
Switch#configure terminalEnter 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 accessConfigure the port mode.
Switch(config-if)#switchport access <VLAN ID>Enter the VLAN membership mode for the port.
Switch(config-if)#end 
Switch#show vlanVerify the VLAN configuration.

Configuring a Trunk Port

Prompt / ModeCommandDescription
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 trunkverify your trunk port
Switch#show interface Fa0/15 switchportVerify 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 / ModeCommandDescription
Switch(config)#interface vlan 1 
Switch(config-if)#ip address 192.168.10.19 255.255.255.240 
Switch(config-if)#no shutdown 

__

Switch Diagnostics & Information

Prompt / ModeCommandDescription
Switch#show interface vlan 1 
Switch#show mac address-table 
Switch#show ip int brief 
Switch#show port-security 
Switch#show port-security int f0/3 
Switch#show running-config 
Switch#show spanning-tree detail 

__

References

__

Cisco IOS Tips

Router(config)# no ip domain-lookup

Pipe: Output Modifier

Router# show run | ?

append Append redirected output to URL (URLs supporting append operation only) 
begin Begin with the line that matches
exclude Exclude lines that match
include Include lines that match
redirect Redirect output to URL
section Filter a section of output
tee Copy output to URL

Router# show run | begin interface

     interface FastEthernet0/0
     description Sales VLAN 
     ip address 10.10.10.1 255.255.255.248
     duplex auto speed auto  
     !

Router# show ip route | include 192.168.3.32

Leave a Comment