BGP Path Selection Using IGP Metric as Tiebreaker
To demonstrate BGP path selection using IGP metric as a tiebreaker (attribute 8), you can set up a lab with the following configuration:
-
Create a topology with 5 routers in a single AS, as shown above.
-
Configure basic setup:
- Deploy OSPF as the underlying IGP between all routers
- Ensure all inter-router networks are advertised in OSPF
- Wait for OSPF convergence
-
Configure target networks:
- Create loopback1 interfaces on R4 and R5 with 172.16.0.1/24
- Create loopback0 interfaces on R4 (4.4.4.4/32) and R5 (5.5.5.5/32) for BGP source
-
Configure BGP:
By default, R1 will learn the 172.16.0.0/24 network via iBGP and select the best path based on the lowest router ID of the iBGP peer (R4 will be chosen due to lower router ID).
However, the IGP metric attribute is tested before the lowest next-hop ID. To test IGP metric influence on path selection:
- Modify OSPF interface costs to change metrics for different paths.
- This will trigger attribute 8 in the BGP path selection algorithm.
- The path with the lowest IGP metric to reach the BGP next-hop will be selected.
Links
https://networklessons.com/bgp/bgp-attributes-and-path-selection/