交换机端口安全

实验要求:在交换机f0/1端口上设置安全配置,使PC1或者PC2两台机器只有一台机器能够通信,另一台通信时端口则会自动关闭

拓扑图如下:

交换机配置:

enable  进入特权模式

configure terminal   进入全局模式

interface f0/1  进入f0/1端口

shutdown   关闭端口

switchport mode access  修改端口模式

switchport port-security  修改端口为安全模式

switchport port-security mac-address  将主机mac地址与端口绑定

switchport port-security maximum 1 设置mac地址的最大数量为1

switchport port-security violation shutdown  设置违反安全设置后的处理动作为关闭端口

end  返回特权模式

copy running-config startup-config  保存配置 

注意事项:违反端口安全导致端口关闭,如要重新开启端口则要进入指定端口手动输入shutdown和no shutodwn,端口则开启 

原文地址:https://www.cnblogs.com/guoshiyu/p/9148266.html