Abstraction, Layering, and a little Anycast

Ok, so the post from yesterday asked you to look at a diagram and determine where a packet would route and why it might take that path. Hopefully some of you have had a chance to lab it up to test any theories you have. Even if you haven’t we can still have a look and draw some logical conclusions.

We know from the diagram that is directly connected to R1, so no matter what, it will take the directly connected path. However, R2 will learn about the prefix via IGP (OSPF) and EGP (BGP). The default eBGP administrative distance is 20, whereas OSPF is 110. My initial thought is that if R2 learns about via eBGP as well as OSPF, eBGP will be preferred because of the lower AD. To some extent this is true. If you choose to not advertise the prefix to eBGP neighbors, then it will be preferred via eBGP. However, once you include the network statement, it will choose the IGP path.

Here are some outputs:

R1 (show ip route):

C is directly connected, Loopback1

R2 (show ip route, show ip bgp, show run):

O [110/11] via, 09:14:11, Ethernet0/1

( is the IGP neighbor advertising this prefix):

BGP table version is 2, local router ID is
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal, r RIB-failure, S Stale
Origin codes: i – IGP, e – EGP, ? – incomplete

Network Next Hop Metric LocPrf Weight Path
* 0 0 100 i
*> 11 32768 i

router bgp 200
no synchronization
bgp log-neighbor-changes
network mask
neighbor remote-as 100
no auto-summary

Watch what happens when I remove the ‘network’ statement:

R2 (show ip route):

B [20/0] via, 00:00:06

It’s being learned via eBGP!

This could be a problem depending on whether you want to advertise this prefix to your eBGP neighbors. You can use the network backdoor command so the router will prefer IGP learned routes over eBGP learned routes, but this command will not advertise the network to your eBGP neighbors. You’ll get a rib-failure – shown below in the output from show ip bgp:

Network Next Hop Metric LocPrf Weight Path
r> 0 0 100 i

When designing networks, you must have deep knowledge of how protocols operate and interact with other protocols. The BGP/IGP interaction is one of these, and this is just a small example.


One thought on “Abstraction, Layering, and a little Anycast

  1. Hello Ryan , There is no need for the network statement on R2 to advertised the prefix further more to a R2's eBGP peer.Dan


Comments are closed.

%d bloggers like this: