Professional Documents
Culture Documents
Common Commands
Hostname
R(config)# hostname R1
Console Password
R(config)# line console 0
R(config-line)# password CISCO123
R(config-line)# login
Synchronous Logging
No interrupti ons while typing a command
R(config)# line console 0 (or line vty 0 4)
R(config-line)# logging synchronous
Banner
R(config)# banner motd $Authorized Personnel Only!
You are knowingly violating usage rights by accessing this system
without permission and will be prosecuted to the fullest extent
of the law.$
Router Commands
Subinterfaces (Router on a Stick)
R(config)# int fa0/1
R(config-if)# no shutdown
R(config-if)# int fa0/1.10
R(config-subif)# encapsulation dot1q 10
R(config-subif)# ip address 192.168.10.1 255.255.255.0
R(config-subif)# int fa0/1.20
R(config-subif)# encapsulation dot1q 20
R(config-subif)# ip address 192.168.20.1 255.255.255.0
DHCP Pools
R(config)# ip dhcp pool Subnet10
R(dhcp-config)# default router 192.168.10.1
R(dhcp-config)# network 192.168.10.0 255.255.255.0
Switch Commands
Default Gateway
S(config)# ip default-gateway 1.2.3.4
Port Speed
S(config)# int fa0/1
S(config-if)# speed 10 (10 or 100 or auto)
Access Port
S(config)# int fa0/1
S(config-if)# switchport mode access
S(config-if)# switchport access vlan 99
Trunk Port
S(config)# int fa0/1
S(config-if)# switchport trunk encapsulation dot1q (or isl)
S(config-if)# switchport trunk native vlan 99 (optional)
S(config-if)# switchport mode trunk
VTP Server
S(config)# vtp mode server
S(config)# vtp version 2
S(config)# vtp domain Cisco123
S(config)# vtp password ciscoSECRET
VTP Client
S(config)# vtp version 2
S(config)# vtp mode client
S(config)# vtp domain Cisco123
S(config)# vtp password ciscoSECRET
Port Security
S(config)# int fa0/1
S(config-if)# switchport port-security
S(config-if)# switchport port-security maximum 3
S(config-if)# switchport port-security violation shutdown
S(config-if)# switchport port-security mac-address sticky
Spanning Tree
Switch Priority (Per VLAN)
S1(config)# spanning-tree vlan 1,5,15,25,35 priority 4096
Root Switch
S2(config)# spanning-tree vlan 5 root
S2(config)# spanning-tree vlan 5 root primary
Port Cost
S2(config)# interface fa0/1
S2(config-if)# spanning-tree cost 20
S2(config-if)# end
Port Priority
S2(config)# interface gig0/1
S2(config-if)# spanning-tree port-priority 64
S2(config-if)# spanning-tree vlan 5 port-priority 64
PortFast
S2(config)# interface fa0/10
S2(config-if)# spanning-tree portfast (access port)
S2(config-if)# spanning-tree portfast trunk (trunk port - DANGEROUS)
Remark Command
Add a comment to the access-list
R(config)# access-list 10 remark Only Jones has access
Miscellaneous
Correcting Native VLAN Mismatch
Indicates a misconfi gured trunk port
Go to the Switch & FA that it specifies- Type the following:
S(config-if)# switchport trunk native vlan 30
S(config-if)# switchport mode trunk
When configuring a PC
IP Address – same VLAN, count 1 up.
PC0 is on VLAN 20 (192.168.20.225)
PC3 is on VLAN20 (192.168.20.226)
PC1 is on VLAN 10 (192.168.10.193)
PC4 is on VLAN 10 (192.168.10.194)
Example:
VLAN 10 = Sales = 192.168.10.192/26
VLAN 20 = HR = 192.168.20.224/27
VLAN 30 = MGMT = 192.168.99.0/28
Pre IOS
Flash-init
Load_helper
Dir flash:
Rename flash: config.text flash: cat
Dir flash:
Boot
IOS
R# show flash:
R# rename flash: cat flash: config.text
R# copy start run