I have two mikrotik routers connected by a wireguard tunnel.
OSPF and BGP are configured on both routers via wireguard tunnel and work without problems.
I decided to enable BFD on the wireguard interfaces and in the OSPF settings - BFD and OSPF sessions established correctly.
But when i enable “use BFD” on BGP connection on the same time with “use BFD” on OSPF - OSPF and BGP session starts to collapse, BFD connections starts to up/down in a circle.
How i can use BFD with OSPF and BGP jn the same time in one Wireguard tunnel?
Tweak your BFD settings to be more forgiving of the packet loss or jitter detected on the wireguard tunnel, or don’t use it at all. Just keep your BGP and OSPF timers down to their minimums, unless you have two or three such links.
Why do you need BFD over the wireguard tunnel? It’s designed to provide BGP + OSPF with sub-second detection of link failures. Wireguard tunnels running across the Internet are undoubtedly going to run into minor hiccups that you wouldn’t normally see on a local link, and will accordingly cause the routers to lose adjacency, as you’re seeing.
Of course, you’re right about the purpose of the BFD. BGP and OSPF timer tweak - its a bad practice in my opinion.
But if BFD is enabled only on OSPF or only on BGP, everything works correctly (BFD session uptime up to 12h).
If i enable BFD on both routing protocols, routing stops working suddenly(every 2-3 seconds up/down) in this particular direction (i have 3 wireguard tunnel).In this case, the tunnel interface with “enable BFD” is pinged withou losts.
As for why it only works with one and not both, I can’t say. I may have seen this behavior before and disabled it on the affected routers (I run BGP between loopbacks anyway, so if OSPF goes down, BGP will go pretty quickly too). If it’s a bug, it’s possible the two BFD sessions are colliding and causing problems, or that the two protocols are fighting over the BFD session.
It might make sense to open a ticket with support.