HowTo: OpenVPN with VZ0

Links to great tutorials and original contributions.
Don't know how to setup your VPN ? How to install a panel ? How to tweak yout VPS ? Check here and ask if you don't find what you are looking for.
Post Reply
Admin
Site Admin
Posts: 490
Joined: Wed Jul 25, 2012 10:54 pm

HowTo: OpenVPN with VZ0

Post by Admin » Thu Aug 09, 2012 11:50 pm

Hello !

I promissed an OpenVPN easy tutorial, here it is !
PPTP is a very easy vpn which encrypts all traffic from our computer to the server and then outside.
OpenVPN is more complicated, more secure and more flexible. This makes it harder to install, however, if you need it for personal reasons (recommended !), you can use the Enterprise version free for 2 users.
We will do this with Ubuntu 10 on a VZ0 plan (50cents one does not work, OpenVPN is heavier than PPTP).
So, let's prepare our VPS.
1. We need enable TUN/TAP device in our Solus Control panel.
Do not worry, you can do this simple, just login into your solusvm panel: https://solusvm.prometeus.net:5656 using the data you got in the mail which told you you received a VPS from us (user is vzuser-somenumber and pass is below in mail).
In the first screen, click manage and in the next window locate the buttons i highlighted like in this picture:Image
Initially they are disabled, so you will see on both enable.
Click Enable TUN/TAP and confirm. Your VPS will reboot automatically, give it 1 minute or more.
2. Install Ubuntu 10 32 bit template (if you want 64 bit, you need to download the 64 bit openvpn package later, but for small VPS 32 bit OS is faster and takes less memory). It works similarly on debian.
So, here is your panel with the brand new VZ0 plan:Image
While debian will work too, let's put ubuntu because the OpenVPN package is made specially for Ubuntu10: Click the reinstall button at the bottom of the page and select the Ubuntu 10 32 bit template:
Image
Click reinstall at the bottom of the page and answer yes at the confirmation box.
Take a 1 minute break and your template should already be installed !
3. Update Ubuntu.
So, lets login in our vps using a ssh client called putty (download here: http://the.earth.li/~sgtatham/putty/lat ... /putty.exe)
We need for this the IP of the server (look in the first image with solusvm control panel, you will see it there) and the root password (should be in the mail you got when you bought the vps, but if it does not work, you can easily change it in solusvm control panel):Image
Put there the IP of the server in both fields, then click save to have it for further sessions. Now click open, you will be presented with a security warning, click yes and proceed to insert your username (root), click enter, then your password (you won't see it as you type so make sure you type right).
Image
Now type these commands (copy/paste works):

Code: Select all

apt-get update

Code: Select all

apt-get upgrade

Code: Select all

apt-get remove samba* apache2*
You can also remove other packages you dont need. Say yet to all prompts.
4. Install OpenVPN software:
to download the package in our server we need to use wget (it gets the file from internet in our VPS)
Open a browser, go to http://openvpn.net/index.php/download.html, click ubuntu, right-click ubuntu 10 32 bit and choose copy link address or similar (depends on browser).
Now go back to your putty window, type

Code: Select all

wget
and right-click in the window. The address should paste automatically, you should have something similar to:

Code: Select all

wget http://swupdate.openvpn.org/as/openvpn-as-1.8.4-Ubuntu10.i386.deb
If that doesn't happen, go back and make sure you right-click and select the correct entry in the menu (copy does not work, you need to select copy link address, or copy target address or similar depending on your browser). Alternatively you can copy and insert the above command, but if the version changes, you will need to make the necessary adjustments.
After you manufactured the right command, hit enter and it should download it. If you made a typo, it will give an error, use up arrow on your keyboard to get the command back, check it carefully for mistakes.
Now that we have it, lets install it with this command:

Code: Select all

dpkg -i open*
If everything goes well, you should see the address where to connect. But there is one more step, you need to set the password for the openvpn user:

Code: Select all

passwd openvpn
and you should be asked for the new UNIX password twice. Inser the same thing both ways. If you didnt manage and it says they dont match (you wont see what you type), retype the above command.
Ok, now we are ready to connect ! Go to the admin link in your browser, user is openvpn and password what you typed before.
Image
If the button stop the server is not there, there have to be some errors listed above. Most likely tun/tap device not found. You probably didn't manage to enable it, scroll back and redo that step. There might be other errors, post them here and you will get help.
Now, to connect, go to the other link, without /admin:

Code: Select all

https://yourip:943/
and there you have user root and password (your root password from VPS).
You will be offered to download the client which is already setup to connect to your VPS IP.
Download, install, and you are ready to go !

For further information about how to configure your windows browser to use the VPN, please refer here : http://www.youtube.com/watch?v=GC9D4TAuotY
For problems, post here and we will look into it together.
If this looks too complicated, you can always use pptp: viewtopic.php?f=8&t=15
If that is still not what you are looking for or you have absolutely no linux knowledge, or your network blocks everything except internet browsing, you have this tutorial that should work in any situation:
viewtopic.php?f=8&t=828

Admin

Dusty
Posts: 3
Joined: Mon Aug 27, 2012 12:20 am

Re: HowTo: OpenVPN with VZ0

Post by Dusty » Sat Sep 15, 2012 2:46 am

Can I possibly suggest making a tutorial for people using OpenVPN but non-access server? This worked great for me, but I like to toy around, so I played s'more. Using this http://library.linode.com/networking/op ... -6-squeeze and a little adjusting, I setup an OpenVPN server and connected three laptops and a phone. Requires a bit more knowledge and elbow grease, but the RAM usage is amazingly low.

Admin
Site Admin
Posts: 490
Joined: Wed Jul 25, 2012 10:54 pm

Re: HowTo: OpenVPN with VZ0

Post by Admin » Sat Sep 15, 2012 10:23 am

Dusty wrote:Can I possibly suggest making a tutorial for people using OpenVPN but non-access server?
I admit i do not understand what a non-access server is.
From the tutorial you linked, it is probably plain openvpn without the gui.
It is certainly possible to provide a tutorial for that, however, everything has to be very simple so people that know nothing or very little about linux can follow it.
The others don't need it or have a lot of resources on the net :)

Admin

netsales
Posts: 1
Joined: Mon Oct 22, 2012 12:07 am

Re: HowTo: OpenVPN with VZ0

Post by netsales » Mon Oct 22, 2012 12:28 am

I have tried and spent days on this, all steps, processes, tutorials and yours gets the closest but sill doesn't work, I get this when trying to start from the webgui

Error: iptables service not started because of error (SVC_RUN_EXCEPT)

I verified that TUN/TAP is enabled, I ran openvpn installs on debian,6, 6x64, ubtuntu, etc and seems all the same, maybe its the crappy service provider I am using "raidlogic" I opened a number of tickets with never a response, however based on your tutorial it appears it should work.

When I manually started iptables with nat I received an error stating that "Table does not exist" this could be causing the error in the webgui

iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o venet0 -j MASQUERADE

FATAL: Module ip_tables not found.
iptables v1.4.4: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)

Admin
Site Admin
Posts: 490
Joined: Wed Jul 25, 2012 10:54 pm

Re: HowTo: OpenVPN with VZ0

Post by Admin » Mon Oct 22, 2012 1:58 pm

Hello and welcome :)

Well, MASQUERADE does not work with OpenVZ, that is a known limitation, you may want to start over because you probably have some leftover rule from previous attempts. Look also in our FAQ, number 1.1, it has an example there on how to convert that rule.
Reinstall and follow the instructions here as this will provide with the correct iptables rules. If, however, other modules are missing, I don't know, this is only tested here and a couple of other providers I have VPSes with. Not everyone enables the same modules.
Alternatively, you may try other kinds of VPN, such as PPTP, SSH, even squid (http proxy), there are tutorials here.

Admin

jcaleb
Posts: 92
Joined: Fri Aug 03, 2012 8:56 am

Re: HowTo: OpenVPN with VZ0

Post by jcaleb » Fri Nov 09, 2012 8:50 am

Question though.

What is the advantage of being able to VPN to Italy? I am only familiar with websites in US where can only be accessed if US ip. But Italy I am not aware of interesting sites I can visit.

Admin
Site Admin
Posts: 490
Joined: Wed Jul 25, 2012 10:54 pm

Re: HowTo: OpenVPN with VZ0

Post by Admin » Sun Nov 11, 2012 2:26 pm

Hello !

VPN is not used only to get an IP in a particular country to be recognized by the sites there as indigenous, they are used to bypass restrictive firewalls, to hide your activity from oppressive regimes, to test IPv6 there can be many ways in which a VPN is useful.
Leaving that aside, this guide is not working only on Prometeus VPNs, many ppl use it for BuyVM or other providers.

Jolufa
Posts: 1
Joined: Wed Mar 13, 2013 8:36 pm

Re: HowTo: OpenVPN with VZ0

Post by Jolufa » Wed Mar 13, 2013 8:49 pm

Hello, I found a script to install OpenVPN on Linux systems.
Was the only way to do it working fine in Centos.
Tested and connected succesfully using my Windows 7 PC and my Android phone.
:-)

Best regards

Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests