Cisco Nexus 之“ip redirect”
更新:HHH   时间:2023-1-7


ICMP Redirect引起的网络丢包

场景

当网络设备发下发送给自己的数据包,下一跳地址和发送源地址在同一个子网时,就会回复一个icmp redirect报文,用于向发送源设备指出存在一个更加优化的路由。当源设备接收到这个icmp redirect报文后,后续数据包就会直接发送给新的下一跳。

引起原因

这一般都是由于策略路由(PBR)或者不优化的路由(错误的静态)引起的。

  +---+
  |   +----------+ ---+
  +---+          |    |
10.1.1.2/24      |    |
                 |    |          +---+
                 |LAN +----------+   |
                 |    |          +---+
                 |    |        10.1.1.1/24
  +---+          |    |
  |   +----------+----+
  +---+
10.1.1.3/24

如图所示,假设10.1.1.2去往10.1.1.3的的数据包被策略路由强行发网10.1.1.1,10.1.1.1会发现下一跳和自己在同一个网段,接下来将会向10.1.1.2回复一个ICMP Redirect。

                    +---+
                    |   +----------+ ---+
                    +---+          |    |
                  10.1.1.2/24      |    |
                                   |    |          +---+
                                   |LAN +----------+   |
                                   |    |          +---+
                                   |    |        10.1.1.1/24
                    +---+          |    |
192.168.1.0/24<-----+   +----------+----+
                    +---+
                  10.1.1.3/24

如上图,还有一种路由不优化的情况,假设路由设置如下:
10.1.1.2
ip route 192.168.1.0/24 10.1.1.1
10.1.1.1
ip route 192.168.1.0/24 10.1.1.3
10.1.1.3
ip route 192.168.1.0/24 x.x.x.x

这种情况下,10.1.1.1同样也会向10.1.1.2回复ICMP Redirect。

危害

由于需要网络设备回复ICMP Redirect报文,数据包需要发送给CPU进行处理,这将增加CPU额外的负担。
为了避免这种情况(或***),Nexus在硬件层面对需要ICMP Redirect报文进行限速。
目前, IP redirects通过Layer 3 Time-to-Live (TTL) 速率限制。默认是500个包每秒。如果超过这个值,将带来丢包

N7K# show hardware rate-limiter 
Units for Config: packets per secondAllowed, Dropped & Total: aggregated since last clear counters
rl-1: STP and Fabricpath-ISIS
rl-2: L3-ISIS and OTV-ISIS
rl-3: UDLD, LACP, CDP and LLDP
rl-4: Q-in-Q and ARP request
rl-5: IGMP, NTP, DHCP-Snoop, Port-Security, Mgmt and Copy traffic


Module: 1Rate-limiter PG Multiplier: 1.00

  R-L Class           Config           Allowed         Dropped            Total
 +------------------+--------+---------------+---------------+-----------------+
  L3 mtu                   500               0               0                 0
  L3 ttl                   500               0               0                 0
  L3 control             10000               0               0                 0

解决方案及建议

1、关闭ICMP Redirect

int vlan xx no ip redirect

2、调整Hardware Rade-limite值

Example:N7K(config)# hardware rate-limiter layer-3 ttl 1000

本文参考文档
Cisco Nexus 7000 Series NX-OS Security Configuration Guide


返回数据安全教程...