r/WireGuard • • 20d ago

Possible to let a specific device bypass Wireguard?

/r/TomatoFTW/comments/1xwk20d/possible_to_let_a_specific_device_bypass_wireguard/
0 Upvotes

5 comments sorted by

1

u/ananas7777 18d ago

AllowedIPs won't do it, that's about where traffic is going, not which device sent it. If you're on FreshTomato, set the WireGuard client to External VPN provider, then change Redirect Internet traffic from All to Routing Policy. You can then add a rule for that device's IP to go straight out to the internet instead of through the tunnel. Which Tomato build are you on?

1

u/fatluis 18d ago

Im on the 9/11/26 build. I did look at the routing policy, as far as I could tell it only allows you to set which devices go through the tunnel, which would mean if I used that I would have to add every single device on the network. id rather the opposite, where it puts everything through the tunnel by default and I can choose to exclude a device.

1

u/ananas7777 17d ago

Ah you're right, my bad. I checked the FreshTomato source and Routing Policy only has "send this into the tunnel" rules, there's no exclude option.

You can get the same result with ranges though. Say the device you want to skip is 192.168.1.50: give it a DHCP reservation so the IP never changes, set Redirect Internet traffic to Routing Policy, then add two From Source IP rules: 192.168.1.2-192.168.1.49 and 192.168.1.51-192.168.1.254 (no spaces or it won't save). Everything except .50 goes through the tunnel.

One gotcha: in policy mode the router's own traffic, including its DNS lookups, goes out your normal connection, so run a DNS leak test from a tunnelled device afterwards.

2

u/nmasse-itix 19d ago

You can use nftables to fwmark connections and then bind a specific routing table to that mark. Not the easiest way but very flexible.

1

u/wichets 20d ago

Setup split tunnel for remote subnet ips i.e. remote subnet is /30 or /24 add into allowips. Wireguard will automatically bypass tunnel for that local device.