Make Router ignore inaccessible static routes advertising.


0–A–B–C–D,如果B-0的路径是通过Static Routes指定的,那么B就会一直向C通告它有路径可达0,这时如果0实际已经掉线,就会出现问题。因为在B看来它并没有去尝试确认A是否真的可达,它只是基于BA之间链路是否UP来估测0的可达性,而简单的redistribute static会造成C获得不需要的路由信息。

使用SLA和TRACK组合,可以达到控制C向D通告路由内容的作用。

0: 172.16.136.112+ 172.16.136.113

ip sla 1
icmp-echo 172.16.136.112 source-interface GigabitEthernet4/40
frequency 5
ip sla schedule 1 life forever start-time now

track 1 ip sla 1 reachability

ip route 172.16.136.112 255.255.255.255 null0 track 1

ip sla 2
icmp-echo 172.16.136.113 source-interface GigabitEthernet4/41
frequency 5
ip sla schedule 2 life forever start-time now

track 2 ip sla 2 reachability

ip route 172.16.136.113 255.255.255.255 Null0 track 2

这样就只有当C确实能从0得到ICMP ECHO的情况下,它才会去通告D它具有一条路由,否则就会销毁到NULL0去。

 

另一种情况是,如果B-0的路径是用STATIC ROUTE指定的,就不能用TRACK了,因为IP ROUTE会造成TRACK被忽略,不写IP ROUTE,0永远不可达,写了IP ROUTE,不论TRACK是否可达,B都会通报路由。这时就要用到BFD。B-A间都开启BFD,进行STATIC ROUTE 检测,如果不可达自然会屏蔽。

interface GigabitEthernet4/40
description mgw01_ipni1p0_eth_sfp1
ip address 172.16.136.81 255.255.255.252
bfd interval 50 min_rx 50 multiplier 3 (开启BFD功能)

!
interface GigabitEthernet4/41
description mgw01_ipni1p0_eth_sfp2
ip address 172.16.136.85 255.255.255.252
bfd interval 50 min_rx 50 multiplier 3

ip route 172.16.136.112 255.255.255.255 GigabitEthernet4/40 172.16.136.82 (链路用来BFD,如果不可达就不通报)
ip route 172.16.136.113 255.255.255.255 GigabitEthernet4/41 172.16.136.86

ip route static bfd GigabitEthernet4/40 172.16.136.82 (指定邻居)
ip route static bfd GigabitEthernet4/41 172.16.136.86

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s