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:

bgp-igp-metric-tie-breaker.png

  1. Create a topology with 5 routers in a single AS, as shown above.

  2. 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
  3. 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
  4. Configure BGP:

    • Establish iBGP peerings between all routers
    • Advertise 172.16.0.0/24 network from both R4 and R5
    • Use loopback0 as the source for BGP messages on R4 and R5

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.

https://networklessons.com/bgp/bgp-attributes-and-path-selection/