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 10.0.0.1/32 is directly connected to R1, so no matter what, it will take the directly connected path. However, R2 will learn about the 10.0.0.1/32 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 10.0.0.1/32 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 10.0.0.1 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 10.0.0.1/32 is directly connected, Loopback1

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

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

(10.1.34.2 is the IGP neighbor advertising this prefix):


BGP table version is 2, local router ID is 192.168.0.3
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
* 10.0.0.1/32 10.1.13.1 0 0 100 i
*> 10.1.34.2 11 32768 i

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

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

R2 (show ip route):

B 10.0.0.1/32 [20/0] via 10.1.13.1, 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> 10.0.0.1/32 10.1.13.1 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.

Share/Save/Bookmark

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.