OpenWrt, wireguard and metrics
Enrico Mioso
mrkiko.rs at gmail.com
Sat Oct 17 17:33:14 PDT 2026
Oops, it turns out I was using the
nohostroute
option in the wrong section, hence it was not having effect.
Now it seems to all work as expected. However, I would still apreciate a lot your opinions and tought on this matter.
Thanks a lot,
Enrico
On Sun, Oct 18, 2026 at 02:20:24AM +0200, Enrico Mioso wrote:
> Hello All!!
>
> first of all, I would like to express once again my gratitude for your great work. OpenWrt is, as you may know by now, one of my favourite projects.
>
> So, I have a kind of rudimentary multi-wan setup: an FTTC connection via PPPoE is used as the main one, with 5G link as fallback.
> Main router is at 192.168.2.1, while 5G is 192.168.2.15.
> So the 5G router is a separate device, reachable via LAN by the main router. I wanted to keep things really simple, so I simply added a route pointing to the 5G device as a default gateway, altough with an higher metric.
> This setup kinda does what I want:
> - connections go out from the PPPoE link (wan interface in the main router)
> - if the wan interface goes down, traffic goes out from 5G link.
>
> But then, things get complicated. I had two main issues:
> a - DNS: of course, once the wan interface was down, it's DNS where removed. I solved that by adding some other DNS servers to the LAN interface, obtaining the desired effect (even tough I expect there is a more elegant solution here).
> b - The main router acts also a wireguard gateway. What I am observing here is that wireguard will always prefer 5G link, while I would like it to respect the metrics.
> I can also see it creates a route to my wireguard endpoing via the br-lan interface pointing to the 5G device. Removing that route manually seems to fix my problem, but wondering if I can prevent it from being created in the first place.
> I tought I could use the wireguard "nhostroute" option for this, but it seems not the case.
>
> Am I doing things completely the wrong way? Or is there any solution I may try out?
>
>
> Thanks,
> Enrico
More information about the openwrt-devel
mailing list