Show commands
show interfaces trunk
show vlan brief
show interfaces port-channel 1
show etherchannel summary
show etherchannel port-channel
show interfaces f0/1 etherchannel
Make Vlan
conf t
vlan 10
name Admin
Check status
show vlan brief
Assign to port
interface f0/1
switchport mode access
switchport access vlan 10
switchport voice vlan 40
Assign ip to vlan on svi
interface vlan 99
ip address 192.168.99.1
no shutdown
Configure static trunking
interface g0/1
switchport mode trunk
switchport nonnegotiate
switchport trunk native vlan 100
Configure dynamic trunking
interface g0/2
switchport mode dynamic desirable
Specify allowed trunking vlans
switchport trunk allowed vlan 10,20,30,1000
Check trunking
show interfaces trunk
R1(config)# int g0/0.(10)
R1(config-subif)# encapsulation dot1Q (10) (native)
R1(config-subif)# ip address 192.168.10.1 255.255.255.0
NO IP IF NATIVE
Etherchannel Configuration
S1(config)# interface range FastEthernet 0/1 - 2
S1(config-if-range)# channel-group 1 mode active
##Creating a port-channel interface Port-channel 1##
S1(config-if-range)# exit
S1(config)# interface port-channel 1
S1(config-if)# switchport mode trunk
S1(config-if)# switchport trunk allowed vlan 1,2,20
active Enable LACP unconditionally
auto Enable PAgP only if a PAgP device is detected
desirable Enable PAgP unconditionally
on Enable Etherchannel only
passive Enable LACP only if a LACP device is detected
DHCP
R1(config)# ip dhcp excluded-address 192.168.10.1 192.168.10.9
R1(config)# ip dhcp excluded-address 192.168.10.254
R1(config)# ip dhcp pool LAN-POOL-1
R1(dhcp-config)# network 192.168.10.0 255.255.255.0
R1(dhcp-config)# default-router 192.168.10.1
R1(dhcp-config)# dns-server 192.168.11.5
R1(dhcp-config)# domain-name example.com
R1(dhcp-config)# end
Disable DHCP
R1(config)# no service dhcp
R1(config)# service dhcp
R1(config)#
DHCP Relay
R1(config)# interface g0/0/0
R1(config-if)# ip helper-address 192.168.11.6
R1(config-if)# end
DHCP Client Configuration
SOHO(config)# interface G0/0/1
SOHO(config-if)# ip address dhcp
SOHO(config-if)# no shutdown
Stateless DHCPv6 Configuration
R1(config-if)# ipv6 nd other-config-flag
Stateful DHCPv6 Configuration
R1(config)# int g0/0/1
R1(config-if)# ipv6 nd managed-config-flag
R1(config-if)# ipv6 nd prefix default no-autoconfig //couldn't get to
work ugh
R1(config-if)# end
Switchport Security
S1(config)# interface f0/1
S1(config-if)# switchport port-security
Command rejected: FastEthernet0/1 is a dynamic port.
S1(config-if)# switchport mode access
S1(config-if)# switchport port-security
S1(config-if)# end
MAC Limiting
S1(config-if)# switchport port-security maximum ?
Switch(config-if)# switchport port-security mac-address (mac-address/sticky)
Switch(config-if)# switchport port-security violation { protect | restrict |
shutdown}
Violation Mode Discards Offending Traffic Sends Syslog Message
Increase Violation Counter Shuts Down Port
Protect Yes
No No No
Restrict Yes Yes
Yes No
Shutdown Yes Yes
Yes Yes
DHCP Snooping Configuration
S1(config)# ip dhcp snooping
S1(config)# interface f0/1
S1(config-if)# ip dhcp snooping trust
S1(config-if)# exit
S1(config)# interface range f0/5 - 24
S1(config-if-range)# ip dhcp snooping limit rate 6
S1(config-if-range)# exit
S1(config)# ip dhcp snooping vlan 5,10,50-52
S1(config)# end
DAI Configuration
S1(config)# ip dhcp snooping
S1(config)# ip dhcp snooping vlan 10
S1(config)# ip arp inspection vlan 10
S1(config)# interface fa0/24
S1(config-if)# ip dhcp snooping trust
S1(config-if)# ip arp inspection trust
PortFast Configuration
interface f 0/1
switchport mode access
spanning-tree portfast
exit
spanning-tree portfast default
exit
BPDU Guard Configuration
interface f 0/1
spanning-tree bpduguard enable
exit
spanning-tree portfast bpduguard default
end