i have a CHR router, where i have created wireguard links to several mikrotik routers. Up to here works fine. The problem is when i try to run OSPF for routing networks behind router.
I’m not exactly sure what you mean by “OSPF for routing networks behind the router,” but you have to define all networks that should be routed using OSPF. Adjacent ones don’t propagate automatically.
Here are a couple of short and concise step-by-step labs that might cover what you need:
by the “OSPF for routing networks behind the router” i mean that if you configure to advertise for example connected networks, the oppose router get the routes.
Unfortunately, there is no built-in automatic “discovery” functionality in OSPF. All included networks/subnets must be explicitly defined somewhere. For example, if a router is connecting two areas (i.e. acting as an OSPF Area Border Router) both networks must be defined for their respective areas in the connecting router. The same applies to a single area with two different subnets on respective side of a router. Otherwise, OSPF will not know how to propagate network information to the other side.
It doesn’t matter what type of links you are using and Wireguard works out just fine with OSPF. Just make sure to use the link type ptp. When everything is working as expted, you may add BFD for superfast failover. Feel free to have a look at the videos before asking more questions.
EDIT:
For troubleshooting purposes, make sure to test the WireGuard links with static routes before applying OSPF. Tho before enabling it, remember to remove the static routes or alternatively use a very high distance metric (eg 250) so that routes added by OSPF take precedence.
routers that are connected via wireguard links are not shown in the ospf neighbors.
router 1 can see routes for all networks from all routers, except router 2.
router 2 and 3 even though they are connected and can ping each other, they cannot communicate with OSPF.
Nice picture, but unfortunately it’s pretty difficult to say anything else since it lacks info about networks and interface addresses. Let’s begin with router 2 and 3. Btw, is this a single or multi-area topology?
For IPv4 links over wirefuard , it must allow 224.0.0.0/24 over wireguard.
For IPv6 links , you must assign a fe80::xxxx/64 linklocal address to each endpoint and allow fe80::/16
Yeah, good suggestion. If the wg-interface used for OSPF isn’t listed in the LAN device list, you’ll need to specify that port explicitly. This also affects the forward chain for routing.