首页 > 其他 > 详细

交换机端口安全

时间:2019-08-25 02:31:23      阅读:96      评论:0      收藏:0      [点我收藏+]
技术分享图片

一、实验要求:
交换机f0/1只能连接两台pc,多了就自动断线

配置命令
Switch(config)#int fa0/1
Switch(config-if)#switchport mode access //使用acces模式
Switch(config-if)#switchport port-security    //先开启安全
Switch(config-if)#switchport port-security maximum 2   //设置最大连接数为2
Switch(config-if)#switchport port-security violation shutdown   //超过连接数就断线

二、验证

新加一台PC后,没有进行通信,交换机的MAC表就不会有新加的PC的信息,也就是不知道有加计算机,用右边ping左边,还能ping通,当ping第三台PC是,交换机会发现自己多加了一个MAC表,就会自动断线,交换机和集线器的线会变红

技术分享图片
技术分享图片

三、重启交换机
拆掉多余的PC,重启交换机,可以恢复通信

Switch(config)#int fa0/1
Switch(config-if)#shut

%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to administratively down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down

Switch(config-if)#no shut

%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

Switch(config-if)#

交换机端口安全

原文:https://blog.51cto.com/12873382/2432298

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!