Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Community Member

BGP Question - Static Routes

I have a customer that we configured over our MPLS backbone. I don't spend enough time in the BGP realm to claim to be an expert. When using EIGRP and static routes, its only necessary under the router eigrp statement to list the directly connected subnets and the redistribute the statics. I found out today with BGP, that you list the subnets under the router bgp statement that you have created static routes for instead of using redistribute static. Why is BGP designed this way? The question might be rhetorical. The remote.txt has the static routes in it.

1 ACCEPTED SOLUTION

Accepted Solutions
Hall of Fame Super Blue

Re: BGP Question - Static Routes

Patrick

Firstly the "network x.x.x.x" statement under the BGP config is doing something very different from network statements under OSPF/EIGRP.

With EIGRP/OSPF the network statements tell the router which interfaces to start running that routing protocol on.

With BGP the network statement tells the router which routes to advertise.

Secondly, a router will only advertise out the networks under the BGP config if it finds an exact match in the IGP routing table. So from yur config on the remote end device

router bgp 65005

network 192.168.2.0 (mask 255.255.255.0)

ip route 192.168.2.0 255.255.255.0 192.168.1.1

You only need that static route if there is not a route for 192.168.2.0/24 in the IGP routing table ie. when you do a "sh ip route"

Note that if you had in the IGP routing table

192.168.2.0 255.255.255.128

192.168.2.128 255.255.255.128

that this wouold not be an exact match with your BGP network statement so you can either

1) Add a static route as you have

2) Advertise out the /25 subnets under your BGP config.

Jon

6 REPLIES
Hall of Fame Super Blue

Re: BGP Question - Static Routes

Patrick

Firstly the "network x.x.x.x" statement under the BGP config is doing something very different from network statements under OSPF/EIGRP.

With EIGRP/OSPF the network statements tell the router which interfaces to start running that routing protocol on.

With BGP the network statement tells the router which routes to advertise.

Secondly, a router will only advertise out the networks under the BGP config if it finds an exact match in the IGP routing table. So from yur config on the remote end device

router bgp 65005

network 192.168.2.0 (mask 255.255.255.0)

ip route 192.168.2.0 255.255.255.0 192.168.1.1

You only need that static route if there is not a route for 192.168.2.0/24 in the IGP routing table ie. when you do a "sh ip route"

Note that if you had in the IGP routing table

192.168.2.0 255.255.255.128

192.168.2.128 255.255.255.128

that this wouold not be an exact match with your BGP network statement so you can either

1) Add a static route as you have

2) Advertise out the /25 subnets under your BGP config.

Jon

Blue

Re: BGP Question - Static Routes

1) Add a static route as you have

2) Advertise out the /25 subnets under your BGP config.

OR

3) Advertise the classful 192.168.2.0 network without the mask keyword and then any route for the major network or one of its subnets of 192.168.2.0 that may already exist in the IP routing table would suffice to advertise the class C address. In other words, an exact match is only needed if the mask keyword is used to advertise a classless route.

HTH

Victor

Hall of Fame Super Blue

Re: BGP Question - Static Routes

Hey Victor

3) - that i did not know and is something that will be quite useful in some of our sites.

Many thanks, rated

Jon

Blue

Re: BGP Question - Static Routes

Wait a minute! You mean I was able to actually teach YOU something for a change??? Wow! Im impressed with myself. Shazam! :-)

Thanks for the rating, buddy.

Victor

Community Member

Re: BGP Question - Static Routes

Your configuration like this

router bgp 65005

network 192.168.2.0 (mask 255.255.255.0)

#ip route 192.168.2.0 255.255.255.0 null 0

Community Member

Re: BGP Question - Static Routes

You don't have to use the network statement to bring those routes into BGP, you still can do a "redistribute static" like other routing protocols.

There are a few differences, though.

First, if you do not filter on the redistribution, it will pull all of your statics into BGP, whereas with network statements, only the ones you specify will be pulled in (as long as those networks listed on the network statements are in the RIB).

Second, routes brought into BGP via the network statement will be listed with an origin of i (IGP) whereas netowrks brought in via redistribution will have an origin of ? (incomplete). In many networks, that difference is not much of a concern.

181
Views
13
Helpful
6
Replies
CreatePlease to create content