交换机端口安全的配置

交换机端口安全的配置

1.本实验是将switch中的f0/1的端口做成安全端口,构建mac地址绑定,只让pc0能够进入这个单口,pc1不能进入。

情况一:

情况一:动态启用安全端口

步骤:
1、配置网络拓扑

2、配置主机ip和掩码

3、打开端口1安全功能

4、测试连通

结果:pc0连通,pc1不连通

# 主要代码
1>Switch(config)#int f0/1

2>Switch(config-if)#switch mode access
(把端口改为访问模式,用来接入计算机)

3>Switch(config-if)#switch port-security

4>Switch(config-if)#exit

5>Switch#show prot-security address
查看mac地址绑定

image-20211023204138838

image-20211023203304866

情况二:

情况二:静态绑定

步骤:
1、配置网络拓扑

2、配置主机ip和掩码

3、打开端口3的静态配置

4、测试连通

结果:连通

端口1的违例处理模式是protect

用PC2连接端口1测试

# 主要代码
1>Switch(config)#int f0/1

2>Switch(config-if)#switch mode access
(把端口改为访问模式,用来接入计算机)

3>switchport port-security mac-address 主机的mac地址

4>Switch(config-if)#exit

5>Switch#show prot-security address
查看mac地址绑定

image-20211023204112832

image-20211023203619201

情况三:

情况三:粘滞绑定

步骤:

1、配置网络拓扑

2、配置主机ip和掩码

3、打开端口5安全功能

4、测试连通

结果:连通

端口5的违例处理模式是restrict
用PC2连接端口1测试

# 主要代码
1>Switch(config)#int f0/1

2>Switch(config-if)#switch mode access
(把端口改为访问模式,用来接入计算机)

3>Switch(config-if)#switchport port-security mac-address sticky 

4>Switch(config-if)#exit

5>Switch#show prot-security address
查看mac地址绑定

image-20211023204044470

情况四:

设置交换机的端口安全模式为以下三种:

   switch port-security violation {protest | shutdown | restrict}

image-20211023204343496

参考文章:

https://blog.csdn.net/weixin_34007020/article/details/89901247

posted @ 2021-10-23 21:07  NotYourferry  阅读(1580)  评论(0编辑  收藏  举报