diff --git "a/\345\255\231\347\245\245/20240508.md" "b/\345\255\231\347\245\245/20240508.md" new file mode 100644 index 0000000000000000000000000000000000000000..5416426cd7d0d39cc58daf6d5a33f707121cb0d1 --- /dev/null +++ "b/\345\255\231\347\245\245/20240508.md" @@ -0,0 +1,13 @@ +# 交换机的安全配置 +交换机端口安全的配置: + +在交换机端口配置模式下输入 +Switch(config)#int f 0/3 // 选择接口 +Switch(config-if)#switchport mode access // 将端口改为access的模式,默认是动态的 +Switch(config-if)#switchport port-security // 在前面已经改好access模式下,再执行一次启用交换机接口的接口安全配置 +Switch(config-if)#switchport port-security maximum 1 // 设置端口安全模式下,该接口允许的最大连接数 1 +Switch(config-if)#switchport port-security violation shutdown // 设置超过连接数的违规设备的处理方式 +Switch(config-if)#switchport port-security mac-address sticky // 设置哪一个MAC是跟这个端口正确绑定的(允许访问),sticky将前面MAX设置的数量对应的MAC从地址表中,粘贴到安全设置中。// 必须让正确的电脑访问一次交换机。让交换机学习到这个MAC地址 +// 为了让交换机学习到正确的MAC地正,要ping1次 +Switch#clear port-security sticky // 将安全设置中,正确的MAC清空了。可以重新学习。 +Switch(config-if)#shut // 被关闭的端口,要手动关闭一次,再重新开启。no shut