IPv6 BGP FRR configuration example

Network requirements

As shown in Figure 87, configure BGP FRR so that when Link B fails, BGP uses Link A to forward traffic.

Figure 87: Network diagram

Configuration procedure

  1. Configure IPv6 addresses for interfaces. (Details not shown.)

  2. Configure OSPFv3 in AS 200 to ensure connectivity among Switch B, Switch C, and Switch D. (Details not shown.)

  3. Configure BGP connections:

    # Configure Switch A to establish EBGP sessions to Switch B and Switch C, and advertise network 1::/64.

    <SwitchA> system-view
    [SwitchA] bgp 100
    [SwitchA] router-id 1.1.1.1
    [SwitchA-bgp-default] peer 3001::2 as-number 200
    [SwitchA-bgp-default] peer 2001::2 as-number 200
    [SwitchA-bgp-default] address-family ipv6 unicast
    [SwitchA-bgp-default-ipv6] peer 3001::2 enable
    [SwitchA-bgp-default-ipv6] peer 2001::2 enable
    [SwitchA-bgp-default-ipv6] network 1:: 64
    [SwitchA-bgp-default-ipv6] quit
    [SwitchA-bgp-default] quit
    

    # Configure Switch B to establish an EBGP session to Switch A, and an IBGP session to Switch D.

    <SwitchB> system-view
    [SwitchB] bgp 200
    [SwitchB] router-id 2.2.2.2
    [SwitchB-bgp-default] peer 3001::1 as-number 100
    [SwitchB-bgp-default] peer 3002::2 as-number 200
    [SwitchB-bgp-default] address-family ipv6 unicast
    [SwitchB-bgp-default-ipv6] peer 3001::1 enable
    [SwitchB-bgp-default-ipv6] peer 3002::2 enable
    [SwitchB-bgp-default-ipv6] peer 3002::2 next-hop-local
    [SwitchB-bgp-default-ipv6] quit
    [SwitchB-bgp-default] quit
    

    # Configure Switch C to establish an EBGP session to Switch A, and an IBGP session to Switch D.

    <SwitchC> system-view
    [SwitchC] bgp 200
    [SwitchC] router-id 3.3.3.3
    [SwitchC-bgp-default] peer 2001::1 as-number 100
    [SwitchC-bgp-default] peer 2002::2 as-number 200
    [SwitchC-bgp-default] address-family ipv6 unicast
    [SwitchC-bgp-default-ipv6] peer 2001::1 enable
    [SwitchC-bgp-default-ipv6] peer 2002::2 enable
    [SwitchC-bgp-default-ipv6] peer 2002::2 next-hop-local
    [SwitchC-bgp-default-ipv6] quit
    [SwitchC-bgp-default] quit
    

    # Configure Switch D to establish IBGP sessions to Switch B and Switch C, and advertise network 4::/64.

    <SwitchD> system-view
    [SwitchD] bgp 200
    [SwitchD-bgp-default] peer 3002::1 as-number 200
    [SwitchD-bgp-default] peer 2002::1 as-number 200
    [SwitchD-bgp-default] address-family ipv6 unicast
    [SwitchD-bgp-default-ipv6] peer 3002::1 enable
    [SwitchD-bgp-default-ipv6] peer 2002::1 enable
    [SwitchD-bgp-default-ipv6] network 4:: 64
    [SwitchD-bgp-default-ipv6] quit
    [SwitchD-bgp-default] quit
    
  4. Configure preferred values so Link B is used to forward traffic between Switch A and Switch D:

    # Configure Switch A to set the preferred value to 100 for routes received from Switch B.

    [SwitchA-bgp-default-ipv6] peer 3001::2 preferred-value 100
    [SwitchA-bgp-default-ipv6] quit
    [SwitchA-bgp-default] quit
    

    # Configure Switch D to set the preferred value to 100 for routes received from Switch B.

    [SwitchD-bgp-default-ipv6] peer 3002::1 preferred-value 100
    [SwitchD-bgp-default-ipv6] quit
    [SwitchD-bgp-default] quit
    
  5. Configure BGP FRR:

    # On Switch A, create routing policy frr to set a backup next hop 2001::2 (Switch C) for the route destined for 4::/64.

    <SwitchA> system-view
    [SwitchA] ipv6 prefix-list abc index 10 permit 4:: 64
    [SwitchA] route-policy frr permit node 10
    [SwitchA-route-policy] if-match ipv6 address prefix-list abc
    [SwitchA-route-policy] apply ipv6 fast-reroute backup-nexthop 2001::2
    [SwitchA-route-policy] quit
    

    # Apply the routing policy to BGP FRR for BGP IPv6 unicast address family.

    [SwitchA] bgp 100
    [SwitchA-bgp-default] address-family ipv6 unicast
    [SwitchA-bgp-default-ipv6] fast-reroute route-policy frr
    [SwitchA-bgp-default-ipv6] quit
    [SwitchA-bgp-default] quit
    

    # On Switch D, create routing policy frr to set a backup next hop 2002::1 (Switch C) for the route destined for 1::/64.

    <SwitchD> system-view
    [SwitchD] ipv6 prefix-list abc index 10 permit 1:: 64
    [SwitchD] route-policy frr permit node 10
    [SwitchD-route-policy] if-match ipv6 address prefix-list abc
    [SwitchD-route-policy] apply ipv6 fast-reroute backup-nexthop 2002::1
    [SwitchD-route-policy] quit
    

    # Apply the routing policy to BGP FRR for BGP IPv6 unicast address family.

    [SwitchD] bgp 200
    [SwitchD-bgp-default] address-family ipv6 unicast
    [SwitchD-bgp-default-ipv6] fast-reroute route-policy frr
    [SwitchD-bgp-default-ipv6] quit
    [SwitchD-bgp-default] quit
    

Verifying the configuration

# Display detailed information about the route to 4::/64 on Switch A. The output shows the backup next hop for the route.

[SwitchA] display ipv6 routing-table 4:: 64 verbose

Summary count : 1

Destination: 4::/64
   Protocol: BGP4+           Process ID: 0
  SubProtID: 0x2                    Age: 00h00m58s
       Cost: 0               Preference: 255
      IpPre: N/A             QosLocalID: N/A
        Tag: 0                    State: Active Adv
  OrigTblID: 0x0                OrigVrf: default-vrf
    TableID: 0xa                 OrigAs: 200
      NibID: 0x25000003          LastAs: 200
     AttrID: 0x3               Neighbor: 3001::2
      Flags: 0x10060        OrigNextHop: 3001::2
      Label: NULL           RealNextHop: 3001::2
    BkLabel: NULL             BkNextHop: 2001::2
  Tunnel ID: Invalid          Interface: Vlan-interface 100
BkTunnel ID: Invalid        BkInterface: Vlan-interface 200
   FtnIndex: 0x0

# Display detailed information about the route to 1::/64 on Switch D. The output shows the backup next hop for the route.

[SwitchD] display ipv6 routing-table 1:: 64 verbose

Summary count : 1

Destination: 1::/64
   Protocol: BGP4+           Process ID: 0
  SubProtID: 0x1                    Age: 00h03m24s
       Cost: 0               Preference: 255
      IpPre: N/A             QosLocalID: N/A
        Tag: 0                    State: Active Adv
  OrigTblID: 0x0                OrigVrf: default-vrf
    TableID: 0xa                 OrigAs: 100
      NibID: 0x25000003          LastAs: 100
     AttrID: 0x4               Neighbor: 3002::1
      Flags: 0x10060        OrigNextHop: 3002::1
      Label: NULL           RealNextHop: 3002::1
    BkLabel: NULL             BkNextHop: 2002::1
  Tunnel ID: Invalid          Interface: Vlan-interface 101
BkTunnel ID: Invalid        BkInterface: Vlan-interface 201
   FtnIndex: 0x0