Cisco Router Basic Commands
Show vlan
switch # show vlan brief
IT 3600 – Networks and Internetworking
Use Putty to connect to the console
Change to the privileged EXEC mode command interpreter:
> enable
See the version of the router, at the bottom shows the configuration register 0x2102 (startup config)
# show version
Erase any startup configuration that exists and reload the router:
> enable
# erase startup-config
# reload
Show router config
# show running-config
Show router config, just the section on line
# do sh run | s line
Security
Change the enable secret password
# config t
(config)# enable secret cisco (change the password to cisco)
(config)# CNTRL-Z
# copy run start
Set password
#enable password mypassword
#service password-encryption (hide passwords)
Set password
#enable password mypassword
Remove passwords from routers
# config t
(config)# no enable secret (encrypted)
(config)# no enable password (easy to break)
(config)# CNTRL-Z
Recover password from router steps to reset a router if the password is lost as follows:
Power cycle
As it is booting Type CNTL-D or if not using a KVM hit Send Break (break/Pause)
rommon 1> confreg 0x2142
rommon 2> reset (Reboot the router)
Continue with configuration dialog? [yes/no]: no
Router>en
Router#copy start run (if you want to save the config)
OR
Router#erase startup-config (if you want to reset the router)
Router#reload (Now at factory default)
Now set new password
(config)#enable secret cisco
(config)#config-register 0x2102
(config)# CNTRL-Z
# copy run start
# wr /* short for write memory */
Set the hostname of the router to your first name:
>enable
#config t
(config)# hostname Jeff
(config)# CNTRL-Z
Create user name and set password
>enable
#config t
(config)#username cisco password cisco
(config)#do sh run | s line (show the line section of the config)
(config)#line vty 0 4
(config-line)#no password cisco
(config-line)#login local (look at the local user database)
(config-line)#
Create password for console
>enable
#config t
(config)#line con 0
(config)#password cisco
(config)#login
(config)#exit
Use ssh, step one configure a domain name
>enable
#config t
(config)#ip domain-name mydomain.com
(config)#crypto key generate rsa general modulus 1024 (only generate after domain set)
(config)#ip ssh version 2 (enable version 2 of ssh)
(config)#transport input telnet ssh
(config)#
Interfaces
Configure the serial0/0/0 interface with an IP address and a clock rate of 64000:
>enable
#config t
(config)# interface serial 0/0/0
(config-if)# ip address 192.168.0.2 255.255.255.0
(config-if)# clock rate 64000
(config-if)# no shutdown (bring interface up)
(config)# CNTRL-Z
Ping between the routers
# ping 192.168.0.1 repeat 3
Save your configuration
# copy running-config startup-config
or
# wr /* short for write memory */
Turn off your router and then turn it back on to verify that you correctly saved the configuration
Power cycle
> enable
# sh ip int brie /* show interfaces brief */
Or
# show running-config
Specifies which Network interface to originate the ping from cmd
C:\users\myuser> ping /S address
Routing
Turn on Routing with OSPF
# config t
(config)# router ospf 2
(config)# network 192.168.3.0 0.0.0.255 area 0
(config)# network 192.168.4.0 0.0.0.255 area 0
(config)# CNTRL-Z
Then turned off OSPF routing
# config t
(config)# no router ospf 2
(config)# CNTRL-Z
Turn on Routing with RIP
#config t
(config)# router rip
(config)# network 192.168.3.0
(config)# network 192.168.4.0
(config)# CNTL-Z
Turned off RIP
# config t
(config)# no router rip
(config)# CNTRL-Z
Turn on EIGRP routing
#config t
(config)# router EIGRP 2
(config)# network 192.168.3.0 255.255.255.0
(config)# network 192.168.4.0 255.255.255.0
(config)# CNTRL-Z
Disable EIGRP routing
# config t
(config)# no router EIGRP 2
(config)# CNTRL-Z
Remote SSH and Telnet
Allow remote telnet
#config t
(config)# line vty 0 4
(config-line)# password cisco
(config-line)#login
(configline)#end
#wr
From one router telnet to another
telnet 192.168.1.1
Setup vlan on Cisco switch
switch#config t
switch(config)# vlan 10
switch(config-vlan)# name RED
switch(config-vlan)# exit
or
switch#vlan data (configure vlan through the database)
switch(vlan)# vlan 20 name BLUE
switch(vlan)# exit
or
switch#conf t (configure vlan through the interface)
switch(config)# int fa0/1
switch(config-if)# switchport access vlan 30
switch(config-if)# exit
To assign a range or ports to a vlan
switch#conf t (configure vlan through the interface)
switch(config)# int range fa0/4 - 10
switch(config-if-range)# switchport access vlan 20
switch # CNTL-Z
Show vlan
switch # show vlan brief
Assign IP address to vlan
switch#config t
switch(config)# vlan 10
switch(config-vlan)# ip address 192.168.30.10 255.255.255.0
switch(config-vlan)# no shutdown
switch(config-vlan)# exit
Turn off console logging
(config)# no logging on
Disable DNS lookup
switch # no ip domain-lookup
See Also
- Fundamentals of Cisco APIC-EM
- APIC-EM can be downloaded at no charge. No license is required.
- Install on a virtual machine. Get the instructions.
- POINT AND CLICK – APIC-EM
- Download Packet Tracer network simulation and visualization tool, to practice configuration
- Register for Cisco Networking Academy and take Packet Tracer 101 course