FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
304 views 2 comments
by anonymous
I've got a wireguard tunnel working to route all my traffic over a tunnel, however I'm having to add an explicit route in the routing table to indicate that the wireguard server that I connect to should be routed through the nat gateway my router is connected to. I've set allowed ips to `0.0.0.0/0`, `0.0.0.0/1` and `128.0.0.0/1`

Thanks for any ideas

1 Answer

0 votes
by anonymous
Hello,

Logic, access to the wireguard server itself cannot go through the tunnel it must be processed via a higher priority route. And you can set Allowed IPs to 0.0.0.0/1 + 128.0.0.0/1, 0.0.0.0/0 is redundant and may cause routing issues.

Regards,
by anonymous
Right! What I was looking for was a way to have that route to the gateway be roamable.

For example when I'm connected to the WiFi I have an explicit route for the WireGuard server using the gateway I get over WiFi something like: `10.10.10.10 via 192.168.0.1 dev wlan1` but what I would prefer is to be able to route the WireGuard traffic without having to know the upstream gateway, that way when the router switches from 4G to WiFi and back I don't have to have a hotplug event to correctly set the route
by anonymous

a hotplug event to correctly set the route

How did you do that ? /etc/mwan3.user ? /etc/hotplug.d/18-wireguard ?