cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
7909
Views
10
Helpful
19
Replies

bgp to eigrp redistribution, block locally originated

joe.lazzaro
Level 4
Level 4

Long time reader, first time poster..

I redistribute our MPLS eBGP routes into our internal EIGRP process at each site. This action undesirably redistributes locally generated BGP networks (via network command) that are meant from the MPLS cloud into our internal routing process.

I currently have a route-map on my 'redistribute bgp' command that filters each network manually with an ACL. This works but adds obvious administrative overhead; each WAN router advertises different networks, and the ACL must be updated for each new network.

Would it make more sense to simply deny routes from BGP to EIGRP with a metric of 32768? Something like this:

route-map deny-local-bgp deny 10
match metric 32768
route-map deny-local-bgp permit 20

router eigrp 100
redistribute bgp 65104 route-map deny-local-bgp

Are there any caveats using this method, or are there any other suggestions for denying these routes into EIGRP?

Thanks,

Joe

19 Replies 19

Hi Lei,

another case of  "It's not a bug, it's a feature!" by Cisco, I guess :-)

I have not found that documented anywhere (no book, RFC, CCO document).

Some documents even say: "When BGP is redistributed into an IGP, only eBGP learned routes get redistributed." (.. by default)

See http://www.cisco.com/en/US/customer/tech/tk365/technologies_tech_note09186a00800943c5.shtml#un , e.g.

So it was a very surprising behavior for me.

BR,

Milan

Hi Milan,

I cannot comment on how other vendors implement the redistribution, but if you consider null 0 as a connected interface then that behavior makes more sense. The redistribution rule #2, indirect redistribute connected routes, is mentioned in this doc.

http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a008009487e.shtml

Regards,

Lei Tian

Hi Lei,

yes, it's mentioned there.

But followed by the confusing: "Note: By default, only EBGP-learned information is candidate to be redistributed into IGP when the redistibute bgp command is issued."

I found an explanation in the Alex Zinin's excellent book Cisco IP Routing: Packet Forwarding and Intra-domain Routing Protocols.

It says in Chapter 7.4.:

"The logic implemented in this function is as follows.
1.  If a route is directly connected, perform the following steps.
a. If the route is covered by a network statement of the redistributing protocol, it is announced as internal to that protocol and is not redistributed.
b. Otherwise, if an explicit redistribute connected or a redistribute static command is configured and the route is not filtered out by a corresponding distribute list, it is accepted for redistribution.
c. Otherwise, if the route is covered by a network statement of a redistributed protocol and is not filtered by a distribute list specific for redistribution out of this protocol, the route is accepted for redistribution.
d. Otherwise, the directly connected route is not redistributed.
2.  If the route is not directly connected, it is redistributed only when there is a corresponding redistribute statement for the route source and the route is not filtered by a corresponding distribute list."

It's also important to differentiate between "Connected" and "Directly connected". So far I was mixing these terms.

The book says in Chater 4.1.:

"Directly attached networks are major networks or subnets connected to a router's interfaces and known to the router from assigned IP addresses and corresponding subnet masks. These routes are always displayed with the C (connected) code in the output of the show ip route command (see Listing 4-1). In this book, we call these routes interface routes, or connected routes. We also refer to the source of these routes as Connected.

Directly connected routes reference only interfaces without next-hop addresses; that is, this term indicates the amount of next-hop information rather than the route source. Such routes can be identified by the is directly connected to phrase in the routing table (see Listing 4-1 again). The only two sources that can supply directly connected routes are Connected, providing routes to directly attached networks, and Static."

So I added a static route pointing to an interface (not Null 0) to my router config.

As expected, the prefix started to be redistributed to EIGRP when I added the network command for that subnet to the BGP config part.

Another interesting question came to my mind:

What happens when two routing protocols would use the network command this way and both would be redistributed to another protocol?

So I added OSPF to my router config and configured network command covering the static route described above.

The EIGRP topo remained unchanged, showing only the prefix redistributed from BGP.

But when I removed the network command from BGP, the EIGRP topo started to show the prefix redistributed from OSPF!!

Was administrative distance used to chose BGP prefix only for redistribution to EIGRP? If yes, what's the local BGP AD? I found eBGP and iBGP AD only on the CCO.

I'm getting lost with the complexity here :-(

Definitely, I'll read the Zinin;'s book once more!

BR,

Milan

That statics pointing to an interface instead of an IP address are redistributed is also the case with distance vector routing protocols. Take for example EIGRP. If you have a static pointing to an interface instead of an IP address it is treated as directly connected and therefore advertised if you have a network statement for that static. If you then redistribute EIGRP into OSPF the static will also be advertised to OSPF.

See also this interesting thread about this behavior:

https://supportforums.cisco.com/thread/2001720

Hi,

yes, the problem is very similar,  thanks for the link.

But IMHO, this behavior is not limited to distance vector routing protocols, seems to be a general IOS feature.

BR,

Milan