详谈DHCP SNOOP等多方面的安全设置

网络 网络管理
文章中,我们针对交换机安全 802.1X、port-security、DHCP SNOOP、DAI、VACL、SPAN RSPAN等等方面进行了分析和讲解,希望对大家有用。

我们知道DHCP协议,管理网络IP的协议。在其服务器的应用中,我们也通常遇到有关的管理知识。那么对于网络安全方面,DHCP有着更多值得注意的地方。那么今天我们就来讲解一下交换机安全 802.1X、port-security、DHCP SNOOP、DAI、VACL、SPAN RSPAN的内容。

交换机安全 802.1X、port-security、DHCP SNOOP、DAI、VACL、SPAN RSPAN
端口和MAC绑定:port-security
基于DHCP的端口和IP,MAC绑定:ip source guard
基于DHCP的防止ARP攻击:DAI
防止DHCP攻击:DHCP Snooping

cisco所有局域网缓解技术都在这里了!

常用的方式:

802.1X,端口认证,dot1x,也称为IBNS(注:IBNS包括port-security):基于身份的网络安全; 很多名字,有些烦.当流量来到某个端口,需要和ACS交互,认证之后得到授权,才可以访问网络,前提是CLIENT必须支持802.1X方式,如安装某个软件

Extensible Authentication Protocol Over Lan(EAPOL)    使用这个协议来传递认证授权信息

示例配置:

  1. Router#configure terminal  
  2. Router(config)#aaa new-model  
  3. Router(config)#aaa authentication dot1x default group radius  
  4. Switch(config)#radius-server host 10.200.200.1 auth-port 1633 key radkey  
  5. Router(config)#dot1x system-auth-control 起用DOT1X功能  
  6. Router(config)#interface fa0/0  
  7. Router(config-if)#dot1x port-control auto 

AUTO是常用的方式,正常的通过认证和授权过程

强制授权方式:不通过认证,总是可用状态

强制不授权方式:实质上类似关闭了该接口,总是不可用

可选配置:

  1. Switch(config)#interface fa0/3  
  2. Switch(config-if)#dot1x reauthentication  
  3. Switch(config-if)#dot1x timeout reauth-period 7200 

2小时后重新认证

  1. Switch#dot1x re-authenticate interface fa0/3 

现在重新认证,注意:如果会话已经建立,此方式不断开会话

  1. Switch#dot1x initialize interface fa0/3 

初始化认证,此时断开会话

  1. Switch(config)#interface fa0/3  
  2. Switch(config-if)#dot1x timeout quiet-period 45 

45秒之后才能发起下一次认证请求

  1. Switch(config)#interface fa0/3  
  2. Switch(config-if)#dot1x timeout tx-period 90 默认是30S  
  3. Switch(config-if)#dot1x max-req count 4 

客户端需要输入认证信息,通过该端口应答AAA服务器,如果交换机没有收到用户的这个信息,交换机发给客户端的重传信息,30S发一次,共4次

  1. Switch#configure terminal  
  2. Switch(config)#interface fastethernet0/3  
  3. Switch(config-if)#dot1x port-control auto  
  4. Switch(config-if)#dot1x host-mode multi-host 

默认是一个主机,当使用多个主机模式,必须使用AUTO方式授权,当一个主机成功授权,其他主机都可以访问网络;

当授权失败,例如重认证失败或LOG OFF,所有主机都不可以使用该端口

  1. Switch#configure terminal  
  2. Switch(config)#dot1x guest-vlan supplicant  
  3. Switch(config)#interface fa0/3  
  4. Switch(config-if)#dot1x guest-vlan 2 

未得到授权的进入VLAN2,提供了灵活性#p#

注意:

1、VLAN2必须是在本交换机激活的,计划分配给游客使用;2?VLAN2信息不会被VTP传递出去

  1. Switch(config)#interface fa0/3  
  2. Switch(config-if)#dot1x default 

回到默认设置

  1. show dot1x [all] | [interface interface-id] | [statistics interface interface-id] [{ | begin | exclude | include} expression]  
  2. Switch#sho dot1x all  
  3. Dot1x Info for interface FastEthernet0/3  
  4. ----------------------------------------------------  
  5. Supplicant MAC 0040.4513.075b  
  6. AuthSM State = AUTHENTICATED 
  7. BendSM State = IDLE 
  8. PortStatus = AUTHORIZED 
  9. MaxReq = 2 
  10. HostMode = Single 
  11. Port Control = Auto 
  12. QuietPeriod = 60 Seconds  
  13. Re-authentication = Enabled 
  14. ReAuthPeriod = 120 Seconds  
  15. ServerTimeout = 30 Seconds  
  16. SuppTimeout = 30 Seconds  
  17. TxPeriod = 30 Seconds  
  18. Guest-Vlan = 0debug dot1x {errors | events | packets | registry | state-machine | all} 

2、端口安全,解决CAM表溢出攻击(有种MACOF的工具,每分钟可以产生155000个MAC地址,去轰击CAM表,从而使合法主机的要求都必须被FLOOD)

示例配置:

  1. Switch#configure terminal  
  2. Switch(config)#interface fastethernet0/0  
  3. Switch(config-if)#switchport mode access  
  4. Switch(config-if)#switchport port-security  
  5. Switch(config-if)#switchport port-security maximum 20 这里默认是1  
  6. Switch(config-if)#switchport port-security mac-address sticky 

保存学习到的地址到RUN CONFIG文件中,避免手动配置的麻烦,并省去动态学习所消耗的资源

  1. switchport port-security violation {protect | restrict | shutdown} 

三个参数解释:

保护:当达到某个设定的MAC数量,后来的未知MAC不再解析,直接丢弃,且不产生通知

限制:当达到某个设定的MAC数量,后来的未知MAC不再解析,直接丢弃,产生通知,如SNMP TRAP?SYSLOG信息,并增加违反记数;这里有个问题,恶意攻击会产生大量的类似信息,给网络带来不利.

关闭:当达到某个设定的MAC数量,后来的未知MAC不再解析,直接关闭该端口,除非手动开启,或改变端口安全策略

端口安全需要全部手动配置,增加工作量,下面的两种方式

DHCP SNOOP

如网吧的管理员使用DHCP分配地址的时候执行IP和MAC地址的捆绑

  1. Switch#configure terminal  
  2. Switch(config)#ip dhcp snooping  
  3. Switch(config)#ip dhcp snooping vlan 34  
  4. Switch(config)#ip dhcp snooping information option  
  5. Switch(config)#interface fa0/0 连接DHCP服务器的接口  
  6. Switch(config-if)#ip dhcp snooping limit rate 70  
  7. Switch(config-if)#ip dhcp snooping trust  

指定该接口为信任接口,将获得DHCP服务器所分配的地址,其他接口所发生的DHCP行为将被否决DAI动态ARP审查,调用ACL和DHCP SNOOP的IP-TO-MAC数据库

  1. Switch#configure terminal  
  2. Switch(config)#ip arp inspection filter这里调用ACL  

注意,只能调用ARP ACL,该ACL优先与IP-TO-MAC表被审查,也就是说,即使有绑定项存在,如果被ARP-ACL拒绝,也不能通过

  1. Switch(config)#ip arp inspection vlan 34  
  2. Switch(config)#interface fa0/0  
  3. Switch(config-if)#ip arp inspection trust  

连接到DHCP服务器的接口,调用该接口上的DHCP SNOOP的IP-TO-MAC表,默认连接到主机的接口都是不信任的接口

  1. Switch(config-if)#ip arp inspection limit rate 20 burst interval 2 

不信任接口限制为每秒14个ARP请求,信任接口默认不受限制,这里修改为每秒20

  1. Switch(config-if)#exit  
  2. Switch(config)#ip arp inspection log-buffer entries 64 记录拒绝信息64条 

注意:DHCP SNOOP只提供IP-TO-MAC绑定表,本身不参与流量策略,只是防止DHCP欺骗,而对任何IP和MAC欺骗

是没有能力阻止的,但是它提供这样一张表给DAI调用,以防止MAC欺骗

  1. ip arp-inspection 仅仅对违规的ARP包进行过滤,不对IP包和其他包起作用  
  2. ip source verify 会对绑定接口的IP或者IP+MAC进行限制 

3、VACL

  1. Configuring VACLs for Catalyst 6500 Traffic Capture  
  2. Router(Config)# access-list 110 permit tcp any 172.12.31.0.0.0.0.255 eq 80  
  3. Router(config)# vlan access-map my_map  
  4. Router(config-access-map)# match ip address 110  
  5. Router(config-access-map)# action forward capture  
  6. Router(config)# vlan filter my_map 10-12,15  
  7. Router(config)# interface fa 5/7  
  8. Router(config-if) switchport capture allowed vlan 10-12, 15 

4、SPAN RSPAN

基于源端口和基于源VLAN的两种监控方式

RX TX BOTH 三种流量方向

VLAN MONITOR只能监控入站流,即RX,在该源VLAN中的物理端口都将成为源端口向目标端口COPY流.可以分配多个源端口或VLAN的RX流量到目的端口.不能监控多个端口的出站流,可以监控单个端口的出站流.最多只能配置两个监控会话.源端口和目标端口是分离的.可以将TRUNK端口配置成源端口,然后使用VLAN过滤想要被分析的流,但是此命令不影响正常的流量转发.过滤功能不能使用在基于源VLAN的情况下.#p#

目标端口

不能是源端口或反射端口

不参加二层协议:CDP VTP PAGP LACP DTP STP

在本地SPAN中,目标端口和源端口是同一交换机.一次只能参加一个SPAN会话,即不能在一个端口上配置两个SPAN会话.不能是EC成员.如果目标端口是一个源VLAN成员,则这个VLAN的流量不能被MONITOR,其他VLAN可以被MONITOR.802.1X与SWITCHPORT PORT-SECURITY必须在目标端口关闭.SPAN可以MONITOR二层协议信息,RSPAN则不能.IDS或IPS设备对流量唯一的影响是:根据IPS IDS策略,对可能的攻击行为做出处理,如RESET TCP连接等;并不去干涉正常流量的转发.SPAN交换机端口分析,简单的SPAN只需要两个命令即可

  1. monitor sess 1 sour int f1/4  
  2. monitor sess 1 dest int f1/9 

此例将F1/4的流量发送到F1/9被分析

  1. Switch(config)# no monitor session 2 删除语法  
  2. Switch(config)# monitor session 2 source vlan 1 - 3 rx  
  3. Switch(config)# monitor session 2 destination interface gigabitethernet0/7  
  4. Switch(config)# monitor session 2 source vlan 10 rx  
  5. Switch(config)# end 

在所有的端口上监控VLAN1-3的收到的流量,发送到G0/7被分析,然后附加VLAN10的流量也被分析

  1. Switch(config)# monitor session 2 source interface gigabitethernet0/4 rx  
  2. Switch(config)# monitor session 2 filter vlan 1 - 5 , 9  
  3. Switch(config)# monitor session 2 destination interface gigabitethernet0/8  
  4. Switch(config)# end 

监控G0/4上收到的只包括VLAN1-5 VLAN9的流量,发送到G0/8端口被分析.注意与上例的区别:也就是说在定义源流量的时候是有两种方式的,一种是源端口的流量,一种是VLAN流量#p#

RSPAN配置:

第一步:在所有交换机上将一个指定的VLAN提供给远程SPAN使用

  1. Switch(config)# vlan 901  
  2. Switch(config-vlan)# remote span  
  3. Switch(config-vlan)# end 

第二步,配置源交换机

  1. Switch(config)# monitor session 1 source interface fastethernet0/10 tx  
  2. Switch(config)# monitor session 1 source interface fastethernet0/2 rx  
  3. Switch(config)# monitor session 1 source interface fastethernet0/3 rx  
  4. Switch(config)# monitor session 1 source interface port-channel 102 rx  
  5. Switch(config)# monitor session 1 destination remote vlan 901 reflector-port  
  6. fastethernet0/1  
  7. Switch(config)# end 

第三步,目标交换机配置

  1. Switch(config)# monitor session 1 source remote vlan 901  
  2. Switch(config)# monitor session 1 destination interface fastethernet0/5  
  3. Switch(config)# end  
  4. This example shows how to disable received traffic monitoring on port 1, which was configured for  
  5. bidirectional monitoring:  
  6. Switch(config)# no monitor session 1 source interface fastEthernet0/1 rx  
  7. The monitoring of traffic received on port 1 is disabled, but traffic sent from this port continues to be  
  8. monitored. 

远程VLAN的监控

  1. Switch(config)# no monitor session 2  
  2. Switch(config)# monitor session 2 source vlan 1 - 3 rx  
  3. Switch(config)# monitor session 2 destination remote vlan 902 reflector-port  
  4. gigabitethernet0/7  
  5. Switch(config)# monitor session 2 source vlan 10 rx  
  6. Switch(config)# end  
  7. Switch(config)# no monitor session 2  
  8. Switch(config)# monitor session 2 source interface gigabitethernet0/4 rx  
  9. Switch(config)# monitor session 2 filter vlan 1 - 5 , 9  
  10. Switch(config)# monitor session 2 destination remote vlan 902 reflector-port  
  11. gigabitethernet0/8  
  12. Switch(config)# end 

 

责任编辑:佟健 来源: hi.baidu.com
相关推荐

2010-09-17 12:38:07

2009-09-14 13:25:08

LINQ多方面探讨

2009-07-03 10:04:04

JSP ASPJSP ASP区别

2012-07-24 11:42:32

Python

2015-10-26 14:49:21

物联网物联网集成

2011-04-18 17:30:04

开源iPhoneAndroid

2009-05-08 15:16:09

PHP 5.3.0测试发布

2020-03-01 22:07:38

信息泄露数据安全

2011-01-14 16:01:27

2011-05-04 17:32:15

2010-10-29 13:33:39

惠普解决方案

2021-02-02 14:46:38

数据中心新基建绿色数据中心

2017-11-22 05:58:57

支付宝微信支付互联网

2010-07-30 13:06:22

NFS端口

2010-09-27 10:19:09

DHCP工作流程

2010-05-10 14:39:43

网络负载均衡

2010-07-01 15:06:23

SNMP服务配置

2010-09-01 09:00:56

DHCP OPTION

2013-07-18 17:09:20

IPv6启动IPv6采用率

2017-08-06 11:48:24

点赞
收藏

51CTO技术栈公众号