Fork me on GitHub
AutoVPN: auto connect VPN if network is active and reconnect if VPN connection drops
01. Jan. 2012 at 21:00 written under privacy, english

After unsuccessful try on reddit.com, someone pointed me to a Python script that almost did what I wanted. Changed it a bit (works only with NetworkManager 0.9.x branch) and got: https://gist.github.com/1547663

Usage

First parameter to script is VPN connection name in NetworkManager and second are comma separated names of networks that should be ignored (using VPN connection at home is useless).

  • clone gist somewhere (eg. git clone git://gist.github.com/1547663.git /home/user/autovpn/)
  • add to /etc/rc.local: python /home/user/autovpn/autovpn.py "myvpn" 'Auto homenetwork,Auto worknetwork' > /var/log/autovpn.log&
  • reboot :-)
Read and Post Comments