Use BGP Default Route to Replace Static Routing
Martin Kluge sent me an interesting BGP question: he has two upstream links and runs BGP on both. Since his router is low on RAM, he cannot accept full routing, so he’s just announcing his IP prefix and using static default routing toward upstream ISPs.
![Static default routing toward upstream ISP](/2007/11/bgp_1.jpg)
Static default routing toward upstream ISP
The relevant configuration on the GW router is somewhat similar to the configuration I’ve used as a staring point in my lab:
interface Serial1/0
ip address 10.0.1.1 255.255.255.252
!
interface Serial1/1
ip address 10.0.1.5 255.255.255.252
!
router bgp 65100
neighbor 10.0.1.2 remote-as 65001
neighbor 10.0.1.6 remote-as 65002
!
ip route 0.0.0.0 0.0.0.0 10.0.1.2
ip route 0.0.0.0 0.0.0.0 10.0.1.6 250
I’m sure the long-time readers of my blog immediately figured out where the catch is: if the upstream router dies, but the interface stays up, the outbound traffic is blackholed. Reliable static routing might be a solution, but his router is running an old IOS version. Obviously it’s time for yet another rarely known BGP feature: the BGP default route.
If you’ve mastered default routes in other routing protocols, forget about what you know … BGP is different:
- Default route already in the BGP table is advertised to BGP neighbors like any other route.
- To announce a default route to a BGP neighbor without having a default route yourself, configure neighbor default-originate.
- Once you’ve configured default route advertising with the neighbor default-originate, it’s announced to the neighbor even if the router doesn’t have the default route itself.
- The default route advertised to a BGP neighbor with the neighbor default-originate does not pass through BGP output filters, so you cannot filter it.
For even more details, read Default Routes in BGP.
To solve Martin’s problem, you’d have to reconfigure BGP on E1 and E2 as follows (the ip as-path access list just ensures nothing else is sent to the customer router; obviously you could use a route-map instead):
router bgp 65002
neighbor 10.0.1.5 remote-as 65100
neighbor 10.0.1.5 default-originate
neighbor 10.0.1.5 filter-list 1 out
!
ip as-path access-list 1 deny .*
Now that the default route is advertised via BGP, there is no need for a static default, and the default route will be removed (and replaced with the backup one) if the BGP neighbor disappears.
ip route 0.0.0.0 0.0.0.0 serial1/0
ip route 0.0.0.0 0.0.0.0 serial1/1 250
This will ensure that if the interface goes down it will be removed from the routing table, thus no black hole
#1 - As a multihomed customer DO NOT EVER propagate transit routes between upstream ISPs.
#2 - As an ISP, DO NOT EVER accept routes not originating in the customer's AS from the customer.
http://www.nil.si/ipcorner/DesigningBGPNetworks/
http://www.youtube.com/watch?v=zFliAojRi2E
Suppose ISP 1 lose connectivity to upstream provider,using default originate command SP1 will continue to advertise default route to customer, and if customer prefers ISP1, it will lose connectivity to internet even if customer has less preffered default route from ISP2. Am I right?
http://blog.ioshints.info/2011/09/responsible-generation-of-bgp-default.html
I have the same issue like discussed above. My core router see the internet over 2 ISPs but when I removed the default route I lost the connection to a lot of websites. A part of the internet is reachable. From router I can ping everything but not from networks behind it. Do you have any idea?
Regards
Stellar
In your case, that would mean you're not advertising your IPv4 prefix to the rest of the Internet. Does this make sense?