Cisco Shortcut Guide: Difference between revisions

From ITCwiki
Jump to navigation Jump to search
No edit summary
 
(76 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Basic Tips ==
== Basic Tips ==


 
{|border="1" cellpadding="5" cellspacing="0" align="left"
* Use the '''up''' arrow to bring up your last entered commands and the '''down''' arrow to go back.  
|
 
* Use the '''up''' arrow to bring up your last entered commands and the '''down''' arrow to go back. <br>
 
* Type '''?''' to see the list of possible commands and your current prompt<br>
* Type '''?''' to see the list of possible commands and your current prompt
* Use the '''home''' key on your keyboard to bring your cursor to the beginning of the command you're typing. You can use the '''end''' key to go back to the end.<br>
 
|}<br><br><br><br>
 
* Use the '''home''' key on your keyboard to bring your cursor to the beginning of the command you're typing. You can use the '''end''' key to go back to the end.




{|border="1" cellpadding="5" cellspacing="0" align="left"
|
Do you want to get out of a long list without having to scroll through everything? (For example ''show run'')
Do you want to get out of a long list without having to scroll through everything? (For example ''show run'')
*Instead of hitting the space bar repeatedly just type the letter '''q'''
*Instead of hitting the space bar repeatedly just type the letter '''q'''


Are you in a config mode and wish to issue a show command?
Are you in a config mode and wish to issue a show command?
*Just put the word '''do''' in front of your command
*Just put the word '''do''' in front of your command
**Router(config)#do show run
**Router(config)#'''do show run'''
 
 
*Do the following to keep those pesky log messages from disrupting your typing:
**Router(config)#'''line con 0'''
**Router(config-line)#'''logg syn'''


Do the following to keep those pesky log messages from disrupting your typing:
*Router(config)#'''line con 0'''
*Router(config-line)#'''logg syn'''
|}<br><br><br><br><br><br><br><br><br><br><br><br>


{|border="1" cellpadding="5" cellspacing="0" align="left"
|
*Hit the '''tab''' key to automatically complete a command you are typing.
*Hit the '''tab''' key to automatically complete a command you are typing.


*To quickly cancel a ping use '''Ctrl-Shift-6'''
*To quickly cancel a ping use '''Ctrl-Shift-6'''


|}<br><br><br><br>




 
'''The following examples will have full versions of common commands next to the shortest versions(These will not necessarily work on all versions of routers or switches).'''
'''The following examples will have the full versions of the commands next to the shortest versions.'''


== Clear the Configurations ==
== Clear the Configurations ==
Line 47: Line 46:
|Switch>'''en'''
|Switch>'''en'''


Switch#'''er s'''
Switch#'''e s'''


Switch#'''del vlan.dat'''
Switch#'''del vlan.dat'''


Switch#'''rel'''
Switch#'''rel'''
|}
<br><br>
== Basic Configurations ==
{|border="1" cellpadding="5" cellspacing="0" align="left"
|Router#'''configuration terminal'''
Router(config)#'''enable secret cisco'''
Router(config)#'''banner motd #Authorized access only!#'''
Router(config)#'''line console 0'''
Router(config-line)#'''password class'''
Router(config-line)#'''login'''
Router(config-line)#'''no ip domain-lookup'''
Router(config)#'''hostname R1'''
R1(config)#'''copy running-config startup-config'''
|Router#'''conf t'''
Router(config)#'''ena s cisco'''
Router(config)#'''ban m #Authorized access only!#'''
Router(config)#'''lin c 0'''
Router(config-line)#'''pas class'''
Router(config-line)#'''logi'''
Router(config-line)#'''no ip domain-lo'''
Router(config)#'''ho R1'''
R1(config)#'''cop ru st'''
|}
<br><br><br><br><br><br><br><br><br><br><br><br><br><br>
== Assign Addresses ==
{|border="1" cellpadding="5" cellspacing="0" align="left"
|Router#'''configuration terminal'''
Router(config)#'''interface fastethernet 0/0'''
Router(config-if)#'''ip address 192.168.1.1 255.255.255.0'''
Router(config-if)#'''description Crossover cable to R2'''
Router(config-if)#'''no shutdown'''
Router(config-if)#'''interface serial 0/0/0'''
Router(config-if)#'''ip address 192.168.2.1 255.255.255.0'''
Router(config-if)#'''clock rate 64000'''
Router(config-if)#'''end'''
Router#'''show ip interfaces brief'''
|Router#'''conf t'''
Router(config)#'''in f0/0'''
Router(config-if)#'''ip add 192.168.1.1 255.255.255.0'''
Router(config-if)#'''des Crossover cable to R2'''
Router(config-if)#'''no sh'''
Router(config-if)#'''in s0/0/0'''
Router(config-if)#'''ip add 192.168.2.1 255.255.255.0'''
Router(config-if)#'''clo r 64000'''
Router(config-if)#'''end'''
Router#'''sh ip int bri'''
|}
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
== RIP ==
{|border="1" cellpadding="5" cellspacing="0" align="left"
|Router(config)#'''router rip'''
Router(config-router)#'''version 2'''
Router(config-router)#'''network 192.168.0.0'''
Router(config-router)#'''end'''
Router#'''show ip route'''
Router#'''show ip protocols'''
|Router(config)#'''router r'''
Router(config-router)#'''ve 2'''
Router(config-router)#'''net 192.168.0.0'''
Router(config-router)#'''end'''
Router#'''sh ip ro'''
Router#'''sh ip proto'''
|}
<br><br><br><br><br><br><br><br>
== EIGRP ==
{|border="1" cellpadding="5" cellspacing="0" align="left"
|Router(config)#'''router eigrp 1'''
Router(config-router)#'''network 192.168.0.0'''
Router(config-router)#'''no auto-summary'''
Router(config-router)#'''redistribute static'''
Router(config-router)#'''exit'''
Router(config)#'''ip route 0.0.0.0 0.0.0.0 s0/0/0'''
|Router(config)#'''router e 1'''
Router(config-router)#'''net 192.168.0.0'''
Router(config-router)#'''no au'''
Router(config-router)#'''r s'''
Router(config-router)#'''exit'''
Router(config)#'''ip route 0.0.0.0 0.0.0.0 s0/0/0'''
|}
<br><br><br><br><br><br><br>
== Switchport Security ==
{|border="1" cellpadding="5" cellspacing="0" align="left"
|Swtich(config)#'''interface fastethernet 0/6'''
Swtich(config-if)#'''switchport mode access'''
Swtich(config-if)#'''switchport access vlan 10'''
Swtich(config-if)#'''switchport port-security'''
Swtich(config-if)#'''switchport port-security maximum 5'''
Swtich(config-if)#'''switchport port-security mac-address 1111.2222.3333'''
Swtich(config-if)#'''switchport port-security violation shutdown'''
Swtich(config-if)#'''do show port-security'''
|Swtich(config)#'''in f0/6'''
Swtich(config-if)#'''sw m a'''
Swtich(config-if)#'''sw a v 10'''
Swtich(config-if)#'''sw po'''
Swtich(config-if)#'''sw po ma 5'''
Swtich(config-if)#'''sw po mac 1111.2222.3333'''
Swtich(config-if)#'''sw po v s'''
Swtich(config-if)#'''do sh por'''
|}
<br><br><br><br><br><br><br><br><br><br><br><br>
== VTP ==
{|border="1" cellpadding="5" cellspacing="0" align="left"
|Switch(config)#'''vtp version 2'''
Switch(config)#'''vtp mode client'''
Switch(config)#'''vtp domain CISCO'''
Switch(config)#'''vtp password cisco'''
Switch(config)#'''vtp pruning'''
Switch(config)#'''do show vtp status'''
|Switch(config)#'''vt v 2'''
Switch(config)#'''vt m c'''
Switch(config)#'''vt d CISCO'''
Switch(config)#'''vt pa cisco'''
Switch(config)#'''vt pr'''
Switch(config)#'''do sh vt st'''
|}
<br><br><br><br><br><br><br><br>
== NAT/PAT ==
{|border="1" cellpadding="5" cellspacing="0" align="left"
|Router(config)#'''ip nat pool POOL 192.168.100.1 192.168.100.50 netmask 255.255.255.0'''
Router(config)#'''access-list 1 permit 172.168.0.0 0.0.0.255'''
Router(config)#'''ip nat inside source list 1 pool POOL overload'''
Router(config)#'''interface fastethernet 0/0'''
Router(config-if)#'''ip nat inside'''
Router(config-if)#'''interface fastethernet 0/0'''
Router(config-if)#'''ip nat outside'''
|Router(config)#'''ip nat poo POOL 192.168.100.1 192.168.100.50 n 255.255.255.0'''
Router(config)#'''ac 1 p 172.168.0.0 0.0.0.255'''
Router(config)#'''ip nat i s l 1 p POOL o'''
Router(config)#'''in f0/0'''
Router(config-if)#'''ip na i'''
Router(config-if)#'''in f0/0'''
Router(config-if)#'''ip nat o'''
|}
<br><br><br><br><br><br><br><br><br><br><br><br>
== DHCP ==
{|border="1" cellpadding="5" cellspacing="0" align="left"
|R1(config)#'''ip dhcp excluded-address 10.0.0.1 10.0.0.5'''
R1(config)#'''ip dhcp pool POOL'''
R1(dhcp-config)#'''network 10.0.0.0 255.255.255.0'''
R1(dhcp-config)#'''default-router 10.0.0.1'''
R2(config)#'''interface fastethernet 0/5'''
R2(config-if)#'''ip helper-address 10.10.10.5'''
|R1(config)#'''ip dh e 10.0.0.1 10.0.0.5'''
R1(config)#'''ip dh po POOL'''
R1(dhcp-config)#'''netw 10.0.0.0 255.255.255.0'''
R1(dhcp-config)#'''de 10.0.0.1'''
R2(config)#'''in f0/5'''
R2(config-if)#'''ip help 10.10.10.5'''
|}
<br><br><br><br><br><br><br><br><br>
== Trunk Links/Etherchannel ==
{|border="1" cellpadding="5" cellspacing="0" align="left"
|Switch(config)#'''interface range fastethernet 0/7 - 0/12'''
Switch(config-if)#'''switchport trunk encapsulation dot1q'''
Switch(config-if)#'''switchport mode trunk'''
Switch(config-if)#'''channel-group 1 mode desirable'''
|Switch(config)#'''in r f0/7-0/12'''
Switch(config-if)#'''sw t e d'''
Switch(config-if)#'''sw m t'''
Switch(config-if)#'''channel-g 1 m d'''
|}
<br><br><br><br><br><br>
== HSRP ==
{|border="1" cellpadding="5" cellspacing="0" align="left"
|Switch(config)#'''interface vlan 10'''
Switch(config-if)#'''standby 1 ip 192.168.0.1'''
Switch(config-if)#'''standby 1 priority 100'''
Switch(config-if)#'''standby 1 preempt'''
|Switch(config)#'''int vl 10'''
Switch(config-if)#'''st 1 ip 192.168.0.1'''
Switch(config-if)#'''st 1 pri 100'''
Switch(config-if)#'''st 1 pre'''
|}
<br><br><br><br><br><br>
== Spanning-Tree ==
{|border="1" cellpadding="5" cellspacing="0" align="left"
|Switch(config)#'''spanning-tree mode rapid-pvst'''
Switch(config)#'''spanning-tree portfast default'''
Switch(config)#'''spanning-tree vlan 1 root primary'''
Switch(config)#'''do show spanning-tree'''
|Switch(config)#'''sp mo r'''
Switch(config)#'''sp po d'''
Switch(config)#'''sp v 1 r p'''
Switch(config)#'''do sh sp'''
|}
|}

Latest revision as of 19:35, 25 April 2012

Basic Tips

  • Use the up arrow to bring up your last entered commands and the down arrow to go back.
  • Type ? to see the list of possible commands and your current prompt
  • Use the home key on your keyboard to bring your cursor to the beginning of the command you're typing. You can use the end key to go back to the end.






Do you want to get out of a long list without having to scroll through everything? (For example show run)

  • Instead of hitting the space bar repeatedly just type the letter q

Are you in a config mode and wish to issue a show command?

  • Just put the word do in front of your command
    • Router(config)#do show run

Do the following to keep those pesky log messages from disrupting your typing:

  • Router(config)#line con 0
  • Router(config-line)#logg syn













  • Hit the tab key to automatically complete a command you are typing.
  • To quickly cancel a ping use Ctrl-Shift-6






The following examples will have full versions of common commands next to the shortest versions(These will not necessarily work on all versions of routers or switches).

Clear the Configurations

Switch>enable

Switch#erase startup-config

Switch#delete flash:vlan.dat (This step only needed for switches that have vlans added)

Switch#reload

Switch>en

Switch#e s

Switch#del vlan.dat

Switch#rel






Basic Configurations

Router#configuration terminal

Router(config)#enable secret cisco

Router(config)#banner motd #Authorized access only!#

Router(config)#line console 0

Router(config-line)#password class

Router(config-line)#login

Router(config-line)#no ip domain-lookup

Router(config)#hostname R1

R1(config)#copy running-config startup-config

Router#conf t

Router(config)#ena s cisco

Router(config)#ban m #Authorized access only!#

Router(config)#lin c 0

Router(config-line)#pas class

Router(config-line)#logi

Router(config-line)#no ip domain-lo

Router(config)#ho R1

R1(config)#cop ru st















Assign Addresses

Router#configuration terminal

Router(config)#interface fastethernet 0/0

Router(config-if)#ip address 192.168.1.1 255.255.255.0

Router(config-if)#description Crossover cable to R2

Router(config-if)#no shutdown

Router(config-if)#interface serial 0/0/0

Router(config-if)#ip address 192.168.2.1 255.255.255.0

Router(config-if)#clock rate 64000

Router(config-if)#end

Router#show ip interfaces brief

Router#conf t

Router(config)#in f0/0

Router(config-if)#ip add 192.168.1.1 255.255.255.0

Router(config-if)#des Crossover cable to R2

Router(config-if)#no sh

Router(config-if)#in s0/0/0

Router(config-if)#ip add 192.168.2.1 255.255.255.0

Router(config-if)#clo r 64000

Router(config-if)#end

Router#sh ip int bri
















RIP

Router(config)#router rip

Router(config-router)#version 2

Router(config-router)#network 192.168.0.0

Router(config-router)#end

Router#show ip route

Router#show ip protocols

Router(config)#router r

Router(config-router)#ve 2

Router(config-router)#net 192.168.0.0

Router(config-router)#end

Router#sh ip ro

Router#sh ip proto










EIGRP

Router(config)#router eigrp 1

Router(config-router)#network 192.168.0.0

Router(config-router)#no auto-summary

Router(config-router)#redistribute static

Router(config-router)#exit

Router(config)#ip route 0.0.0.0 0.0.0.0 s0/0/0

Router(config)#router e 1

Router(config-router)#net 192.168.0.0

Router(config-router)#no au

Router(config-router)#r s

Router(config-router)#exit

Router(config)#ip route 0.0.0.0 0.0.0.0 s0/0/0









Switchport Security

Swtich(config)#interface fastethernet 0/6

Swtich(config-if)#switchport mode access

Swtich(config-if)#switchport access vlan 10

Swtich(config-if)#switchport port-security

Swtich(config-if)#switchport port-security maximum 5

Swtich(config-if)#switchport port-security mac-address 1111.2222.3333

Swtich(config-if)#switchport port-security violation shutdown

Swtich(config-if)#do show port-security

Swtich(config)#in f0/6

Swtich(config-if)#sw m a

Swtich(config-if)#sw a v 10

Swtich(config-if)#sw po

Swtich(config-if)#sw po ma 5

Swtich(config-if)#sw po mac 1111.2222.3333

Swtich(config-if)#sw po v s

Swtich(config-if)#do sh por














VTP

Switch(config)#vtp version 2

Switch(config)#vtp mode client

Switch(config)#vtp domain CISCO

Switch(config)#vtp password cisco

Switch(config)#vtp pruning

Switch(config)#do show vtp status

Switch(config)#vt v 2

Switch(config)#vt m c

Switch(config)#vt d CISCO

Switch(config)#vt pa cisco

Switch(config)#vt pr

Switch(config)#do sh vt st










NAT/PAT

Router(config)#ip nat pool POOL 192.168.100.1 192.168.100.50 netmask 255.255.255.0

Router(config)#access-list 1 permit 172.168.0.0 0.0.0.255

Router(config)#ip nat inside source list 1 pool POOL overload

Router(config)#interface fastethernet 0/0

Router(config-if)#ip nat inside

Router(config-if)#interface fastethernet 0/0

Router(config-if)#ip nat outside

Router(config)#ip nat poo POOL 192.168.100.1 192.168.100.50 n 255.255.255.0

Router(config)#ac 1 p 172.168.0.0 0.0.0.255

Router(config)#ip nat i s l 1 p POOL o

Router(config)#in f0/0

Router(config-if)#ip na i

Router(config-if)#in f0/0

Router(config-if)#ip nat o














DHCP

R1(config)#ip dhcp excluded-address 10.0.0.1 10.0.0.5

R1(config)#ip dhcp pool POOL

R1(dhcp-config)#network 10.0.0.0 255.255.255.0

R1(dhcp-config)#default-router 10.0.0.1

R2(config)#interface fastethernet 0/5

R2(config-if)#ip helper-address 10.10.10.5

R1(config)#ip dh e 10.0.0.1 10.0.0.5

R1(config)#ip dh po POOL

R1(dhcp-config)#netw 10.0.0.0 255.255.255.0

R1(dhcp-config)#de 10.0.0.1

R2(config)#in f0/5

R2(config-if)#ip help 10.10.10.5











Trunk Links/Etherchannel

Switch(config)#interface range fastethernet 0/7 - 0/12

Switch(config-if)#switchport trunk encapsulation dot1q

Switch(config-if)#switchport mode trunk

Switch(config-if)#channel-group 1 mode desirable

Switch(config)#in r f0/7-0/12

Switch(config-if)#sw t e d

Switch(config-if)#sw m t

Switch(config-if)#channel-g 1 m d








HSRP

Switch(config)#interface vlan 10

Switch(config-if)#standby 1 ip 192.168.0.1

Switch(config-if)#standby 1 priority 100

Switch(config-if)#standby 1 preempt

Switch(config)#int vl 10

Switch(config-if)#st 1 ip 192.168.0.1

Switch(config-if)#st 1 pri 100

Switch(config-if)#st 1 pre








Spanning-Tree

Switch(config)#spanning-tree mode rapid-pvst

Switch(config)#spanning-tree portfast default

Switch(config)#spanning-tree vlan 1 root primary

Switch(config)#do show spanning-tree

Switch(config)#sp mo r

Switch(config)#sp po d

Switch(config)#sp v 1 r p

Switch(config)#do sh sp