Cisco Commands

Show Commands

# show arp	// Shows MAC address's
# show version	// Shows IOS
# show mac-address-table
# show int fa0/1	// Shows stats for that port
# show run int fa0/1 	// Shows config for that port
# sh run | begin line vty	// Shows transport input ssh telnet
# show access-lists	// Show access lists
# sh run | inc [word]	// Pipe the running config
# sh run | begin [word]	// As above
# sh cdp neighbours	// Shows conected equipment
# show policy-map	// Shows bandwidth allocation
# interface gi0/0# ip accounting ip-packets	// Sets captur for IP address on traffic
# show ip account	// show traffic IP for above

File Management

# dir (or dir flash:)	// Shows files on internal flash
# dir usbflash0: (dir usb0:)	// Shows USB files
# cd flash:	// Navigate to Internal flash
# cd usbflash0:/CISCO/IOS	// Navigating is case sensitive
# show flash:	// Shows Internal flash memory used
# show version	// Displays anmount of memory
# mkdir	// Creat a Directory
# copy <filename> flash:	// Copy file fronm USB to Internal flash

boot system flash:c1841-advsecurityk9-mz.124-15.T11.bin  -  Sets boot IOS


format flash:	// Deletes all files
delete flash:	// Deletes all files
delete [filename]
delete /recursive /force [folder] [filename]	// Force deletes all files
rename [filename] [filename]


(config)# no service config	// Suppress TFTP error messages

VTY Lines

password cisco	??
enable secret cisco	// Sets enabled password
line console 0	// Sets local console cable access
secret cisco	// Can use 'password' for plain text
line vty 0 4	// Sets telnet access
secret cisco	// Can use 'password' for plain text


username [username] priviledge 15 secret cisco	// Sets user and pword for SSH
hostname myrouter	// Sets hostname for RSA Keys
ip domain-name	// Sets domain name for RSA Keys
crypto key generate rsa general-keys modulus 1024	// Creates RSA Keys
ip ssh version 2	// Turns on SSH
transport input ssh telnet	// Sets access for both (can omit one)
login local	// Tells SSH to use local username authentication

show ip ssh	// Shows status of SSH
who	// Shows who's logged in


nterface FastEthernet0/1.100	// Sets sub interface
encapsulation dot1q 100	// Sets interface for VLAN
no int fa0/1.100	// and reload to remove interface
ip address a.b.c.d a.b.c.d (dhcp)	// Sets IP address or DHCP
duplex auto / full / half	// Sets duplex
speed auto / 10 / 100	// Sets speed

show ip interface brief	// Shows IP address information
show interface fa0/1	// Shows port stats
show run interface fa0/1	// Shows config for that port


ip dhcp pool pool1	// Creates pool1
network	// Auto selects fa0/0 with IP range
default-router	// Sets default route
dns-server	// Sets DNS server
domain-name mcarr	// Sets domain name

ip dhcp pool pool2	// Sets second pool
domain-name mcarr
!no ip dhcp pool pool2	// Removes pool

ip dhcp pool RESERVED-HOST	// set up DHCP reservation
client-identifier 0100.1e8c.bb3e.18

show ip dhcp binding	// Shows leased address's
show ip dhcp pool	// Shows the DHCP pools
show arp	// Shows learned MAC address's


ip nat inside source list 1 interface fastEthernet 0/0 overload  -  The NAT command
int fa0/0 > ip nat outside	// Sets the outside inteface
int fa0/1.1 > ip nat inside	// Sets the inside interface
int fa0/1.20 > ip nat inside	// As above

Access Lists

access-list 1 permit	// Sets the access list for NAT
access-list 1 permit	// As above

ip nat inside source static tcp 5900 interface fa0/0 5900 ↵
// Sets static NAT for incoming connection on port 5900

show ip nat translations
show access-lists  

HTTP Server

ip http server	// Allows SDM access
ip http secure-server	// as above but secure
ip authentication local


ip route fa0/0	// Sets static route
ip routing	// Turns on routing
router rip	// Enables rip routing
version 2	// Sets rip routing to version 2
network a.b.c.d	// Advertises routes for rip
router eigrp 100
no router eigrp 100

show ip route
show ip protocols


vlan 10 name SALES	// Creates VLAN
switchport mode trunk (access)	// Sets switchport mode
switchport trunk allowed vlan 1,2,3	// Adds VLANS to switchport
switchport access vlan 2	// Creates vlan on the fly
ip default-gateway	// Sets global gateway address of switch
sh int fa0/2 switchport	// Shows switchport stats
sh int trunk	// Shows trunk ports
sh int status	// Shows switch overview

show vlan-switch	// overview of switch


//////////// SERVER ////////////////

username CPE password 0 MyPassword
bba-group pppoe MyGroup
virtual-template 1
sessions per-mac limit 2
interface FastEthernet0/0
no ip address
duplex auto
speed auto
pppoe enable group MyGroup
interface Virtual-Template1
ip address
peer default ip address pool MyPool
ppp authentication chap callin
ip local pool MyPool
///////////// CLIENT ///////////////
interface FastEthernet0/0
no ip address
duplex auto
speed auto
pppoe enable
pppoe-client dial-pool-number 1
interface Dialer1
mtu 1492
ip address negotiated
encapsulation ppp
dialer pool 1
ppp chap password 0 MyPassword
/////////////// debug ///////////////
# debug ppp authentication
# debug ppp negotiation

# debug pppoe events
# debug pppoe errors
# debug pppoe packet
# u all    // undebug all
# clear pppoe all
# clear int dialer 1

# show pppoe session
# show controllers vdsl 0/2/0

# controller vdsl 0


ping a.b.c.d repeat 100	// Ping with repeat
show arp vrf VRF_CE_MGMT_VPN	// For VRF's
trace a.b.c.d	// Like tracert

show file system	// Shows file system
show log
sh dsl int atm0	// ADSL

Rommon Recovery

Rommon Recovery (Router & Switch)

1.  hold down 'alt' & 'b' and power up to get rommon > prompt
2.  OR! Boot the router with no flash card to get rommon > prompt
3.  Then enter 'confreg 0x2142' at the rommon > prompt
4.  Insert new flash card (with IOS on it)
5.  And type 'reset' then hit return (this will reboot router)
6.  When re-booted (enter initial config = No) type 'en' to get # prompt
7.  Then wipe the config with 'wr erase'
8.  Then enter config mode with 'conf t'
9.  Once in config mode type 'config-register 0x2102' to set register back
10. Then hit 'Ctrl + C' to get back to root menu and type 'reload'
11. When prompted to save config type 'No'
12. Router will reboot again - happy days!

Once re-booted you should have full access to the router, to check the config register is set back and that you have the right IOS type 'show version'.      

Reset Cisco Switch Password

1. Power on the switch while holding down the 'mode button' on the front
2. At switch: prompt type 'flash_init'
3. ...then type 'load_helper'
4. ...then type 'dir flash:'
5. rename start up file, type 'rename flash: config.text flash: config.old'
6. then type 'boot'

Firmware Upgrade

Boot Start Marker - Base Configs - Directorys and Flash

Boot Start Marker

boot system flash:c1900-universalk9-mz.SPA.152-4.M5.bin

Base Config

conf t
logging buffered 4096
enable password cisco
no ip domain lookup
interface GigabitEthernet 0/1
description **** WAN Link ****
ip address a.b.c.d
speed 100
duplex full
no shut
no ip http server
no ip http secure-server
no cdp run
line con 0
password cisco
no modem enable
line aux 0
line vty 0 4
password cisco
transport input all
wr mem

ME3400 Base Config

conf t
username cisco privilege 15 password cisco
line vty 0 4
login local
transport input all
interface gig 0/1
port-type nni
no switchport
description **** WAN **** link
ip address a.b.c.d
bandwidth 1000000
no shut
wr mem

Directory & Flash Copy

dir usbfalsh0: or usb0:	// display USB directory
dir	// displays files in flash memory
cd usbflash0:	// cd CISCO/file (is case sensitive to navigate USB key)
format flash:	// wipes flash!
copy flash run	// copys running-config to flash.
copy tftp flash	// copys IOS from TFTP server.
delete flash [filename]	// deletes specific file
delete flash:	// deletes all files

To Remove Factory Config

  1. To login to the router for the first time use the username cisco and the password cisco.
  2. We then need to remove the 'factory config' which is stored in the NVRAM of the router
  3. To erase the NVRAM, type wr erase and press the return key
  4. The router will then display the message 'Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]'. Press the return key to confirm. Once erased the router will display the message 'Erase of nvram: complete'
  5. To totally remove the factory config we need to reboot the router. To do this type reload and press the return key.
  6. The router will then display the message 'System configuration has been modified. Save? [yes/no]' to avoid having to do a password recovery, this is where we need to make sure that we type "n" and press the return key.
  7. The router will then display the message 'proceed with reload? [confirm]'. Confirm by pressing the return key
  8. The router will then reload without a startup config (Providing the above steps were followed correctly. If you find that after the reload the router asks you for a username and a password, you have locked yourself out of the router and will need to perform a password recovery – Cisco Rommon Password Reset)

Cisco Update Firmware

  1. Once you have deleted the Factory Config - log onto the router
    (at prompt 'would you like to enter initial conf mode' say no)
    'Router>' then type en to enter enable mode 'Router#'.
  2. Plug in USB key with IOS on it (Kinston USB worked Sandisk didn't!)
  3. View files on USB with dir usbflash0: or dir usb0: files on usb are case sensitive!
  4. Then copy correct IOS to the routers flash memory with...
    copy usbflash0:[filename.bin] flash:[filename.bin]
  5. You can rename old IOS file so router boots from new IOS file...
    rename flash0:[filename.bin] [filename.bak]
  6. Reboot the router with reload and check new IOS with show version