Cat3750(config-if)#switchport port-security
Command rejected: FastEthernet1/0/2 is a dynamic port.

!--- Port security can only be configured on staticaccess portsortrunk ports.

解决方法

Cat3750(config-if)#switchport mode access

!--- Sets the interface switchport mode as access.

Cat3750(config-if)#switchport port-security

!--- Enables port security on the interface.

Cat3750(config-if)#switchport port-security mac-address 0011.858D.9AF9

!--- Sets the secure MAC address for the interface.

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

!--- Sets the violation mode to shutdown. This is the default mode.
。。。