A Simple VPN Implementation
Posted: Fri 23 Mar 2018, 18:20
LATEST UPDATE
Experimental "vpn-onoff" packages now Version 0.2
- DNS handling, Switches when you click into VPN and back again when you click out of VPN. The instruction to do this must be in the configuration file. The VPNbook config files have this included.
- OpenVPN Version upgrade from 2.4.6 to 2.4.7
- FreeVPN.me server configurations have all changed. Configuration files updated accordingly. A 7th server freevpn.eu has been added.
- Splash message no longer exits on mouse-over
http://smokey01.com/OscarTalks
PREVIOUS UPDATE
I am now putting together some packages which contain everything to give all the features described in this thread. More details in this post here:-
http://murga-linux.com/puppy/viewtopic. ... 4&start=30
MOST OF THE ORIGINAL THREAD IS BELOW
________________________________________
This method uses openvpn and the free service provided by VPNbook.
Another free provider freevpn.me is also used.
1) Install openvpn. (Not needed if using vpn-onoff because already included)
Best to compile from source. There are some I compiled here if you prefer:-
http://smokey01.com/OscarTalks
Use the command which openvpn and/or openvpn --version to verify that it is installed.
Installing via PPM may or may not work and often offers older versions.
2) Install the vpn-activator .pet package (NOW REMOVED). This contains the config files for vpnbook (in /etc), scripts to start and stop VPN (in /usr/bin), the 2 .desktop files and the icon. This gives 2 menu entries "VPN-Start" and "VPN-Stop" in the Network section.
NOTE: Many of the config files from VPNbook in this original package no longer work.
EDIT: This old and outdated package has now been removed.
3) If /dev/net/tun does not exist in your system, use boot manager to add the kernel module named tun and reboot (or enter "modprobe tun" in terminal if running without save). LATER:- I have added code for this to the VPN-Start script so there is more chance of it working without the need for this step now.
4) Go to http://vpnbook.com and grab the Open VPN password. Paste this into the second line of /etc/vpn-onoff/vpnpass (replace the word "password"). Save and close.
5) Click the VPN-Start menu entry and wait for around 30 seconds
Your default browser should open and connect to http://my-ip-address.co in order to show that you are connected via the VPNbook server.
5) To deactivate the VPN, click the VPN-Stop menu entry and wait a few seconds.
Your default browser should open and show your normal IP address.
NOTES
1) If you try to start it when it is already running, or stop it when it is not running, you should just get a simple notification telling you.
2) The VPNbook password changes a couple of times a month. When this happens you will need to grab the new one and paste it in (which is a simple step). If your browser opens showing that the VPN has not activated this is usually the cause.
3) The available VPNbook servers are Canada, Germany, Poland, France, USA1 and USA2. Some of these allow p2p as well as surfing, see their website for details of which. To switch to a different server, delete the symlink /etc/vpn-onoff/vpnconfig, right-click the desired vpnbook config file in /etc/vpn-onoff and create a new symlink with the name vpnconfig (to replace the one you deleted) and then restart openvpn.
4) This method can easily be adapted for other VPN providers.
5) Obviously this is just a simple yet effective system that works for me. There is scope for further development such as a tray notification (EDIT:- See a few posts down) and a gtkdialog GUI. Ideas are welcome. Other VPN systems are available.
Experimental "vpn-onoff" packages now Version 0.2
- DNS handling, Switches when you click into VPN and back again when you click out of VPN. The instruction to do this must be in the configuration file. The VPNbook config files have this included.
- OpenVPN Version upgrade from 2.4.6 to 2.4.7
- FreeVPN.me server configurations have all changed. Configuration files updated accordingly. A 7th server freevpn.eu has been added.
- Splash message no longer exits on mouse-over
http://smokey01.com/OscarTalks
PREVIOUS UPDATE
I am now putting together some packages which contain everything to give all the features described in this thread. More details in this post here:-
http://murga-linux.com/puppy/viewtopic. ... 4&start=30
MOST OF THE ORIGINAL THREAD IS BELOW
________________________________________
This method uses openvpn and the free service provided by VPNbook.
Another free provider freevpn.me is also used.
1) Install openvpn. (Not needed if using vpn-onoff because already included)
Best to compile from source. There are some I compiled here if you prefer:-
http://smokey01.com/OscarTalks
Use the command which openvpn and/or openvpn --version to verify that it is installed.
Installing via PPM may or may not work and often offers older versions.
2) Install the vpn-activator .pet package (NOW REMOVED). This contains the config files for vpnbook (in /etc), scripts to start and stop VPN (in /usr/bin), the 2 .desktop files and the icon. This gives 2 menu entries "VPN-Start" and "VPN-Stop" in the Network section.
NOTE: Many of the config files from VPNbook in this original package no longer work.
EDIT: This old and outdated package has now been removed.
3) If /dev/net/tun does not exist in your system, use boot manager to add the kernel module named tun and reboot (or enter "modprobe tun" in terminal if running without save). LATER:- I have added code for this to the VPN-Start script so there is more chance of it working without the need for this step now.
4) Go to http://vpnbook.com and grab the Open VPN password. Paste this into the second line of /etc/vpn-onoff/vpnpass (replace the word "password"). Save and close.
5) Click the VPN-Start menu entry and wait for around 30 seconds
Your default browser should open and connect to http://my-ip-address.co in order to show that you are connected via the VPNbook server.
5) To deactivate the VPN, click the VPN-Stop menu entry and wait a few seconds.
Your default browser should open and show your normal IP address.
NOTES
1) If you try to start it when it is already running, or stop it when it is not running, you should just get a simple notification telling you.
2) The VPNbook password changes a couple of times a month. When this happens you will need to grab the new one and paste it in (which is a simple step). If your browser opens showing that the VPN has not activated this is usually the cause.
3) The available VPNbook servers are Canada, Germany, Poland, France, USA1 and USA2. Some of these allow p2p as well as surfing, see their website for details of which. To switch to a different server, delete the symlink /etc/vpn-onoff/vpnconfig, right-click the desired vpnbook config file in /etc/vpn-onoff and create a new symlink with the name vpnconfig (to replace the one you deleted) and then restart openvpn.
4) This method can easily be adapted for other VPN providers.
5) Obviously this is just a simple yet effective system that works for me. There is scope for further development such as a tray notification (EDIT:- See a few posts down) and a gtkdialog GUI. Ideas are welcome. Other VPN systems are available.