如上图,SW1和SW2组成vrrp,SW1为master,vrrp虚地址为30::10/64。部分接口改为路由口防止环路了。在此组网中可以实现,当SW1上行口g1/0/1链路中断后,路由切换至备份链路上,SW4访问vlan30下的终端用户经由SW1。若SW2上行口G1/0/2链路中断,路由切换至备份链路。
一、各个设备上的主要配置(地址配置略)
SW1:
interface Vlan-interface30
ipv6 address FE80::1 link-local
ipv6 address 30::1/64
undo ipv6 nd ra halt
vrrp ipv6 vrid 1 virtual-ip FE80::10 link-local
vrrp ipv6 vrid 1 virtual-ip 30::10
vrrp ipv6 vrid 1 priority 110
ipv6 route-static :: 0 100::2 preference 65
ipv6 route-static :: 0 30::2 preference 70
ipv6 route-static :: 0 3::3 bfd control-packet bfd-source 1::1
ipv6 route-static 3::3 128 10::2 preference 100
SW2:
interface Vlan-interface30
ipv6 address FE80::2 link-local
ipv6 address 30::2/64
vrrp ipv6 vrid 1 virtual-ip FE80::19 link-local
vrrp ipv6 vrid 1 virtual-ip 30::10
ipv6 route-static :: 0 200::2 preference 65
ipv6 route-static 0::0 0 30::1 preference 70
ipv6 route-static :: 0 3::3 bfd control-packet bfd-source 2::2
ipv6 route-static 3::3 128 20::2 preference 100
SW3:
ipv6 route-static 1::1 128 10::1
ipv6 route-static 2::2 128 20::1
ipv6 route-static 3::3 128 40::2
ipv6 route-static 30:: 64 10::1
ipv6 route-static 30:: 64 20::1
ipv6 route-static 100:: 64 10::1
ipv6 route-static 200:: 64 20::1
SW4:
ipv6 route-static :: 0 100::1 preference 65
ipv6 route-static :: 0 200::1 preference 75
ipv6 route-static :: 0 1::1 bfd control-packet bfd-source 3::3
ipv6 route-static :: 0 2::2 bfd control-packet bfd-source 3::3 preference 70
ipv6 route-static 1::1 128 40::1 preference 100
ipv6 route-static 2::2 128 40::1 preference 100
二、路由切换效果
1、配置完成后,SW1、SW2、SW4上的路由表如下,仅列出非直连的。可以看到,vrrp虚接口只在当前master上生效。
[SW1]dis ipv6 routing-table
Destinations : 13 Routes : 13
Destination: ::/0 Protocol : Static
NextHop : 3::3 Preference: 60
Interface : Vlan10 Cost : 0
Destination: 3::3/128 Protocol : Static
NextHop : 10::2 Preference: 100
Interface : Vlan10 Cost : 0
[SW2]dis ipv6 routing-table
Destinations : 12 Routes : 12
Destination: ::/0 Protocol : Static
NextHop : 3::3 Preference: 60
Interface : Vlan20 Cost : 0
Destination: 3::3/128 Protocol : Static
NextHop : 20::2 Preference: 100
Interface : Vlan20 Cost : 0
[SW4]dis ipv6 routing-table
Destinations : 13 Routes : 13
Destination: ::/0 Protocol : Static
NextHop : 1::1 Preference: 60
Interface : Vlan40 Cost : 0
Destination: 1::1/128 Protocol : Static
NextHop : 40::1 Preference: 100
Interface : Vlan40 Cost : 0
Destination: 2::2/128 Protocol : Static
NextHop : 40::1 Preference: 100
Interface : Vlan40 Cost : 0
各个bfd会话如下:
2、SW1上行口shutdown后,BFD会话down,路由表如下。这时SW1由备份链路访问SW4,反之亦然。
[SW1]dis ipv6 routing-table
Destinations : 10 Routes : 10
Destination: ::/0 Protocol : Static
NextHop : 100::2 Preference: 65
Interface : GE1/0/2 Cost : 0
[SW2]dis ipv6 routing-table
Destinations : 12 Routes : 12
Destination: ::/0 Protocol : Static
NextHop : 3::3 Preference: 60
Interface : Vlan20 Cost : 0
Destination: 3::3/128 Protocol : Static
NextHop : 20::2 Preference: 100
Interface : Vlan20 Cost : 0
[SW4]dis ipv6 routing-table
Destinations : 13 Routes : 13
Destination: ::/0 Protocol : Static
NextHop : 100::1 Preference: 65
Interface : GE1/0/2 Cost : 0
Destination: 1::1/128 Protocol : Static
NextHop : 40::1 Preference: 100
Interface : Vlan40 Cost : 0
Destination: 2::2/128 Protocol : Static
NextHop : 40::1 Preference: 100
Interface : Vlan40 Cost : 0
3、SW2上行口shutdown后,BFD会话down,路由表如下。SW2由备份链路访问SW4。
[SW1]dis ipv6 routing-table
Destinations : 10 Routes : 10
Destination: ::/0 Protocol : Static
NextHop : 100::2 Preference: 65
Interface : GE1/0/2 Cost : 0
[SW2]dis ipv6 routing-table
Destinations : 9 Routes : 9
Destination: ::/0 Protocol : Static
NextHop : 200::2 Preference: 65
Interface : GE1/0/1 Cost : 0
[SW4]dis ipv6 routing-table
Destinations : 13 Routes : 13
Destination: ::/0 Protocol : Static
NextHop : 100::1 Preference: 65
Interface : GE1/0/2 Cost : 0
Destination: 1::1/128 Protocol : Static
NextHop : 40::1 Preference: 100
Interface : Vlan40 Cost : 0
Destination: 2::2/128 Protocol : Static
NextHop : 40::1 Preference: 100
Interface : Vlan40 Cost : 0
4、SW1到SW4备份链路shutdown后,路由表如下。这时SW1经由SW2访问SW4。
[SW1]dis ipv6 routing-table
Destinations : 8 Routes : 8
Destination: ::/0 Protocol : Static
NextHop : 30::2 Preference: 70
Interface : Vlan30 Cost : 0
[SW2]dis ipv6 routing-table
Destinations : 9 Routes : 9
Destination: ::/0 Protocol : Static
NextHop : 200::2 Preference: 65
Interface : GE1/0/1 Cost : 0
[SW4]dis ipv6 routing-table
Destinations : 11 Routes : 11
Destination: ::/0 Protocol : Static
NextHop : 200::1 Preference: 75
Interface : GE1/0/1 Cost : 0
Destination: ::1/128 Protocol : Direct
NextHop : ::1 Preference: 0
Interface : InLoop0 Cost : 0
Destination: 1::1/128 Protocol : Static
NextHop : 40::1 Preference: 100
Interface : Vlan40 Cost : 0
Destination: 2::2/128 Protocol : Static
NextHop : 40::1 Preference: 100
Interface : Vlan40 Cost : 0
5、SW1到SW4备份链路恢复,SW2到SW4的备份链路down,路由表如下。这时SW2经由SW1访问SW4。
[SW1]dis ipv6 routing-table
Destinations : 10 Routes : 10
Destination: ::/0 Protocol : Static
NextHop : 100::2 Preference: 65
Interface : GE1/0/2 Cost : 0
[SW2]dis ipv6 routing-table
Destinations : 7 Routes : 7
Destination: ::/0 Protocol : Static
NextHop : 30::1 Preference: 70
Interface : Vlan30 Cost : 0
[SW4]dis ipv6 routing-table
Destinations : 11 Routes : 11
Destination: ::/0 Protocol : Static
NextHop : 100::1 Preference: 65
Interface : GE1/0/2 Cost : 0
Destination: ::1/128 Protocol : Direct
NextHop : ::1 Preference: 0
Interface : InLoop0 Cost : 0
Destination: 1::1/128 Protocol : Static
NextHop : 40::1 Preference: 100
Interface : Vlan40 Cost : 0
Destination: 2::2/128 Protocol : Static
NextHop : 40::1 Preference: 100
Interface : Vlan40 Cost : 0
1、注意BFD多跳检测中,静态路由的配置是需要迭代的,双方的源目地址要对应。
2、VRRP组网中,virtual ip只在master设备上生效,这时如果BFD的源选择了此虚地址,会造成BFD会话master侧up,backup侧down。
3、切换主备路由时要注意配置的各个路由的优先级。
该案例暂时没有网友评论
✖
案例意见反馈
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作