区域A和区域B用户所在网络的出口处部署了两台汇聚层设备(Device A和Device B)。
现要求使用VRRP与BFD、Track联动功能,实现以下需求:
在Device A和Device B上分别配置两个VRRP备份组,Device A是VRRP备份组1中的Master设备,Device B是VRRP备份组2中的Master设备;
在正常情况下,区域A的用户将VRRP备份组1作为缺省网关,通过Device A进行数据转发,区域B用户将VRRP备份组2作为缺省网关,通过Device B进行数据转发。当一台网关设备出现故障时,另一台网关设备能够迅速承担受影响区域内主机流量的转发任务;
当网关设备Device A(Device B)自身出现故障,或其上行接口出现故障时,局域网中的主机可以通过另一台设备网关设备Device B(Device A)继续通信,避免通信中断;当Device A(Device B)故障恢复后,继续承担网关功能;
当Device A或Device B的下行链路出现故障时,局域网中的主机通过接入设备L2 Switch A 或L2 Switch B的Ten-GigabitEthernet3/0/2端口将数据转发给网关设备继续通信,避免通信中断;当Device A或Device B的下行链路故障恢复后,继续由L2 Switch A 或L2 Switch B的Ten-GigabitEthernet3/0/1端口将数据发送给网关设备。
为了实现不同区域中用户数据流的负载分担,需要在Device A和Device B上分别创建两个VRRP备份组,并配置区域A内的主机都将VRRP备份组1作为网关,区域B内的主机都将VRRP备份组2作为网关;
为使Device A优先被选举为VRRP备份组1的Master设备,需要为其在VRRP备份组1中配置较高的优先级;为使Device B优先被选举为VRRP备份组2的Master设备,需要为其在VRRP备份组2中配置较高的优先级;
配置两个VRRP备份组都工作在抢占模式,以保证原Master设备故障恢复后,能再次抢占成为Master;
通过Device A与Device B上配置BFD功能监视其上行接口的状态,当监测到其上行接口故障时,Device A或Device B的优先级会自动降低指定的数额,使VRRP备份组1内Device B的优先级高于Device A,或VRRP备份组2内Device A的优先级高于Device B,从而实现主备切换。
请务必保证备份组中的所有设备上配置的VRRP版本一致,否则备份组无法正常工作。
为了避免对端发送大量的ICMP重定向报文造成网络拥塞,建议不要将BFD echo报文的源IP地址配置为属于该设备任何一个接口所在网段。
建议将备份组的虚拟IP地址和备份组中设备下行接口的IP地址配置为同一网段,否则可能导致局域网内的主机无法访问外部网络。
(1) 配置Device A各接口的IP地址
<DeviceA> system-view
[DeviceA] interface ten-gigabitethernet 3/0/1
[DeviceA-Ten-GigabitEthernet3/0/1] undo shutdown
[DeviceA-Ten-GigabitEthernet3/0/1] ip address 1.1.1.1 24
[DeviceA-Ten-GigabitEthernet3/0/1] quit
(2) 请参考以上方法配置上图中其它接口的IP地址,配置步骤这里省略
(1) 配置Device E
# 配置Device E到VRRP备份组1和VRRP备份组2的虚拟IP地址的静态路由。
<DeviceE> system-view
[DeviceE] ip route-static 10.1.1.0 255.255.255.0 1.1.1.1
[DeviceE] ip route-static 10.1.2.0 255.255.255.0 1.1.1.1
(2) 配置Device F
# 配置Device F到VRRP备份组1和VRRP备份组2的虚拟IP地址的静态路由。
<DeviceE> system-view
[DeviceF] ip route-static 10.1.1.0 255.255.255.0 1.1.2.1
[DeviceF] ip route-static 10.1.2.0 255.255.255.0 1.1.2.1
(1) 配置Device A
# 配置VRRP备份组1的虚拟IP地址为10.1.1.1,抢占延时为5s。并且VRRP备份组1中Device A的优先级为110,高于Device B,成为VRRP备份组1的Master。
[DeviceA] interface ten-gigabitethernet 3/0/2
[DeviceA-Ten-GigabitEthernet3/0/2] vrrp vrid 1 virtual-ip 10.1.1.1
[DeviceA-Ten-GigabitEthernet3/0/2] vrrp vrid 1 priority 110
[DeviceA-Ten-GigabitEthernet3/0/2] vrrp vrid 1 preempt-mode delay 5
[DeviceA-Ten-GigabitEthernet3/0/2] quit
# 配置VRRP备份组2的虚拟IP地址为10.1.2.1,抢占延时为5s。
[DeviceA] interface ten-gigabitethernet 3/0/3
[DeviceA-Ten-GigabitEthernet3/0/3] vrrp vrid 2 virtual-ip 10.1.2.1
[DeviceA-Ten-GigabitEthernet3/0/3] vrrp vrid 2 preempt-mode delay 5
[DeviceA–Ten-GigabitEthernet3/0/3] quit
(2) 配置Device B
# 配置VRRP备份组1的虚拟IP地址为10.1.1.1,抢占延时为5s。
[DeviceB] interface ten-gigabitethernet 3/0/2
[DeviceB-Ten-GigabitEthernet3/0/2] vrrp vrid 1 virtual-ip 10.1.1.1
[DeviceB-Ten-GigabitEthernet3/0/2] vrrp vrid 1 preempt-mode delay 5
[DeviceB-Ten-GigabitEthernet3/0/2] quit
# 配置VRRP备份组2的虚拟IP地址为10.1.2.1,抢占延时为5s。并且VRRP备份组2中Device B的优先级为110,高于Device A,成为VRRP备份组2的Master。
[DeviceB] interface ten-gigabitethernet 3/0/3
[DeviceB-Ten-GigabitEthernet3/0/3] vrrp vrid 2 virtual-ip 10.1.2.1
[DeviceB-Ten-GigabitEthernet3/0/3] vrrp vrid 2 priority 110
[DeviceB-Ten-GigabitEthernet3/0/3] vrrp vrid 2 preempt-mode delay 5
[DeviceB–Ten-GigabitEthernet3/0/3] quit
(1) 配置Device A
# 配置BFD echo报文方式的Source IP,IP地址可以任意指定,不要与实际接口地址相同。
[DeviceA] bfd echo-source-ip 10.10.10.10
(2) 配置Device B
# 配置BFD echo报文方式的Source IP,IP地址可以任意指定,不要与实际接口地址相同。
[DeviceB] bfd echo-source-ip 11.11.11.11
(1) 配置Device A
# 创建和BFD会话关联的Track项1,检测上行设备Device E是否可达。
[DeviceA] track 1 bfd echo interface ten-gigabitethernet 3/0/1 remote ip 1.1.1.2 local ip 1.1.1.1
# 配置备份组1监视Track项1的状态,当Track项状态为Negative时,Device A在VRRP备份组1中的优先级减小20,低于Device B,以便Device B抢占成为Master。
[DeviceA] interface ten-gigabitethernet 3/0/2
[DeviceA-Ten-GigabitEthernet3/0/2] vrrp vrid 1 track 1 reduced 20
[DeviceA-Ten-GigabitEthernet3/0/2] quit
(2) 配置Device B
# 创建和BFD会话关联的Track项1,检测上行设备Device F是否可达。
[DeviceB] track 1 bfd echo interface ten-gigabitethernet 3/0/1 remote ip 1.1.2.2 local ip 1.1.2.1
# 配置备份组2监视Track项1的状态,当Track项状态为Negative时,Device B在VRRP备份组2中的优先级减小20,低于Device A,以便Device A抢占成为Master。
[DeviceB] interface ten-gigabitethernet 3/0/3
[DeviceB-Ten-GigabitEthernet3/0/3] vrrp vrid 2 track 1 reduced 20
[DeviceB-Ten-GigabitEthernet3/0/3] quit
(1) 网关设备Device A、Device B和链路均正常工作时,验证局域网内主机是否可以与外部网络通信
# 检查区域A的主机到目的端1.1.1.2是否可达。
<host A> ping 1.1.1.2
PING 1.1.1.2 (1.1.1.2): 56 data bytes
56 bytes from 1.1.1.2: seq=0 ttl=128 time=22.43 ms
56 bytes from 1.1.1.2: seq=1 ttl=128 time=7.17 ms
56 bytes from 1.1.1.2: seq=2 ttl=128 time=8.91 ms
56 bytes from 1.1.1.2: seq=3 ttl=128 time=7.45 ms
56 bytes from 1.1.1.2: seq=4 ttl=128 time=9.11 ms
--- 1.1.1.2 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 7.17/11.01/22.43 ms
# 检查区域B的主机到目的端1.1.2.2是否可达。
<host C> ping 1.1.2.2
PING 1.1.2.2 (1.1.2.2): 56 data bytes
56 bytes from 1.1.2.2: seq=0 ttl=128 time=22.43 ms
56 bytes from 1.1.2.2: seq=1 ttl=128 time=7.17 ms
56 bytes from 1.1.2.2: seq=2 ttl=128 time=8.91 ms
56 bytes from 1.1.2.2: seq=3 ttl=128 time=7.45 ms
56 bytes from 1.1.2.2: seq=4 ttl=128 time=9.11 ms
--- 1.1.2.2 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 7.17/11.01/22.43 ms
以上显示信息表示网关设备Device A、Device B和链路均正常工作时,区域A的主机和区域B的主机都可以访问Internet。
# 查看Device A的BFD会话。
[DeviceA] display bfd session
Total Session Num: 1 Up Session Num: 1 Init Mode: Active
IPv4 Session Working Under Echo Mode:
LD SourceAddr DestAddr State Holdtime Interface
65 1.1.1.1 1.1.1.2 Up 2000ms XGE3/0/1
以上显示信息表示BFD会话已经建立。
# 显示Device A上备份组的详细信息。
[DeviceA] display vrrp verbose
IPv4 Virtual Router Information:
Running Mode : Standard
Total number of virtual routers : 2
Interface Ten-GigabitEthernet3/0/2
VRID : 1 Adver Timer : 100
Admin Status : Up State : Master
Config Pri : 110 Running Pri : 110
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : 10.1.1.1
Virtual MAC : 0000-5e00-0101
Master IP : 10.1.1.101
VRRP Track Information:
Track Object : 1 State : Positive Pri Reduced : 20
Interface Ten-GigabitEthernet3/0/3
VRID : 2 Adver Timer : 100
Admin Status : Up State : Backup
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 5
Become Master : 3600ms left
Auth Type : None
Virtual IP : 10.1.2.1
Master IP : 10.1.2.102
# 显示Device B上备份组的详细信息。
[DeviceB] display vrrp verbose
IPv4 Virtual Router Information:
Running Mode : Standard
Total number of virtual routers : 2
Interface Ten-GigabitEthernet3/0/2
VRID : 1 Adver Timer : 100
Admin Status : Up State : Backup
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 5
Become Master : 3100ms left
Auth Type : None
Virtual IP : 10.1.1.1
Master IP : 10.1.1.101
Interface Ten-GigabitEthernet3/0/3
VRID : 2 Adver Timer : 100
Admin Status : Up State : Master
Config Pri : 110 Running Pri : 110
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : 10.1.2.1
Virtual MAC : 0000-5e00-0102
Master IP : 10.1.2.102
VRRP Track Information:
Track Object : 1 State : Positive Pri Reduced : 20
以上显示信息表示在备份组1中Device A为Master,Device B为Backup,缺省网关为10.1.1.1/24的主机通过Device A访问Internet;备份组2中Device A为Backup,Device B为Master,缺省网关为10.1.2.1/24的主机通过Device B访问Internet。
(2) 当Device A监视的上行设备或上行链路状态为down时,验证局域网内主机是否可以与外部网络通信
# 检查区域A的主机到目的端1.1.1.2是否可达。
<host A> ping 1.1.1.2
PING 1.1.1.2 (1.1.1.2): 56 data bytes
56 bytes from 1.1.1.2: seq=0 ttl=128 time=22.43 ms
56 bytes from 1.1.1.2: seq=1 ttl=128 time=7.17 ms
56 bytes from 1.1.1.2: seq=2 ttl=128 time=8.91 ms
56 bytes from 1.1.1.2: seq=3 ttl=128 time=7.45 ms
56 bytes from 1.1.1.2: seq=4 ttl=128 time=9.11 ms
--- 1.1.1.2 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 7.17/11.01/22.43 ms
# 检查区域B的主机到目的端1.1.1.2是否可达。
<host C> ping 1.1.2.2
PING 1.1.2.2 (1.1.2.2): 56 data bytes
56 bytes from 1.1.2.2: seq=0 ttl=128 time=22.43 ms
56 bytes from 1.1.2.2: seq=1 ttl=128 time=7.17 ms
56 bytes from 1.1.2.2: seq=2 ttl=128 time=8.91 ms
56 bytes from 1.1.2.2: seq=3 ttl=128 time=7.45 ms
56 bytes from 1.1.2.2: seq=4 ttl=128 time=9.11 ms
--- 1.1.2.2 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 7.17/11.01/22.43 ms
以上显示信息表示当Device A监视的上行设备或上行链路状态为down时,区域A的主机和区域B的主机都可以访问Internet。
# 查看Device A上的BFD会话。
[DeviceA] display bfd session
Total Session Num: 1 Up Session Num: 0 Init Mode: Active
IPv4 Session Working Under Echo Mode:
LD SourceAddr DestAddr State Holdtime Interface
65 1.1.1.1 1.1.1.2 Down / XGE3/0/1
以上显示信息表示BFD会话已经终止。
# 显示Device B上备份组的详细信息。
[DeviceB] display vrrp verbose
IPv4 Virtual Router Information:
Running Mode : Standard
Total number of virtual routers : 2
Interface Ten-GigabitEthernet3/0/2
VRID : 1 Adver Timer : 100
Admin Status : Up State : Master
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : 10.1.1.1
Virtual MAC : 0000-5e00-0101
Master IP : 10.1.1.102
Interface Ten-GigabitEthernet3/0/2
VRID : 2 Adver Timer : 100
Admin Status : Up State : Master
Config Pri : 110 Running Pri : 110
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : 10.1.2.1
Virtual MAC : 0000-5e00-0102
Master IP : 10.1.2.102
VRRP Track Information:
Track Object : 1 State : Positive Pri Reduced : 20
以上显示信息表示当Device A监视的上行设备或上行链路状态为down时,Device B抢占成为VRRP备份组1的Master,VLAN 2内的主机通过Device B与外界通信。
# 当上行设备或上行链路状态恢复为UP后,查看Device A上的BFD会话。
[DeviceA] display bfd session
Total Session Num: 1 Up Session Num: 1 Init Mode: Active
IPv4 Session Working Under Echo Mode:
LD SourceAddr DestAddr State Holdtime Interface
65 1.1.1.1 1.1.1.2 Up 1932ms XGE3/0/1
以上显示信息表示BFD会话已经恢复。
# 当上行设备或上行链路状态恢复为UP后,显示Device A上备份组的详细信息。
[DeviceA] display vrrp verbose
IPv4 Virtual Router Information:
Running Mode : Standard
Total number of virtual routers : 2
Interface Ten-GigabitEthernet3/0/2
VRID : 1 Adver Timer : 100
Admin Status : Up State : Master
Config Pri : 110 Running Pri : 110
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : 10.1.1.1
Virtual MAC : 0000-5e00-0101
Master IP : 10.1.1.101
VRRP Track Information:
Track Object : 1 State : Positive Pri Reduced : 20
Interface Ten-GigabitEthernet3/0/3
VRID : 2 Adver Timer : 100
Admin Status : Up State : Backup
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 5
Become Master : 3550ms left
Auth Type : None
Virtual IP : 10.1.2.1
Master IP : 10.1.2.102
以上显示信息表示当上行设备或上行链路状态恢复为UP后,Device A在VRRP备份组1中恢复为原来的优先级并抢占成为该备份组的Master,VLAN 2内的主机通过Device A与外界通信。
该案例暂时没有网友评论
✖
案例意见反馈
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作