侧边栏壁纸
博主头像
落叶人生博主等级

走进秋风,寻找秋天的落叶

  • 累计撰写 130562 篇文章
  • 累计创建 28 个标签
  • 累计收到 9 条评论
标签搜索

目 录CONTENT

文章目录

交换机端口安全

2023-03-12 星期日 / 0 评论 / 0 点赞 / 55 阅读 / 2003 字

一、实验要求:交换机f0/1只能连接两台pc,多了就自动断线配置命令Switch(config)#int fa0/1Switch(config-if)#switchport mode access /

.

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

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

二、验证

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


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

Switch(config)#int fa0/1Switch(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 downSwitch(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 upSwitch(config-if)#
.

广告 广告

评论区