I need help with a routing problem and I know it’s related to my lack of knowledge. We have 4 routers that have iBGP sessions between themselves, and each has an eBGP session with our upstream provider. Inside our network we are using OSPF. Each of these edge routers are set to “Always redistribute default route as type 1.”
My original and flawed thought was that if an eBGP peer went down, the “closest” routers to that one would still see it as the default route, and when the packet arrived at the edge router, it would see in it’s routing table a path for the packet through one of it’s neighboring iBGP peers. However, this must not be the case, because when an eBGP peer goes down, I can’t get things flowing again until I remove the “redistribute default route” command. My routers are getting Full Internet Routing tables, both from the eBGP peers and from each other over iBGP.
What is the right course of action for me to take? I have seen some on the Internet say it’s most simple to have your provider send a default route over eBGP and set my routers to redistribute default route if installed. If this is the best course of action then that is what I will do, however, it seems like there should be a more independent/best practice solution. Do I need to use route reflect or Multihop in my iBGP peers? Or perhaps I should enable “default origonate” on the iBGP peers, and if the peer goes down it will remove the originate?
Here is an export of one of my iBGP peers, they are all configured the same.
TLDR: Use redistribute if-installed, and make sure that your IBGP sessions DO NOT send default GW information to each other
Full version:
You should use if-installed, not always.
The priorities (administrative distance) for route sources are:
20: EBGP
110: OSPF
200: IBGP
These values may be a bit off, but they’re close to the correct ones - the point is that EBGP > OSPF > IBGP
Whenever a router loses its EBGP default GW, it should stop announcing 0.0.0.0/0 into OSPF because the router no longer has a default GW from EBGP anymore.
IBGP is “worse” than OSPF, which will contain the 0.0.0.0/0 prefix from your other routers, so the router should fall back to the ospf-learned default GW.
Whenever the router’s EBGP session comes back up, it will regain a better default GW prefix, at which point it will start announcing default GW again.
NOTE: Mikrotik’s routing protocols have a few strange quirks that can lead to routing loops and unusual behavior. In particular, the OSPF process, if announcing default-gw “if-installed” will not accept 0.0.0.0/0 prefix from other OSPF routers. Ideally, if it learns this prefix it should simply stop injecting its own 0.0.0.0/0 and start using the other one from OSPF. However, ROS’s OSPF doesn’t do this.
Secondly, ROS’s IBGP won’t forward default prefix learned from EBGP. To accomplish this, you must enable “distribute default route” on the IBGP configuration explicitly. Make sure that you are NOT doing this! Even though iBGP is much lower priority than OSPF, the ROS OSPF process will NOT abandon the IBGP default GW in favor of an OSPF one, and this can lead to routing loops. It’s hard to quickly explain what happens, but basically, the OSPF will use the very-low-priority IBGP default GW as its basis to announce default GW, which is incorrect and can lead to loops…
R1 originates IBGP default to R2
R2 uses IBGP default as its “installed” default GW route, so R2OSPF injects default GW
R1 uses OSPF default GW from R2 as the “installed” route on which it bases its IBGP advertisement to R2.
Neither router is using a real default GW… see the problem?
Basically, make sure that IBGP is NOT sending default information, and make sure that the EBGP-learned default GW is the ONLY possible source for a default route, other than OSPF itself.
So in summary, I DO want to have my provider send a default route over each eBGP session even though my routers have full Internet routing tables, and set OSPF to redistribute default if installed. Do not redistribute default over iBGP.
I have a Mikrotik CRS Switch. I want to configure iBGP on this Switch between two interface. This device is L3 Switch.Ether1 is ip block 103.248.13.2/32 & Ether2 is 103.248.13.6/28 but ether1 is connected my core router & ether2 is client end.So help me how to iBGP in Mikrotik Cloud Core Switch.