Wireguard VPN - Local Network


We have an issue where people are starting the wireguard vpn when connected to the local network, and this is causing network issues.

Is there any way - wireguard config / script that will detect the machine is connected to the local network and disable / terminate the wireguard vpn connection

What kind of network issues?

I hope somebody has a good answer for you. I have a similar issue with my phone when migrating from WIFI (on LAN) to cell (on WAN), or vice versa. I think that is a DNS issue that I haven’t thought hard enough to figure out. But just connecting on LAN via wireguard is no big deal.

The user takes the laptop into the office, and the VPN is still active

Trying to find away of terminating the vpn if the laptop is connected to the office network

You have the opposite problem I have, you must be doing split tunnel. The only thing I can think of is a kludgy script to check for DNS search name or something. I would rather adjust my FW rules to allow that same internal access from the client’s VPN IP. Maybe that would work for you?

Why? What network issues does it cause?

If these “network issues” are limited to the laptops of these users they just have to turn it off. I mean they where able to turn on when they were outside the local network with their laptops, so they sure know where that button is… :wink: