In Figure 1, SwitchA and SwitchB connect to each other. An IPv6 static route to SwitchB needs to be configured on SwitchA. It is required that fast fault detection be implemented on SwitchA and the IPv6 routing table of SwitchA be updated in a timely manner.
The configuration roadmap is as follows:
Configure a BFD session between SwitchA and SwitchB for fast fault detection on SwitchA.
Configure an IPv6 static route from SwitchA to SwitchB and bind the static route to the BFD session so that SwitchA can update its IPv6 routing table after a fault is detected.
# Configure SwitchA. The configuration of SwitchB is similar to that of SwitchA.
<HUAWEI> system-view [HUAWEI] sysname SwitchA [SwitchA] ipv6 [SwitchA] interface GigabitEthernet 0/0/1 [SwitchA-GigabitEthernet0/0/1] undo portswitch [SwitchA-GigabitEthernet0/0/1] ipv6 enable [SwitchA-GigabitEthernet0/0/1] ipv6 address fc00::1 64 [SwitchA-GigabitEthernet0/0/1] quit
# On SwitchA, create a BFD session with SwitchB.
[SwitchA] bfd [SwitchA-bfd] quit [SwitchA] bfd aa bind peer-ipv6 fc00::2 [SwitchA-bfd-session-aa] discriminator local 10 [SwitchA-bfd-session-aa] discriminator remote 20 [SwitchA-bfd-session-aa] commit [SwitchA-bfd-session-aa] quit
# On SwitchB, create a BFD session with SwitchA.
[SwitchB] bfd [SwitchB-bfd] quit [SwitchB] bfd bb bind peer-ipv6 fc00::1 [SwitchB-bfd-session-bb] discriminator local 20 [SwitchB-bfd-session-bb] discriminator remote 10 [SwitchB-bfd-session-bb] commit [SwitchB-bfd-session-bb] quit
# On SwitchA, configure a default static route to SwitchB and bind the route to the BFD session named aa.
[SwitchA] ipv6 route-static 0::0 0 fc00::2 track bfd-session aa
# After the configuration is complete, run the display bfd session all command on SwitchA and SwitchB. The display on SwitchA is used as an example:
[SwitchA] display bfd session all -------------------------------------------------------------------------------- Local Remote PeerIpAddr State Type InterfaceName -------------------------------------------------------------------------------- 10 20 FC00::2 Up S_IP_PEER - -------------------------------------------------------------------------------- Total UP/DOWN Session Number : 1/0
The command output shows that the BFD session has been established and is Up. Run the display current-configuration | include bfd command in the system view on SwitchA. The command output shows that the default static route has been bound to the BFD session.
[SwitchA] display current-configuration | include bfd bfd bfd aa bind peer-ipv6 FC00::2 ipv6 route-static :: 0 FC00::2 track bfd-session aa
# Check the IPv6 routing table on SwitchA. The command output shows that the default static route exists in the routing table.
[SwitchA] display ipv6 routing-table Routing Table : Public Destinations : 5 Routes : 5 Destination : :: PrefixLength : 0 NextHop : FC00::2 Preference : 60 Cost : 0 Protocol : Static RelayNextHop : :: TunnelID : 0x0 Interface : GigabitEthernet0/0/1 Flags : RD Destination : ::1 PrefixLength : 128 NextHop : ::1 Preference : 0 Cost : 0 Protocol : Direct RelayNextHop : :: TunnelID : 0x0 Interface : InLoopBack0 Flags : D Destination : FC00:: PrefixLength : 64 NextHop : FC00::1 Preference : 0 Cost : 0 Protocol : Direct RelayNextHop : :: TunnelID : 0x0 Interface : GigabitEthernet0/0/1 Flags : D Destination : FC00::1 PrefixLength : 128 NextHop : ::1 Preference : 0 Cost : 0 Protocol : Direct RelayNextHop : :: TunnelID : 0x0 Interface : GigabitEthernet0/0/1 Flags : D Destination : FE80:: PrefixLength : 10 NextHop : :: Preference : 0 Cost : 0 Protocol : Direct RelayNextHop : :: TunnelID : 0x0 Interface : NULL0 Flags : D
# Run the shutdown command on GE0/0/1 of SwitchB to simulate a link fault.
[SwitchB] interface GigabitEthernet 0/0/1
[SwitchB-GigabitEthernet0/0/1] shutdown
# Check the IPv6 routing table on SwitchA. The command output shows that the default static route 0::0/0 does not exist. This is because the default static route has been bound to a BFD session, and BFD immediately notifies that the bound static route becomes unavailable after detecting a link fault.
[SwitchA] display ipv6 routing-table Routing Table : Public Destinations : 1 Routes : 1 Destination : ::1 PrefixLength : 128 NextHop : ::1 Preference : 0 Cost : 0 Protocol : Direct RelayNextHop : :: TunnelID : 0x0 Interface : InLoopBack0 Flags : D
SwitchA configuration file
#
sysname SwitchA
#
ipv6
#
bfd
#
interface GigabitEthernet0/0/1
undo portswitch
ipv6 enable
ipv6 address FC00::1/64
#
bfd aa bind peer-ipv6 FC00::2
discriminator local 10
discriminator remote 20
commit
#
ipv6 route-static :: 0 FC00::2 track bfd-session aa
#
return
SwitchB configuration file
#
sysname SwitchB
#
ipv6
#
bfd
#
interface GigabitEthernet0/0/1
undo portswitch
ipv6 enable
ipv6 address FC00::2/64
#
bfd bb bind peer-ipv6 FC00::1
discriminator local 20
discriminator remote 10
commit
#
return