Need help making Wireguard Client use specific wan connection

Hello everyone,

So far I have been able to successfully deploy OpenWrt with everything I need to fulfill the needs of my always on, multiple needs connected family.

Besides the obvious, I was able to set AdGuard Home, SQM and WireGuard client to my initial needs and everything seem to work as expected.

Beyond the obvious, in this age of telework and tele study, we also have two internet connections from two different ISPs, which correspond to wan and wanb in mwan3 configuration.

One thing I could not figure out by myself was what to do to force the Wireguard client to only use wanb connection.

Does anyone care to give a helping hand?

Thanks in advance.
Cesar

1 Like

Specify the tunlink option in the WG peer section.

2 Likes

Thank you very much, @vgaetera. I will give it a try and report back.

1 Like

I tried using

option tunlink 'wanb'

on my wireguard peer section and ran some tests.

Firstly, which is good, everything seems to work as usual, no other services seem to be impacted by the change.
But I also found out the VPN connection was still up after I manually removed the ethernet cable from wanb interface, which I suppose means it was somehow using the wan interface.

So, my question is: Do I also need to change the mwan3 policy from current wan_wanb to wan_only, or maybe something completely different?

Thanks

Knowing the mwan3 rule priorities, I'm not surprised that it overrides the built-in system policy.
In any case, the commit introducing tunlink support confirms this should be the correct method:

1 Like

I will keep the change and run some more tests. Thanks for your help.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.