使用 Port Security feature 防范MAC/CAM攻击

思科 Port Security feature 可以防止 MAC 和 MAC/CAM 攻击。通过配置 Port Security 可以控制:

• 端口上最大可以通过的 MAC 地址数量

• 端口上学习或通过哪些 MAC 地址

• 对于超过规定数量的 MAC 处理进行违背处理

端口上学习或通过哪些 MAC 地址,可以通过静态手工定义,也可以在交换机自动学习。交换机动态学习端口 MAC ,直到指定的 MAC 地址数量,交换机关机后重新学习。目前较新的技术是 Sticky Port Security ,交换机将学到的 mac 地址写到端口配置中,交换机重启后配置仍然存在。

对于超过规定数量的 MAC 处理进行处理一般有三种方式(针对交换机型号会有所不同):

• Shutdown 。这种方式保护能力最强,但是对于一些情况可能会为管理带来麻烦,如某台设备中了病毒,病毒间断性伪造源 MAC 在网络中发送报文。

• Protect 。丢弃非法流量,不报警。

• Restrict 。丢弃非法流量,报警,对比上面会是交换机 CPU 利用率上升但是不影响交换机的正常使用。推荐使用这种方式。

1.4配置

port-security 配置选项:

Switch(config-if)# switchport port-security ?

aging Port-security aging commands

mac-address Secure mac address

maximum Max secure addresses

violation Security violation mode


配置 port-security 最大 mac 数目,违背处理方式,恢复方法

Cat4507(config)#int fastEthernet 3/48

Cat4507 (config-if)#switchport port-security

Cat4507 (config-if)#switchport port-security maximum 2

Cat4507 (config-if)#switchport port-security violation shutdown

Cat4507 (config)#errdisable recovery cause psecure-violation

Cat4507 (config)#errdisable recovery interval 30


通过配置 sticky port-security学得的MAC

interface FastEthernet3/29

switchport mode access

switchport port-security

switchport port-security maximum 5

switchport port-security mac-address sticky

switchport port-security mac-address sticky 000b.db1d.6ccd

switchport port-security mac-address sticky 000b.db1d.6cce

switchport port-security mac-address sticky 000d.6078.2d95

switchport port-security mac-address sticky 000e.848e.ea01
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值