启用arp-check的功能<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

在全局配置模式下开启ARP-CHECK功能
S<?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />2126G-2(config)#port-security arp-check

启用anti-arp-spoofing功能

S2126G-2(config-if)#anti-ARP-Spoofing ip 网关地址

启用端口安全并手动绑定IPMAC

S2126G-2(config)# interface fastethernet 端口号
 
#进入接口
 
S2126G-2(config-if)#switchport port-security  
 
#启用端口安全

 
S2126G-2(config-if)#switchport port-security mac-address MAC
 
地址ip-address IP地址
 
#在接口下绑定PCIPMAC

 
S2126G-2(config-if)# switchport port-security maximum 1   
 
#设置此端口最多学习1MAC地址,那么此接口不会再去学习其它的MAC地址了。

 
注:若此接口增加PC。必须在交换机的对应接口上将IPMAC绑定一下。
例如:
PCIP192.168.44.57  MAC2222.2222.2222
S2126G-2(config)#int f 0/3

S2126G-2(config-if)# switchport port-security maximum 2

#将最大学习MAC地址的值改设为二,否则将无法绑定新机器

S2126G-2(config-if)#switchport port-security mac-address 2222.2222.2222 ip-address 192.168.44.57