diff --git "a/15\345\274\240\346\231\257\346\266\233/2024-5-08-\344\272\244\346\215\242\346\234\272\347\253\257\345\217\243\345\256\211\345\205\250\351\205\215\347\275\256.md" "b/15\345\274\240\346\231\257\346\266\233/2024-5-08-\344\272\244\346\215\242\346\234\272\347\253\257\345\217\243\345\256\211\345\205\250\351\205\215\347\275\256.md" new file mode 100644 index 0000000000000000000000000000000000000000..918671199e5853fe642b8860b6baf53b542011e3 --- /dev/null +++ "b/15\345\274\240\346\231\257\346\266\233/2024-5-08-\344\272\244\346\215\242\346\234\272\347\253\257\345\217\243\345\256\211\345\205\250\351\205\215\347\275\256.md" @@ -0,0 +1,27 @@ +# 端口安全配置 + +### 配置步骤 + +``` +1.选择要进行安全设置的端口 +int f 0/1 ====> 全局模式下 + +2.启用交换机接口的接口安全设置(先改为访问模式access) +Switchport mode access +Switchport port-security ====> 启用接口安全设置 + +3.设置最大允许连接的终端设备数量 +Switchport port-security maximum 1 =====> 最大允许连接设备数量为1 + +4.设置超过做大连接量的设备的处理方式 +Switchport port-security violation shutdown ====>当超过的设备连接时就会关闭接口 + +5.绑定正确的mac地址 +Switchport port-security mac-address sticky + +为了获取正确的mac地址,需要手动进行ping一次 +要重新启用被安全规则关闭的端口,需要手动进入接口,手动关闭一次再开启一次 + +``` + +##### clear port-security sticky 清除交换机中的mac地址 (在特权模式下) \ No newline at end of file