Lab procedure]
Switch 1
Switch> enable
Switch # configure terminal
Switch (config) # interface fastEthernet 0/1
Switch (config-if-range) # switchport port-security maximum 1 (configure the maximum number of connections on the port to 1)
Switch (config-if-range) # switchport port-security violation shutdown (set the security violation handling method to shutdown)
Switch (config-if-range) # exit
Switch (config) # interface fastEthernet 0/1
Switch (config-if) # switchport port-security mac-address sticky 0004252c.ba88 (bind mac address)
Switch (config-if) # exit
(Note)
1. The vswitch port security function can only be configured on the ACCESS interface
2. the maximum number of connections of a vswitch ranges from 1 to 128. The default value is 128.
Switch # show running-config
Building configuration...
Current configuration: 978 bytes
!
Version 12.2:
No service password-encryption
!
Hostname Switch
!
!
!
Interface FastEthernet0/1
Switchport port-security mac-address 0004262c.ba88
!