diff --git "a/09 \345\256\230\346\226\207\350\257\232/20240508 \345\256\211\345\205\250\350\256\276\347\275\256.md" "b/09 \345\256\230\346\226\207\350\257\232/20240508 \345\256\211\345\205\250\350\256\276\347\275\256.md" new file mode 100644 index 0000000000000000000000000000000000000000..35c15fb84974daeb793e49d098f88b5cce9acb93 --- /dev/null +++ "b/09 \345\256\230\346\226\207\350\257\232/20240508 \345\256\211\345\205\250\350\256\276\347\275\256.md" @@ -0,0 +1,53 @@ +#### 端口安全 + +每个pc的mac地址不一样,我们可以将端口与电脑的mac绑定 + +1.选择要绑定的端口 + +2.启动交换机的接口安全,但是端口的默认是动态模式(dynamic),所以要先把端口的模式改为访问模式(access) + +~~~js +(config-if)#switchport mode access + (config-if)#switchport port-security //启用安全设置 +~~~ + +3.设置接口允许的最大连接数 1 + +~~~js +(config-if)#switchport port-security maximum 1 +~~~ + +4.设置超过连接数的违规设备的处理方式 + +~~~js +(config-if)#switchport port-security violation shutdown 关机 + protect 保护模式 + restrict 限制模式 +~~~ + +5.设置哪一个mac地址跟端口绑定 + +~~~js +(config-if)#switchport port-security mac-address stick //将前面max设置的数量对应的mac地址从表中粘贴到安全设置中 +~~~ + +###### 清空mac地址,重新学习 + +~~~js +# clear port-security stick //清除静态 + all //清除所有 + //被关闭的端口要手动关闭一次在重新启动 +~~~ + +##### 查看端口安全设置 + +~~~js +# show port-security +# show port-security int f0/1 查看指定的端口 +~~~ + + + +#### 作业 + +- ![捕获.PNG](https://img2.imgtp.com/2024/05/08/k9K8VjpK.PNG) \ No newline at end of file