page contents

About the Post

Author Information

IOS Command Reference

Router Basic Configuration

•    Router> enable (enter privileged mode)

•    Router# configure terminal

•    Router(config)# hostname R1

•    R1(config)# banner motd # message of the day #

•    Setting passwords:

•    R1(config)# enable secret password

•    R1(config)# line console 0

•    R1(config-line)# password password

•    R1(config-line)# login

•    R1(config)# line vty 0 4

•    R1(config-line)# password password

•    R1(config-line)# login

•    Gathering Router Info:

•    R1# show version

•    R1# show startup-config

•    R1# show running-config

•    R1# show ip route

•    R1# show ip interface brief

•    R1# show interfaces

•    Avoid IOS messages to interfere with user’s entry

•    R1(config)#line console 0

•    R1(config-line)#logging synchronous

•    R1(config)#line aux 0

•    R1(config-line)#logging synchronous

•    R1(config)#line vty 0 4

•    R1(config-line)#logging synchronous

•    Reset a Cisco Router to Factory Default Settings

•    R1> enable

•    R1# write erase

•    R1# reload

•    R1# disable (return to user mode from privileged, or just press CTRL + Z)

•    quit | exit (exit router)


Router Basic Security

•    User creation and privilege assignment:

•    R1(config)# username cisco secret 123

•    R1(config)# username cisco privilege 10

•    (By default, Cisco Devices are configured to use password only authentication and not usernames. This can be changed by instructing the the device to use local user database in console or line with “login local” or by using the “login” command when entering the router as default user)

•    Enable SSH (Need to have an IOS versión that supports it)

•    R1(config)# crypto key generate rsa general-keys modulus 1024

•    R1(config)# ip ssh version 2

•    R1(config)# ip ssh time-out 60

•    Basic Lan Security

•    Do not advertise yourself towards the user LAN as a router:

•    R1(config)#interface ethernet0

•    R1(config-if)#no cdp enable

•    Do not forward IP packets with source-routing header options enabled:

•    R1(config)#no ip source-route

•    Do not answer to ARP requests for hosts which are not on the user LAN:

•    R1(config)#interface ethernet0

•    R1(config-if)#no ip proxy-arp


Router Copy Operations

•    R1# copy running-config startup-config

(save current config. from DRAM to NVRAM)

•    R1# copy startup-config running-config

(merge NVRAM configuration to DRAM)

•    R1# copy runing-config tftp

(copy DRAM configuration to a TFTP server)

•    R1# copy tftp runing-config

(merge TFTP config. with current config. in DRAM)

•    R1# copy flash tftp

(backup the IOS onto a TFTP server)

•    R1# copy tftp flash

(upgrade the router IOS from a TFTP server)


Show Operations and Troubleshooting

•    arp

•    ping

•    tracert

•    show version

•    show startup-config

•    show running-config

•    show flash

•    show log

•    show interfaces [interface]

•    show ip interface brief

•    show ip route

•    show ip route summary

•    show ip route supernets-only

•    show route-map

•    show ip policy

•    show ip cache policyshow ip local policy

•    show ip rip database

•    show ip protocols

•    show controllers 0

•    show access-lists

•    show isdn status

•    show frame-relay pvc

•    show frame-relay lmi

•    show frame-relay map

•    debug ip routing

•    undebug ip routing

•    undebug all

•    show cdp neighbors

•    show cdp neighbors detail

•    no cdp run

•    no cdp enable


Router Interface Configuration

•    Configuring a Loopback Interface:

•    R1> enable

•    R1# configure terminal

•    R1(config)# interface loopback 1

•    R1(config-if)# ip address

•    Configuring an Ethernet Interface (example):

•    R1> enable

•    R1# configure terminal

•    R1(config)# interface fastethernet 0/0

•    R1(config-if)# ip address

•    R1(config-if)# no shutdown

•    R1(config-if)# shutdown (disable the interface)

•    Configuring Serial Links (example):

•    R1> enable

•    R1# show controllers serial 0/0/0

(DTE=male connector, DCE=female connector)

•    R1# configure terminal

•    R1(config-if)# interface serial 0/0/0

•    R1(config-if)# ip address

•    R1(config-if)# clock rate 64000 (only router with the DCE cable)

•    R1(config-if)# bandwidth 64 (logical bandwidth assignment of 64K)

•    R1(config-if)# no shutdown

•    R1(config-if)# shutdown (disable the interface)

•    Info about Interfaces on the Router:

•    R1# show interfaces [interface]

•    show interfaces

•    show interfaces ethernet 0/0

•    show interfaces fastethernet 0/0

•    show interfaces serial 0/0/0

•    show interfaces fddi

•    show interfaces hssi

•    show interfaces lex

•    show interfaces loopback

•    show interfaces port-channel

•    show interfaces pos

•    show interfaces tokenring

•    show interfaces tunnel

•    show interfaces vg-anylan


Static Routing

•    R1# show ip route (Displays the routing table)

•    R1# show ip interface brief (portion of the interface info)

•    R1# debug ip routing (Displays routing table processes for any route, whether that route is a directly connected network, a static route, or a dynamic | Remember to use “logging synchronous” to avoid loss of user input | to disable use “undebug ip routing” or “undebug all”).

•    R1# show cdp neighbors (info about directly connected Cisco neighbors).

•    R1# show cdp neighbors detail

•    R1(config)# no cdp run

•    R1(config)# no cdp enable

•    Setting up Static Routes:

•    ip route [network-address] [subnet-mask] {ip-address | exit-interface}

•    R1(config)# ip route172.16.3.1

•    R1(config)# ip route serial 0/0/0

•    Setting up Default Static Routes (Gateway of Last Resort):

•    ip route {exit interface | ip address}

•    R1(config)# ip route serial 0/0/0

•    R1(config)# ip route

•    ip default-network

•    ip default-gateway

•    ** Cisco has an article that explains the difference between the three.


DHCP Configuraiton

•    Exclude an address (gateway and DNS, for example)

R1(config)# ip dhcp excluded-address

•    Create a DHCP IP address pool for the IP addresses you want to use.

R1(config)# ip dhcp pool nameofpool

•    Specify the network and subnet for the addresses you want to use from the pool.

R1(dhcp-config)# network /8

•    Specify the default router (i.e., default gateway)


•    Specify the DNS domain name for the clients (optional)


•    Specify the primary and secondary DNS servers (optional)


•    Specify the lease duration for the addresses you’re using from the pool (optional)

R1(dhcp-config)#lease 7

•    Show command: View which DHCP IPaddresses currently have leases:

•    show ipdhcp bindings

(DHCP configuration can be very complex onCisco routers. You can configure backup servers, settings to prevent conflicts,secure DHCP, and many other options).


RIP Protocol

•    Enable RIP on all 172.16.x.y interfaces

•    R1(config)# router rip

•    R1(config-router)# version 2 (activates RIP ver. 2 instead of ver. 1)

•    R1(config-router)# network

•    Passive Interface , do not send updates

•    R1(config-router)# passive-interface FastEthernet 0/0

•    Do not summarize networks (RIPv2 only, does it by default)

•    R1(config-router)# no auto-summary

•    Propagate the default route, if there is one in the routing table

•    R1(config-router)# default-information originate

•    R1(config-router)# no default-information originate

•    Propagate static routes

•    R1(config-router)# redistribute static

•    View RIP Database

•    R1# show ip rip database

•    Disable RIP Protocol

•    R1(config)# no router rip


IGRP Protocol

•    To enable IRGP with a AS of 200, to all interfaces

•    R1(config)# router igrp 200

•    R1(config-router)# network

•    Disable IGRP

•    R1(config)# no router igrp 200


EIGRP Protocol

•    Enabling EIGRP Routing (sintaxis):

•    Router(config)# router eigrp as-number (Same N° on all routers)

•    Router(config-router)# network network-address [wildcard mask]

•    Disable:

•    Router(config)# no router eigrp as-number

•    Enabling EIGRP Routing (example):

•    R1(config)# router eigrp 240

•    R1(config-router)# network

•    Disable:

•    R1(config)# no router eigrp 240

•    EIGRP Interface commands

•    Router(config-if)# ip summary-address eigrp as-number network-address mask

•    Example:

R1(config-if)#ip summary-address eigrp 240

•    Router(config-if)# no auto-summary

(Auto-summary is ON by default. EIGRP summarizes automatically between classful boundaries. This must be used for VLSM to work)

•    Router(config-if)# bandwidth kilobits

(Configures the bandwidth used by routing metrics on the outgoing interface)

•    Router(config-if)# ip bandwidth-percent eigrp as-number bandwidth-percentage

(Change bandwidth used by EIGRP to exchange routing information. By default, EIGRP will use up to 50% of the bandwidth of an interface for this purpose)

•    Router(config-router)# eigrp log-neighbor-changes

(This command enables the logging of neighbor adjacency changes to monitor the stability of the routing system and to help detect problems)

•    Router(config-router)# variance number

(The variance command instructs the router to include routes with a metric less than or equal to n times the minimum metric route for that destination, where n is the number specified by the variance command)

•    Router(config-router)# default-metric 56 100 255 10 1500 {k values)

•    Show commands

•    R1# show ip eigrp neighbors

(displays neighbors)

•    R1# sshow ip eigrp interfaces

•    R1# show ip eigrp topology

•    R1# show ip eigrp topology all links

(displays topology, active/passive -well- state, successors)

R1# debug eigrp fsm

•    R1# debug eigrp packet

•    R1# show ip route eigrp

(EIGRP routes in routing table)

•    R1# show ip protocols

(AS number, filtering, redistribution, neighbors, distance)

Router# show ip eigrp traffic EIGRP

(packets sent and received)


OSPF Protocol

•    Enable OSPF

•    Router(config)# router ospf process-id [vrf vpn-name]

(process-id is any positive integer, unique for each OSPF routing process)


•    R1(config)# router ospf 1

•    Defining OSPF Networks

•    Router(config-router)# network address wildcard-mask area area-number

(note the “wildcard-mask” use and not the subnet mask)

•    Configuring all interfaces to participate in OSPF area 0:

•    R1(config-router)# network area 0

•    Force only interfaces addressed from to participate in OSPF:

•    R1(config-router)#network area 0

•    Specifically force an interface to participate in OSPF area 0:

•    R1(config-router)#network area 0

•    Manually configure the RID

•    R1(config)# router ospf process-number

•    R1(config-router)# router-id ip-address

•    Activate the RID on a router that is already running OSPF

•    R1(config)# clear ip ospf process

•    Configure a loopback interface. If no manual RID is specified, then the RID is taken from the highest IP address assigned to a loopback interface.

•    R1(config)# interface loopback 1

•    R1(config-if)# ip address

(If no loopback interface is defined and there’s no configured RID, then the highest IP address of an active interface is chosen as the RID)

•    Configuring the Cost of an Interface

•    R1(config-if)# ip ospf cost cost

•    Configuring the priority value of an interface

•    R1(config)# interface interface-number

•    R1(config-if)# ip ospf priority priority-value

•    Show commands

•    R1# show ip ospf neighbors

•    R1# show ip ospf interface

•    R1# show ip ospf topology

•    R1# show ip ospf database

•    R1# show ip ospf border-routers

•    R1# show ip protocols

•    R1# debug ip ospf events

•    Disable OSPF:

•    Router(config)# no router ospf process-id [vrf vpn-name]


•    R1(config)# no router ospf 1

Tags: , ,

Comments are closed.

Copy Protected by Chetan's WP-Copyprotect.