What's new

Disconnect or prevent VPN from connecting when connected to Home Wi-Fi

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Khadanja

Senior Member
I have recently set up VPN using OpenVPN and the settings I chose are continuous retry and seamless tunnel as I want all internet traffic when I am not home to go through the VPN. Problem is VPN stay connected when I reach home and connect to my home Wi-Fi. Is there a way to stop it from connecting when I’m home or it doesn’t matter being connected to my home VPN when home. How does the traffic router in that case? Any way to stop it from happening, meaning VPN shouldn’t connect when at home.
 
I have recently set up VPN using OpenVPN and the settings I chose are continuous retry and seamless tunnel as I want all internet traffic when I am not home to go through the VPN. Problem is VPN stay connected when I reach home and connect to my home Wi-Fi. Is there a way to stop it from connecting when I’m home or it doesn’t matter being connected to my home VPN when home. How does the traffic router in that case? Any way to stop it from happening, meaning VPN shouldn’t connect when at home.
Anyone??
 
I have recently set up VPN using OpenVPN and the settings I chose are continuous retry and seamless tunnel as I want all internet traffic when I am not home to go through the VPN. Problem is VPN stay connected when I reach home and connect to my home Wi-Fi. Is there a way to stop it from connecting when I’m home or it doesn’t matter being connected to my home VPN when home. How does the traffic router in that case? Any way to stop it from happening, meaning VPN shouldn’t connect when at home.

You can configure your OpenVPN Server to reject client connections from LAN devices
e.g. Use a script to check if the OpenVPN environment variable '$trusted_ip' matches your LAN subnet prefix.
Code:
client-connect /jffs/scripts/VPNClientConnect.sh
However, as the client on the mobile device is configured to 'continuously retry' then your Syslog will be flooded with rejected OpenVPN connection attempts.

Consequently, I think you would need an automation tool (e.g. Android Tasker) on the client device to be able to automatically terminate the VPN client when you arrive home and restart the appropriate VPN Client when you leave/disconnect from your home WiFi.
 
You can configure your OpenVPN Server to reject client connections from LAN devices
e.g. Use a script to check if the OpenVPN environment variable '$trusted_ip' matches your LAN subnet prefix.
Code:
client-connect /jffs/scripts/VPNClientConnect.sh
However, as the client on the mobile device is configured to 'continuously retry' then your Syslog will be flooded with rejected OpenVPN connection attempts.

Consequently, I think you would need an automation tool (e.g. Android Tasker) on the client device to be able to automatically terminate the VPN client when you arrive home and restart the appropriate VPN Client when you leave/disconnect from your home WiFi.
Thanks. I also noticed if I choose UDP openvpn doesn't connect form within home network. This is what I wanted but why would it not connect over UDP?
 
Thanks. I also noticed if I choose UDP openvpn doesn't connect form within home network. This is what I wanted but why would it not connect over UDP?

I use UDP, and I can still connect to either of the OpenVPN servers from within my LAN.

You will need to examine the connection logs to see if there is an error message.
 
Connecting to the router OpenVPN SERVER from inside the LAN has what effect? Can it cause problems?
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top