Example for Configuring BGP Auto FRR
Networking Requirements
As shown in Figure 9-35, SwitchA belongs to AS 100; SwitchB, SwitchC, and SwitchD belong to AS 200 and establish IBGP connections. Routes from SwitchA to SwitchD must have backup forwarding information so that traffic can be fast switched to the backup link after a fault is detected. This improves network reliability.
Configuration Roadmap
The configuration roadmap is as follows:
Configure a route-policy on SwitchB and SwitchC to change the MED values of routes to SwitchD to facilitate route selection.
Configure BGP Auto FRR on SwitchA so that traffic can be fast switched to the backup link when a fault is detected.
Procedure
- Configure the VLAN to which each interface belongs.
<HUAWEI> system-view [~HUAWEI] sysname SwitchA [*HUAWEI] commit [~SwitchA] vlan batch 10 20 [*SwitchA] interface 10ge 1/0/1 [*SwitchA-10GE1/0/1] port link-type trunk [*SwitchA-10GE1/0/1] port trunk allow-pass vlan 10 [*SwitchA-10GE1/0/1] quit [*SwitchA] interface 10ge 1/0/2 [*SwitchA-10GE1/0/2] port link-type trunk [*SwitchA-10GE1/0/2] port trunk allow-pass vlan 20 [*SwitchA-10GE1/0/2] quit [*SwitchA] commit
The configurations of SwitchB, SwitchC, and SwitchD are similar to the configuration of SwitchA, and are not provided here.
- Configure VLANIF interfaces and assign IP addresses to the VLANIF interfaces.
[~SwitchA] interface vlanif 10 [*SwitchA-Vlanif10] ip address 10.1.1.1 24 [*SwitchA-Vlanif10] quit [*SwitchA] interface vlanif 20 [*SwitchA-Vlanif20] ip address 10.2.1.1 24 [*SwitchA-Vlanif20] quit [*SwitchA] commit
The configurations of SwitchB, SwitchC, and SwitchD are similar to the configuration of SwitchA, and are not provided here.
- Establish EBGP connections between SwitchA and SwitchB, and between SwitchA and SwitchC, and establish IBGP connections between SwitchD and SwitchB, and between SwitchD and SwitchC.
# Configure SwitchA.
<SwitchA> system-view
[~SwitchA] bgp 100
[*SwitchA-bgp] router-id 1.1.1.1
[*SwitchA-bgp] peer 10.1.1.2 as-number 200
[*SwitchA-bgp] peer 10.2.1.2 as-number 200
[*SwitchA-bgp] commit
The configurations of SwitchB and SwitchC are similar to the configuration of SwitchA, and are not provided here.
# Configure SwitchD.
<SwitchD> system-view
[~SwitchD] bgp 200
[*SwitchD-bgp] router-id 4.4.4.4
[*SwitchD-bgp] peer 10.3.1.1 as-number 200
[*SwitchD-bgp] peer 10.4.1.1 as-number 200
[*SwitchD-bgp] commit
The configurations of SwitchB and SwitchC are similar to the configuration of SwitchD, and are not provided here.
- Configure a route-policy on SwitchB and SwitchC so that routes to SwitchD have different MED values.
# Configure a route-policy on SwitchB.
<SwitchB> system-view
[~SwitchB] route-policy rtb permit node 10
[*SwitchB-route-policy] apply cost 80
[*SwitchB-route-policy] quit
[*SwitchB] bgp 200
[*SwitchB-bgp] ipv4-family unicast
[*SwitchB-bgp-af-ipv4] peer 10.1.1.1 route-policy rtb export
[*SwitchB-bgp-af-ipv4] commit
[~SwitchB-bgp-af-ipv4] quit
# Configure a route-policy on SwitchC.
<SwitchC> system-view
[~SwitchC] route-policy rtc permit node 10
[*SwitchC-route-policy] apply cost 120
[*SwitchC-route-policy] quit
[*SwitchC] bgp 200
[*SwitchC-bgp] ipv4-family unicast
[*SwitchC-bgp-af-ipv4] peer 10.2.1.1 route-policy rtc export
[*SwitchC-bgp-af-ipv4] commit
[~SwitchC-bgp-af-ipv4] quit
# Advertise a route to 4.4.4.4/32 on SwitchD.
[~SwitchD] bgp 200
[*SwitchD-bgp] ipv4-family unicast
[*SwitchD-bgp] network 4.4.4.4 32
[*SwitchD-bgp] commit
# Run the display ip routing-table verbose command on SwitchA to check detailed information about the route to 4.4.4.4/32.
<SwitchA> display ip routing-table 4.4.4.4 32 verbose Route Flags: R - relay, D - download to fib, T - to vpn-instance, B - black hole route ------------------------------------------------------------------------------ Routing Table : _public_ Summary Count : 1 Destination: 4.4.4.4/32 Protocol: EBGP Process ID: 0 Preference: 255 Cost: 80 NextHop: 10.1.1.2 Neighbour: 10.1.1.2 State: Active Adv Age: 00h00m12s Tag: 0 Priority: low Label: NULL QoSInfo: 0x0 IndirectID: 0x4 RelayNextHop: 0.0.0.0 Interface: Vlanif10 TunnelID: 0x0 Flags: D
The MED value of the route learned from SwitchB is smaller. Therefore, SwitchA selects the path SwitchA→SwitchB→SwitchD as the route to 4.4.4.4/32. Because FRR is not configured, no backup forwarding information is available.
- Enable BGP Auto FRR on SwitchA, and check the routing information.
# Enable BGP Auto FRR on SwitchA.
<SwitchA> system-view
[~SwitchA] bgp 100
[~SwitchA-bgp] ipv4-family unicast
[~SwitchA-bgp-af-ipv4] auto-frr
[*SwitchA-bgp-af-ipv4] commit
[~SwitchA-bgp-af-ipv4] quit
# After the configuration, run the display ip routing-table verbose command on SwitchA to check the routing information.
<SwitchA> display ip routing-table 4.4.4.4 32 verbose Route Flags: R - relay, D - download to fib, T - to vpn-instance, B - black hole route ------------------------------------------------------------------------------ Routing Table : _public_ Summary Count : 1 Destination: 4.4.4.4/32 Protocol: EBGP Process ID: 0 Preference: 255 Cost: 80 NextHop: 10.1.1.2 Neighbour: 10.1.1.2 State: Active Adv Age: 00h52m45s Tag: 0 Priority: low Label: NULL QoSInfo: 0x0 IndirectID: 0x4 RelayNextHop: 0.0.0.0 Interface: Vlanif10 TunnelID: 0x0 Flags: D BkNextHop: 10.2.1.2 BkInterface: Vlanif20 BkLabel: NULL SecTunnelID: 0x0 BkPETunnelID: 0x0 BkPESecTunnelID: 0x0 BkIndirectID: 0x2
The preceding command output shows that SwitchA has a backup next hop and a backup outbound interface for the route to 4.4.4.4/32.
Configuration Files
- Configuration file of SwitchA
# sysname SwitchA # vlan batch 10 20 # interface Vlanif10 ip address 10.1.1.1 255.255.255.0 # interface Vlanif20 ip address 10.2.1.1 255.255.255.0 # interface 10GE1/0/1 port link-type trunk port trunk allow-pass vlan 10 # interface 10GE1/0/2 port link-type trunk port trunk allow-pass vlan 20 # bgp 100 router-id 1.1.1.1 peer 10.1.1.2 as-number 200 peer 10.2.1.2 as-number 200 # ipv4-family unicast peer 10.1.1.2 enable peer 10.2.1.2 enable auto-frr # return
- Configuration file of SwitchB
# sysname SwitchB # vlan batch 10 30 # interface Vlanif10 ip address 10.1.1.2 255.255.255.0 # interface Vlanif30 ip address 10.3.1.1 255.255.255.0 # interface 10GE1/0/1 port link-type trunk port trunk allow-pass vlan 10 # interface 10GE1/0/2 port link-type trunk port trunk allow-pass vlan 30 # bgp 200 router-id 2.2.2.2 peer 10.1.1.1 as-number 100 peer 10.3.1.2 as-number 200 # ipv4-family unicast peer 10.1.1.1 enable peer 10.3.1.2 enable peer 10.1.1.1 route-policy rtb export # route-policy rtb permit node 10 apply cost 80 # return
- Configuration file of SwitchC
# sysname SwitchC # vlan batch 20 40 # interface Vlanif20 ip address 10.2.1.2 255.255.255.0 # interface Vlanif40 ip address 10.4.1.1 255.255.255.0 # interface 10GE1/0/1 port link-type trunk port trunk allow-pass vlan 20 # interface 10GE1/0/2 port link-type trunk port trunk allow-pass vlan 40 # bgp 200 router-id 3.3.3.3 peer 10.2.1.1 as-number 100 peer 10.4.1.2 as-number 200 # ipv4-family unicast peer 10.2.1.1 enable peer 10.4.1.2 enable peer 10.2.1.1 route-policy rtc export # route-policy rtc permit node 10 apply cost 120 # return
- Configuration file of SwitchD
# sysname SwitchD # vlan batch 30 40 # interface Vlanif30 ip address 10.3.1.2 255.255.255.0 # interface Vlanif40 ip address 10.4.1.2 255.255.255.0 # interface LoopBack1 ip address 4.4.4.4 255.255.255.255 # interface 10GE1/0/1 port link-type trunk port trunk allow-pass vlan 30 # interface 10GE1/0/2 port link-type trunk port trunk allow-pass vlan 40 # bgp 200 router-id 4.4.4.4 peer 10.3.1.1 as-number 200 peer 10.4.1.1 as-number 200 # ipv4-family unicast peer 10.3.1.1 enable peer 10.4.1.1 enable network 4.4.4.4 255.255.255.255 # return