From e7c0a465d89657539b72781d74a700907c67bec2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=95=8F?= <12071597+zhao-min-g@user.noreply.gitee.com> Date: Thu, 9 May 2024 12:37:48 +0800 Subject: [PATCH] zy --- ...11\345\205\250\350\256\276\347\275\256.md" | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 "\350\265\265\346\225\217/20240508 \345\256\211\345\205\250\350\256\276\347\275\256.md" diff --git "a/\350\265\265\346\225\217/20240508 \345\256\211\345\205\250\350\256\276\347\275\256.md" "b/\350\265\265\346\225\217/20240508 \345\256\211\345\205\250\350\256\276\347\275\256.md" new file mode 100644 index 0000000..35c15fb --- /dev/null +++ "b/\350\265\265\346\225\217/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 -- Gitee