交换机
园区网交换机
数据中心与云计算交换机
行业精选交换系列
意图网络指挥官
无线
放装型无线接入点
墙面型无线接入点
智分无线接入点
室外无线接入点
场景化无线
行业精选无线系列
无线管理与应用
应用场景
企业租用运营商的两条MSTP专线,由于企业本端出口路由器无法检测到运营商中间链路通信中断,导致路由收敛缓慢,甚至无法收敛,从而导致上网出现故障,此时可以在路由器的出接口启用DLDP功能,分别检测两条专线的下一跳IP地址是否可达,它能检测出运营商网络的中断,及时地切换到其它备份线路,使用户可以使用其它的备份线路正常上网。
一、组网需求
如图是某银行接入网拓扑。接入网点使用VRRP分流;这里的网络出口比较特殊,通过一条MSTP线路连接两个下一跳,起到冗余备份的作用。
通过一个模拟拓扑来说明需求:
R1模拟网点路由;R2和R3模拟中心路由;10.0.0.0和11.0.0.0模拟两个上级行的网段,需要实现R1-->R3-->10.0.0.0 和R1-->R2-->R3-->11.0.0.0的数据流路径,当R2或R3down机后切换到另一条线路。
PS:重点关注R1出口的路由下一跳切换即可;不太需要关注模拟拓扑中的R2/R3路由如何调试,能确保连通性即可
二、组网拓扑
三、配置要点
1、不需要配置浮动路由,配置等价路由即可
2、出接口探测两个下一跳地址
四、配置步骤
R1配置:
1、配置浮动静态路由
R1(config)#FastEthernet 0/0
R1(config-FastEthernet 0/0)#ip ref
R1(config-FastEthernet 0/0)#ip address 2.2.2.1 255.255.255.0
R1(config)#ip route 10.0.0.0 255.0.0.0 2.2.2.3
R1(config)#ip route 11.0.0.0 255.0.0.0 2.2.2.2 //不需要配置浮动静态路由
2、配置DLDP
R1(config)#FastEthernet 0/0
R1(config-FastEthernet 0/0)#dldp 2.2.2.2 interval 100 //在出接口探测两个下一跳地址
R1(config-FastEthernet 0/0)#dldp 2.2.2.3 interval 100
R2配置:
interface FastEthernet 0/0
ip ref
ip address 2.2.2.2 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet 0/1
ip ref
ip address 3.3.3.1 255.255.255.0
duplex auto
speed auto
!
ip route 1.1.1.0 255.255.255.0 2.2.2.1
ip route 10.0.0.0 255.0.0.0 3.3.3.2
ip route 11.0.0.0 255.0.0.0 3.3.3.2
R3配置:
interface FastEthernet 0/0
ip ref
ip address 2.2.2.3 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet 0/1
ip ref
ip address 3.3.3.2 255.255.255.0
duplex auto
speed auto
interface Loopback 0
ip address 10.0.0.1 255.255.255.255
interface Loopback 1
ip address 11.0.0.1 255.255.255.255
!
!
ip route 1.1.1.0 255.255.255.0 2.2.2.1
ip route 1.1.1.0 255.255.255.0 3.3.3.1 100
PC配置:
interface FastEthernet 0/0
ip address 1.1.1.2 255.255.255.0
duplex auto
speed auto
ip route 0.0.0.0 0.0.0.0 1.1.1.1
五、配置验证
1、通过show dldp interface查看dldp状态
Ruijie(config)#sho dldp interface
Id Ip_addr Next-hop Mode Interval Retry Resume State Down_times Up_times Start_time Interface
--- --------------- --------------- ------- -------- ----- ------ ----- ---------- -------- ------------------- -------------------
2.2.2.2 2.2.2.2 active 100 3 1 UP 0 0 2013-3-14 6:23:18 gigabitEthernet 0/0
2.2.2.3 2.2.2.3 active 100 3 1 UP 0 0 2013-3-14 6:23:18 gigabitEthernet 0/0
2、链路均正常情况下在PC上tracert确认路径正确
PC#traceroute 10.0.0.1
< press Ctrl+C to break >
Tracing the route to 10.0.0.1
1 1.1.1.1 10 msec 0 msec 10 msec
2 10.0.0.1 0 msec 10 msec 10 msec
PC#traceroute 11.0.0.1
< press Ctrl+C to break >
Tracing the route to 11.0.0.1
1 1.1.1.1 10 msec 0 msec 10 msec
2 2.2.2.2 0 msec 0 msec 10 msec
3 11.0.0.1 10 msec 10 msec 10 msec
3. 链路均正常情况下在R1上show arp表和邻接表
R1#sho arp
Protocol Address Age(min) Hardware Type Interface
Internet 2.2.2.2 13 001a.a940.6d64 arpa FastEthernet 0/0
Internet 2.2.2.3 29 001a.a940.4b64 arpa FastEthernet 0/0
Internet 2.2.2.1 -- 001a.a941.3f7d arpa FastEthernet 0/0
Internet 1.1.1.2 30 00d0.f86c.1519 arpa FastEthernet 0/2
Internet 1.1.1.1 -- 001a.a941.3f7f arpa FastEthernet 0/2
Total number of ARP entries: 5
R1#sho ip ref ad
index state type ip interface rfct chg vid tid len l2add
6 resolved forward 2.2.2.2 FastEthernet 0/0 2 0 0 800 14 001a.a940.6d64
5 resolved forward 2.2.2.3 FastEthernet 0/0 2 0 0 800 14 001a.a940.4b64
3 unres glean 0.0.0.0 FastEthernet 0/0 1 0 0 0 0 0000.0000.0000
7 resolved forward 1.1.1.2 FastEthernet 0/2 1 0 0 800 14 00d0.f86c.1519
4 unres glean 0.0.0.0 FastEthernet 0/2 1 0 0 0 0 0000.0000.0000
2 resolved local 0.0.0.0 Local 0 2 0 0 0 0 0000.0000.0000
1 unres local 0.0.0.0 NULL 3 0 0 0 0 0000.0000.0000
4. 在R3上shutdown F0/0接口,dldp检测到2.2.2.3不可达,链路正常切换
PC#traceroute 11.0.0.1
< press Ctrl+C to break >
Tracing the route to 11.0.0.1
1 1.1.1.1 0 msec 10 msec 0 msec
2 2.2.2.2 10 msec 10 msec 0 msec
3 11.0.0.1 0 msec 10 msec 10 msec
PC#traceroute 10.0.0.1
< press Ctrl+C to break >
Tracing the route to 10.0.0.1
1 1.1.1.1 0 msec 10 msec 0 msec
2 2.2.2.2 0 msec 0 msec 10 msec
3 10.0.0.1 10 msec 10 msec 10 msec
六、附录:实现原理
实验结果已在前文得以验证,大家肯定带着大大的疑问,为什么只配置静态路由(没有配置浮动路由)却可以实现链路的切换呢?DLDP在这里起到了非常关键的作用。
对于同一个接口下,DLDP同时检测多个下一跳,DLDP是这么实现的:
1)当所有被检测IP地址可达时,这些IP地址所对应的ARP信息为该IP的真实MAC地址
2)当被检测的地址有不可达(但仍有一个以上可达)时,DLDP会复制第一个可达IP地址(按配置顺序的先后)的MAC地址做为这些不可达IP地址所对应的MAC地址
由于R1 F0/0接口配置DLDP同时检测2.2.2.2/2.2.2.3两个下一跳,在R3上shutdown F0/0接口后,R1 dldp检测到2.2.2.3不可达(此时2.2.2.2是可达的),就会将2.2.2.2所arp解析到的MAC地址复制成2.2.2.3的MAC地址。从转发层面看,2.2.2.3依然是可达的,只是二层链路层封装的MAC地址被修改成了2.2.2.2的MAC地址,从而实现了链路的切换。
R1#sho arp
Protocol Address Age(min) Hardware Type Interface
Internet 2.2.2.3 1 001a.a940.6d64 arpa FastEthernet 0/0
Internet 2.2.2.2 21 001a.a940.6d64 arpa FastEthernet 0/0
Internet 2.2.2.1 -- 001a.a941.3f7d arpa FastEthernet 0/0
Internet 1.1.1.2 39 00d0.f86c.1519 arpa FastEthernet 0/2
Internet 1.1.1.1 -- 001a.a941.3f7f arpa FastEthernet 0/2
Total number of ARP entries: 5
R1#sho ip ref ad
index state type ip interface rfct chg vid tid len l2add
5 resolved forward 2.2.2.3 FastEthernet 0/0 2 0 0 800 14 001a.a940.6d64
6 resolved forward 2.2.2.2 FastEthernet 0/0 2 0 0 800 14 001a.a940.6d64
3 unres glean 0.0.0.0 FastEthernet 0/0 1 0 0 0 0 0000.0000.0000
7 resolved forward 1.1.1.2 FastEthernet 0/2 1 0 0 800 14 00d0.f86c.1519
4 unres glean 0.0.0.0 FastEthernet 0/2 1 0 0 0 0 0000.0000.0000
2 resolved local 0.0.0.0 Local 0 2 0 0 0 0 0000.0000.0000
1 unres local 0.0.0.0 NULL 3 0 0 0 0 0000.0000.0000