配置动态BFD检测IPv6静态路由示例
利用动态BFD检测IPv6静态路由,可以快速检测链路故障。
组网需求
如图4-3所示,DeviceA通过SwithC和DeviceB相连。在DeviceA上配置静态缺省路由可以与外部进行正常通信。在DeviceA和DeviceB之间配置BFD会话检测链路是否发生故障。
操作步骤
- 配置各接口IPv6地址(略)
- 配置IPv6静态路由
# 在DeviceA上配置到2001:db8:8::1/64的静态路由。
[~DeviceA] ipv6 route-static 2001:db8:8:: 64 2001:db8:200::2
[*DeviceA] commit
# 在DeviceA上查看IPv6路由表,静态路由存在于路由表中。
[~DeviceA] display ipv6 routing-table
Routing Table : _public_ Destinations : 6 Routes : 6 Destination : 2001:db8:7:: PrefixLength : 64 NextHop : 2001:db8:7::1 Preference : 0 Cost : 0 Protocol : Direct RelayNextHop : :: TunnelID : 0x0 Interface : GigabitEthernet0/2/0 Flags : D Destination : 2001:db8:7::1 PrefixLength : 128 NextHop : ::1 Preference : 0 Cost : 0 Protocol : Direct RelayNextHop : :: TunnelID : 0x0 Interface : GigabitEthernet0/2/0 Flags : D Destination : 2001:db8:8:: PrefixLength : 64 NextHop : 2001:db8:200::2 Preference : 60 Cost : 0 Protocol : Static RelayNextHop : 2001:db8:200::2 TunnelID : 0x0 Interface : GigabitEthernet0/1/0 Flags : RD Destination : 2001:db8:200:: PrefixLength : 64 NextHop : 2001:db8:200::1 Preference : 0 Cost : 0 Protocol : Direct RelayNextHop : :: TunnelID : 0x0 Interface : GigabitEthernet0/1/0 Flags : D Destination : 2001:db8:200::1 PrefixLength : 128 NextHop : ::1 Preference : 0 Cost : 0 Protocol : Direct RelayNextHop : :: TunnelID : 0x0 Interface : GigabitEthernet0/1/0 Flags : D Destination : FE80:: PrefixLength : 10 NextHop : :: Preference : 0 Cost : 0 Protocol : Direct RelayNextHop : :: TunnelID : 0x0 Interface : NULL0 Flags : D
# 在DeviceB上配置到2001:db8:7::1/64的静态路由。
[~DeviceB] ipv6 route-static 2001:db8:7:: 64 2001:db8:200::1
[*DeviceB] commit
- 配置动态BFD检测静态路由
# 在DeviceA上配置静态路由绑定BFD会话。
[~DeviceA] bfd
[*DeviceA-bfd] quit
[*DeviceA] ipv6 route-static bfd 2001:db8:200::2 local-address 2001:db8:200::1
[*DeviceA] ipv6 route-static 2001:db8:8:: 64 2001:db8:200::2 bfd enable
[*DeviceA] commit
# 在DeviceB上配置静态路由绑定BFD会话。
[~DeviceB] bfd
[*DeviceB-bfd] quit
[*DeviceB] ipv6 route-static bfd 2001:db8:200::1 local-address 2001:db8:200::2
[*DeviceB] ipv6 route-static 2001:db8:7:: 64 2001:db8:200::1 bfd enable
[*DeviceB] commit
- 验证配置结果
# 配置完成后,在DeviceA和DeviceB上可以看到BFD会话已经建立,且状态为Up,而且可以看到静态路由已经绑定BFD会话。
以DeviceA上的显示为例。
[~DeviceA] display bfd session all verbose
(w): State in WTR (*): State is invalid ------------------------------------------------------------------------------ (Multi Hop) State : Up Name : dyn_16385 ------------------------------------------------------------------------------ Local Discriminator : 16385 Remote Discriminator : 16385 Session Detect Mode : Asynchronous Mode Without Echo Function BFD Bind Type : Peer IP Address Bind Session Type : Dynamic Bind Peer IP Address : 2001:db8:200::2 Bind Interface : - Bind Source IP Address : 2001:db8:200::1 FSM Board Id : 3 TOS-EXP : 7 Min Tx Interval (ms) :50 Min Rx Interval (ms) :50 Actual Tx Interval (ms): 50 Actual Rx Interval (ms): 50 Local Detect Multi : 3 Detect Interval (ms) : 150 Echo Passive : Disable Acl Number : - Destination Port : 4784 TTL : 253 Proc Interface Status : Disable Process PST : Disable WTR Interval (ms) : 0 Local Demand Mode : Disable Active Multi : 3 Last Local Diagnostic : No Diagnostic Bind Application : STATICRTV6 Session TX TmrID : 0 Session Detect TmrID : 0 Session Init TmrID : - Session WTR TmrID : - Session Echo Tx TmrID : - Session Description : - ------------------------------------------------------------------------------ Total UP/DOWN Session Number : 1/0
配置文件
DeviceA的配置文件
# sysname DeviceA # bfd # interface GigabitEthernet0/1/0 undo shutdown ipv6 enable ipv6 address 2001:db8:200::1/64 # interface GigabitEthernet0/2/0 undo shutdown ipv6 enable ipv6 address 2001:db8:7::1/64 # ipv6 route-static bfd 2001:db8:200::2 local-address 2001:db8:200::1 ipv6 route-static 2001:db8:8:: 64 2001:db8:200::2 bfd enable # return
DeviceB的配置文件
# sysname DeviceB # bfd # interface GigabitEthernet0/1/0 undo shutdown ipv6 enable ipv6 address 2001:db8:200::2/64 # interface GigabitEthernet0/2/0 undo shutdown ipv6 enable ipv6 address 2001:db8:8::1/64 # ipv6 route-static bfd 2001:db8:200::1 local-address 2001:db8:200::2 ipv6 route-static 2001:db8:7:: 64 2001:db8:200::1 bfd enable # return