We have several networks, each network has some number of leaf routers (Mikrotiks) and one main network router (also Mikrotik). Main network router has BGP to our ISP and also uses OSPF for routing inside our network.
We have recently upgraded from 2.9.31 to 2.9.35 and there is sad surprise - each time our OSPF changes - if one router disappears or appears again, the bgp prefixes announced by this router (added in /router bgp network) disappear. We have to log into the router and change any bgp parameter (for example disable or enable route reflection, or disable and then enable again networks statement, to force Mikrotik to announce its routes again to my BGP peer.
Has anyone observed similar behaviour?
Additional info - all redistributes are “no”. Prefixes announced to my BGP peer are entered in /router bgp network.
Very good. It is very bad practice to EVER redist anything to BGP.
As it sounds, Mikrotik is not handling IGP synchronization correctly.
A prefix (network or aggregate statement if no redist is taking place) should only be announced via BGP if it exists enough IGP prefixes to cover the whole prefix from any IGP (OSPF,RIP,IS-IS, static etc)
If you wish to announce no matter the IGP synch, you need to be able to switch it off. Mikrotik dont have any switches for this at all in their RouterOS. Not good. Foundry, Cisco, Extreme, IP infusion, Juniper etc do have the option do enable/disable igp synch for prefix announcement via BGP.
It sounds to me like your router is stopping to announce the prefix due to that you loose an internal OSPF prefix so IGP synch prohibits BGP to announce the prefix the OSPF prefix was part of. But in a weird twisted way that is not correct. Maybe IGP synch in BGP is bugging/is not correctly implemented in RouterOS?
Anyone from Mikrotik wanna answer this? Anyone at Mikrotik actually have BGP experience from the ISP world?
I announce W.X.Y.Z/M - it is entered in /router bgp network. I also have null interface (empty bridge) with IP address on it and the whole prefix W.X.Y.Z/M is routed to this null interface via that IP. In OSPF I have only a set of subprefixes of the one which is announced in BGP.
I think I do everything as ‘good practice’ says.
Maybe the problem is with little differences between Mikrotik and some other BGP implementations? I have some similar setups like above and everything works OK, but all these setups use only Mikrotiks. The one that brings troubles, is BGP between Mikrotik and Cisco (95% it is Cisco, 5% it is Juniper).
Does anybody have BGP between Cisco and Mikrotik? Does this Mikrotik act also as OSPF router?
Sounds good that you null route the whole prefix. Should handle the IGP synch problem, IF RouterOS does handle it correctly. Could be a bug there.
Or a bug in the routing engine in general? I mean since you say it stops announcing the prefix if the OSPF has a recalc and take away the OSPF route for that BGP prefix?
OK, I think I know. The problem was the interaction between strange Mikrotik behavoiur and very strict dampening setting at my ISP.
Look at one example:
[admin@pia] > /routing bgp peer print status
Flags: X - disabled
0 name="Futuro" instance=default remote-address=81.219.X.Y remote-as=15833
tcp-md5-key="" nexthop-choice=default multihop=no route-reflect=yes
hold-time=3m ttl=1 in-filter=futuro-in out-filter="futuro-out"
remote-id=81.219.U.W uptime=1d20h22m29s prefix-count=0 updates-sent=4
updates-received=312024 withdrawn-sent=0 withdrawn-received=13658
remote-hold-time=1m30s used-hold-time=1m30s used-keepalive-time=30s
refresh-capability=yes state=established
Look here - almost two days of BGP session and 4 updates sent. It is OK. But when something happens in my LAN with OSPF (for example one new router join the rest and election takes place), then Mikrotik is sending about 5 updates in very short period of time. My provider dampened my prefix in that case. I had to restart the BGP session to make my prefix appear again.
And here is the question to Mikrotik team: I have NO redistribution, not at all:
[admin@pia] > /routing bgp instance print
Flags: X - disabled
0 name="default" as=NUM router-id=81.219.X.Y redistribute-connected=no
redistribute-static=no redistribute-rip=no redistribute-ospf=no
redistribute-other-bgp=no out-filter="" client-to-client-reflection=no
My prefix is entered in network:
[admin@pia] > /routing bgp network print
Flags: X - disabled
NETWORK
0 91.146.Z.0/22
At this moment I have no other BGP sessions. So why after OSPF election (all OSPF routes withdrawned and reentered after election again) is Mikrotik sending many BGP updates?
I think it is a bug becouse the updates are not needed and in some case someone can dampen our prefixes. Nothing changes at the router with BGP - nothing - so it shouldn't send any updates.
Oh bother… I realized the incoming filters applied to a peer dont do what they should… I dont get prepend, localpref, communites, whatever impirnted in the routes I receive…