简介:
与我们所知的VRRP一样,IP FRR也是一种用于路由备份的技术。IP FRR适用与公网IP网络中对于丢包、延时非常敏感的业务。
在传统的IP网络上,转发链路出现底层故障后,最为直观的表现是在设备上的物理接口状态变为Down状态。设备检测到这种故障后,会通知上层路由系统进行相应更新,并重新计算路由。通常从链路故障发生到路由系统完成路由收敛,要经过几秒钟的时间。
但对于网络上的某些对延时、丢包等非常敏感的业务来说,秒级的收敛时间是不能忍受的,可能导致当前业务的中断。如VoIP业务所能容忍网络中断时间为毫秒级。IP FRR特性能都保证转发系统快速应对出现的链路故障,直接启用备份路由进行数据转发,尽快让业务流恢复正常。
局限性:
IPFRR备用方案的建立,不会对原有的流量产生影响。但是在切换到备份路由后,流量的状态和去向便不得而知。如下,链路的cost如图分布:
R1的流量要到R4去。正常情况下是走R1—R2—R4这条路(红色箭头所示),但是当R1、R2之间的链路发生故障或是R2出现故障时,在IP FRR的作用下回直接切换到备用链路R1—R3这条链路。
我们假设R2发生故障,此时流量行走路线会立即切换到备用线路,经过R3,接下来根据cost值,很明显,流量会转发到R2到R4,而不会直接到R4。但是,此时的R2出现了故障,所以流量是不能到达R4的。
对于以上不足的解决办法本文档暂不说明。请查找其他资料。
配置实例:
一、实验目的
了解IP FRR的原理;
掌握IP FRR的应用;
理解试试IP FRR的意义;
比较与VRRP的区别。
二、实验拓扑
三、实验要求
如上图:网络中有4台路由器,全都运行OSPF协议。R1到R4有两条路由可达,且LinkB为LinkA的备份链路。当LinkA出现故障时,流量可以快速切换到备份链路上,从而保证流量从R1到R4的正常转发。
四、实验步骤
1.基本配置
R1配置:
<Huawei>system-view
Enter system view, return userview with Ctrl+Z.
[Huawei]sys R1
[R1]inter g0/0/0
[R1-GigabitEthernet0/0/0]ipadd 12.12.12.1 24
Aug 26 2014 18:04:31-05:13R1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interfaceGigabitEthernet0/0/0 has entered the UP state.
[R1-GigabitEthernet0/0/0]interg0/0/1
[R1-GigabitEthernet0/0/1]ipadd 13.13.13.1 24
Aug 26 2014 18:04:43-05:13R1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP on the interfaceGigabitEthernet0/0/1 has entered the UP state.
[R1-GigabitEthernet0/0/1]interloo0
[R1-LoopBack0]ip add1.1.1.1 24
[R1-LoopBack0]quit
R2配置:
<Huawei>system-view
Enter system view, returnuser view with Ctrl+Z.
[Huawei]sys R2
[R2]inter g0/0/0
[R2-GigabitEthernet0/0/0]ipadd 12.12.12.2 24
Aug 26 2014 18:07:41-05:13R2 %%01IFNET/4/LINK_STATE(l)[0]:The lineprotocol IP on the interfaceGigabitEthernet0/0/0 has entered the UP state.
[R2-GigabitEthernet0/0/0]interg0/0/1
[R2-GigabitEthernet0/0/1]ipadd 24.24.24.1 24
Aug 26 2014 18:07:55-05:13R2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP on the interfaceGigabitEthernet0/0/1 has entered the UP state.
R3配置:
<Huawei>system-view
Enter system view, returnuser view with Ctrl+Z.
[Huawei]sys R3
[R3]inter g0/0/0
[R3-GigabitEthernet0/0/0]ipadd 13.13.13.2 24
Aug 26 2014 18:09:48-05:13R3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interfaceGigabitEthernet0/0/0 has entered the UP state.
[R3-GigabitEthernet0/0/0]interg0/0/1
[R3-GigabitEthernet0/0/1]ipadd 34.34.34.1 24
Aug 26 2014 18:10:03-05:13R3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP on the interfaceGigabitEthernet0/0/1 has entered the UP state.
R4配置:
<Huawei>system-view
Enter system view, returnuser view with Ctrl+Z.
[Huawei]sys R4
[R4]inter g0/0/0
[R4-GigabitEthernet0/0/0]ipadd 24.24.24.2 24
Aug 26 2014 18:11:23-05:13R4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interfaceGigabitEthernet0/0/0 has entered the UP state.
[R4-GigabitEthernet0/0/0]interg0/0/1
[R4-GigabitEthernet0/0/1]ipadd 34.34.34.3 24
Aug 26 2014 18:11:34-05:13R4 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP on the interfaceGigabitEthernet0/0/1 has entered the UP state.
[R4-GigabitEthernet0/0/1]interloo 0
[R4-LoopBack0]ip add4.4.4.4 24
[R4-LoopBack0]quit
2.路由配置
配置公网IP FRR之前,前置任务之一就是配置静态路由或是IGP协议,保证各节点路由可达。本实验我们就用OSPF协议。
R1配置:
[R1]ospf
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 12.12.12.00.0.0.255
[R1-ospf-1-area-0.0.0.0]network 1.1.1.00.0.0.255
[R1-ospf-1-area-0.0.0.0]network 13.13.13.00.0.0.255
R2配置:
[R2]ospf
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network12.12.12.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]network24.24.24.0 0.0.0.255
R3配置:
[R3]ospf
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network13.13.13.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]network34.34.34.0 0.0.0.255
R4配置:
[R4]ospf
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]network4.4.4.0 0.0.0.255
[R4-ospf-1-area-0.0.0.0]network24.24.24.0 0.0.0.255
[R4-ospf-1-area-0.0.0.0]network34.34.34.0 0.0.0.255
验证R1—R4连通性:
[R1]ping 4.4.4.4
PING 4.4.4.4: 56 data bytes, press CTRL_C to break
Reply from 4.4.4.4: bytes=56 Sequence=1ttl=254 time=100 ms
Reply from 4.4.4.4: bytes=56 Sequence=2ttl=254 time=20 ms
Reply from 4.4.4.4: bytes=56 Sequence=3ttl=254 time=10 ms
Reply from 4.4.4.4: bytes=56 Sequence=4ttl=254 time=20 ms
Reply from 4.4.4.4: bytes=56 Sequence=5ttl=254 time=20 ms
--- 4.4.4.4 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 10/34/100 ms
[R4]ping 1.1.1.1
PING 1.1.1.1: 56 data bytes, press CTRL_C to break
Reply from 1.1.1.1: bytes=56 Sequence=1ttl=254 time=80 ms
Reply from 1.1.1.1: bytes=56 Sequence=2ttl=254 time=20 ms
Reply from 1.1.1.1: bytes=56 Sequence=3ttl=254 time=10 ms
Reply from 1.1.1.1: bytes=56 Sequence=4ttl=254 time=20 ms
Reply from 1.1.1.1: bytes=56 Sequence=5ttl=254 time=20 ms
--- 1.1.1.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 10/30/80 ms
R1---R4连接正常。
3.路径设置
配置公网IP FRR之前的另一个任务是生成两条不等价的路由,一条为另一条的备份路径,本实验我们把LinkB设置为LinkA的备份路径,所以我们要让到达R4的流量在正常情况下经过R2到达R4,通过修改链路的cost值实现。
修改R1的G0/0/1接口上的Cost值,使OSPF优先选择 LinkA为主链路。
[R1]inter g0/0/1
[R1-GigabitEthernet0/0/1]ospfcost 100
[R1-GigabitEthernet0/0/1]quit
修改R4的G0/0/1接口上的Cost值,使OSPF优先选择 LinkA为主链路。
[R4]inter g0/0/1
[R4-GigabitEthernet0/0/1]ospfcost 100
[R4-GigabitEthernet0/0/1]quit
验证:
[R1]tracert 4.4.4.4
traceroute to 4.4.4.4(4.4.4.4), max hops: 30 ,packetlength: 40,press CTRL_C to break
1 12.12.12.2 20 ms 20 ms 10 ms
2 24.24.24.2 30 ms 30 ms 20 ms
R1到R4的流量确实是从R2经过的。
4.配置路由策略并启用IP FRR
[R1]ip ip-prefix frrpermit 4.4.4.4 32 //用前缀列表抓取到4.4.4.4的流量
[R1]route-policy ip_frr permit node 10 //启用路由策略
Info: New Sequence of thisList.
[R1-route-policy]if-matchip-prefix frr
[R1-route-policy]applybackup-nexthop 13.13.13.2
[R1-route-policy]applybackup-interface GigabitEthernet 0/0/1
以上三行的意思为:如果匹配前缀列表的流量,就设置下一跳的备份IP为13.13.13.2(即R3的IP)、下一跳的备份接口为R1的G0/0/1(也就是让流量经过R3)
[R1-route-policy]quit
启用IP FRR
[R1]ip frr route-policyip_frr
验证:
在R1上查看备份出接口和备份下一跳信息
[R1]display iprouting-table 4.4.4.4 verbose
Route Flags: R - relay, D- download to fib
------------------------------------------------------------------------------
Routing Table : Public
Summary Count : 1
Destination: 4.4.4.4/32
Protocol: OSPF Process ID: 1
Preference: 10 Cost: 2
NextHop: 12.12.12.2 Neighbour: 0.0.0.0
State: Active Adv Age: 00h00m11s
Tag: 0 Priority: medium
Label: NULL QoSInfo: 0x0
IndirectID: 0x0
RelayNextHop: 0.0.0.0 Interface: GigabitEthernet0/0/0
TunnelID: 0x0 Flags: D
BkNextHop:13.13.13.2 BkInterface:GigabitEthernet0/0/1
BkLabel: NULL SecTunnelID: 0x0
BkPETunnelID: 0x0 BkPESecTunnelID: 0x0
BkIndirectID: 0x0
五、实验总结
IP FRR适用与公网IP网络中对于丢包、延时非常敏感的业务;
IP FRR可以在原有链路Down之后,不用经过路由重新计算选路的时间而损失流量,达到毫秒级的快速切换备用链路,保证业务的正常运行;
IP FRR虽然好,但是也存在缺陷。流量经过备份路径后的状态和去向我们不得而知,需要经过严格的组网设计解决这种缺陷;
本文出自 “我就是天使” 博客,请务必保留此出处http://gyhrambo.blog.51cto.com/7297595/1545410
原文地址:http://gyhrambo.blog.51cto.com/7297595/1545410