#1 2013-05-15 17:51:06

Nyr
Trusted Member
Registered: 2013-03-04
Posts: 335

OpenVPN automated installer

I did this the other day and it works great on LowEndSpirit boxes too, so here you have if it can be useful to someone:
https://github.com/Nyr/openvpn-install

TL;DR:

wget git.io/vpn --no-check-certificate -O openvpn-install.sh; bash openvpn-install.sh

EDIT: 8th July 2013: Just a quick note: yesterday I updated the script and manual configuration is no longer needed for LowEndSpirit containers ^^

Offline

#2 2013-05-15 18:34:37

Backtogeek
Low End Boss
From: ~/
Registered: 2013-02-13
Posts: 3,547
Website

Re: OpenVPN automated installer

@Nyr thanks that is awesome, appreciated.

You can either have a free additional LES for yourself or to give away yourself, great community spirit!


http://LittleHappyCloud.net KVM VPS with 1TB Bandwidth for €3.00

Offline

#3 2013-05-15 18:35:35

mikho
Low End Mod
From: Hell and gore == Sweden
Registered: 2013-03-02
Posts: 1,354
Website

Re: OpenVPN automated installer

good one.

Offline

#4 2013-05-15 18:50:53

Nyr
Trusted Member
Registered: 2013-03-04
Posts: 335

Re: OpenVPN automated installer

Backtogeek wrote:

You can either have a free additional LES for yourself or to give away yourself, great community spirit!

I don't really need another one and don't know anyone who wanted one and didn't already bought it referred by me tongue

If you want, add 64 MB to my .nl container, that could be useful to run some PHP in the future. Anyway, not really needed wink

Offline

#5 2013-05-15 19:01:15

Backtogeek
Low End Boss
From: ~/
Registered: 2013-02-13
Posts: 3,547
Website

Re: OpenVPN automated installer

Deal smile

Just need to work out who you are now, I struggle to match people to forum aliases


http://LittleHappyCloud.net KVM VPS with 1TB Bandwidth for €3.00

Offline

#6 2013-05-15 19:02:11

Backtogeek
Low End Boss
From: ~/
Registered: 2013-02-13
Posts: 3,547
Website

Re: OpenVPN automated installer

Found you smile

You might need to reboot from solusvm.


http://LittleHappyCloud.net KVM VPS with 1TB Bandwidth for €3.00

Offline

#7 2013-05-15 19:03:32

Nyr
Trusted Member
Registered: 2013-03-04
Posts: 335

Re: OpenVPN automated installer

Backtogeek wrote:

Deal smile

Just need to work out who you are now, I struggle to match people to forum aliases

My account is [email protected], I thought you remembered me from the last month tongue

Offline

#8 2013-05-15 19:04:44

Backtogeek
Low End Boss
From: ~/
Registered: 2013-02-13
Posts: 3,547
Website

Re: OpenVPN automated installer

As soon as I typed that I remembered who you were.


http://LittleHappyCloud.net KVM VPS with 1TB Bandwidth for €3.00

Offline

#9 2013-05-15 19:07:02

Nyr
Trusted Member
Registered: 2013-03-04
Posts: 335

Re: OpenVPN automated installer

Backtogeek wrote:

As soon as I typed that I remembered who you were.

Thanks, have a nice day smile

Offline

#10 2013-05-15 19:43:08

mikho
Low End Mod
From: Hell and gore == Sweden
Registered: 2013-03-02
Posts: 1,354
Website

Re: OpenVPN automated installer

If you get one on each location you can have them monitor each other smile

Offline

#11 2013-05-23 20:41:36

anna.parker
Member
Registered: 2013-05-23
Posts: 2

Re: OpenVPN automated installer

Hey!

If you are running my OpenVPN installation script on a LowEndSpirit.com VPS, you are going to need one last thing. The script can't reliably detect a NAT and doesn't really know what IP to put on the client.conf so your client can't connect.

If your VPS is behind a NAT (as happens with LowEndSpirit), you need to manually edit the generated client.conf file and set the external IPv4 on the "remote" line. The rest of the setup it's automated as long as you specified the correct port :)

Have a nice day.

Hey. Script works flawless, you're great! I've used one of the opened for me port, I guess that's good. Could you point me what IPv4 should I use in the client config? I believe I'm so close. :-)

Love,
Anna

Last edited by anna.parker (2013-05-23 20:43:38)

Offline

#12 2013-05-23 21:01:35

Nyr
Trusted Member
Registered: 2013-03-04
Posts: 335

Re: OpenVPN automated installer

anna.parker wrote:

Could you point me what IPv4 should I use in the client config? I believe I'm so close. :-)

Love,
Anna

You need to ask Backtogeek for the external IP. Once you have it, just edit that on the client config smile

Offline

#13 2013-05-23 21:54:58

anna.parker
Member
Registered: 2013-05-23
Posts: 2

Re: OpenVPN automated installer

Thanks Nyr for amazing fast reply. Yeah, but don't want to disturb them, as every their sites they're emphasizing that their VPS have IPv6 only. ;-) That's why I'm asking about trick, free service, etc. I have some other VPSes with IPv4, is it possible to use them in any way?

Love,
Anna

Last edited by anna.parker (2013-05-28 19:42:58)

Offline

#14 2013-05-23 22:02:38

Nyr
Trusted Member
Registered: 2013-03-04
Posts: 335

Re: OpenVPN automated installer

anna.parker wrote:

Thanks Nyr for amazing fast reply. Yeah, but don't want to disturb them, as every their sites they're emphasizing that their VPS have IPv4 only. ;-) That's why I'm asking about trick, free service, etc. I have some other VPSes with IPv4, is it possible to use them in any way?

Love,
Anna

Requesting the external IP is one of the few allowed support requests and Backtogeek only needs to copy and paste it for you, don't worry and ask!

But yeah, you can use this script with other IPv4 servers too smile

Offline

#15 2013-05-23 22:23:01

mikho
Low End Mod
From: Hell and gore == Sweden
Registered: 2013-03-02
Posts: 1,354
Website

Re: OpenVPN automated installer

See these posts :
http://forum.lowendspirit.com/viewtopic.php?id=4

and especially this: http://forum.lowendspirit.com/viewtopic.php?id=215

It clearly says that opening a ticket for the IPv4 is accepted.

Offline

#16 2013-07-08 15:07:26

Nyr
Trusted Member
Registered: 2013-03-04
Posts: 335

Re: OpenVPN automated installer

Just a quick note: yesterday I updated the script and manual configuration is no longer needed for LowEndSpirit containers ^^

Also did some improvements on IP autodetection and bugfixes. I am very happy to know the script is being useful to many people, specially from China.

Offline

#17 2013-07-12 01:49:05

Spittie3
Trusted Member
Registered: 2013-06-30
Posts: 62

Re: OpenVPN automated installer

A quick post to say say: thanks a lot for this script!
Today is the third time that I use it, and installing/configuring OpenVPN has never been so easy. Just need less that a minute and a bunch of clicks.

Thanks!

Offline

#18 2013-07-12 01:51:10

Nyr
Trusted Member
Registered: 2013-03-04
Posts: 335

Re: OpenVPN automated installer

Spittie3 wrote:

A quick post to say say: thanks a lot for this script!
Today is the third time that I use it, and installing/configuring OpenVPN has never been so easy. Just need less that a minute and a bunch of clicks.

Thanks!

Thanks, happy to help smile

Offline

#19 2013-07-13 06:47:40

guardianin
Member
Registered: 2013-07-12
Posts: 28

Re: OpenVPN automated installer

Hi. I installed OpenVPN using your script yesterday. The installation itself was quick and painless. But I was not able to connect due to other problems. They have all been sorted out now though.

So how do I actually connect to my VPN now? I download the compressed file with the generated key and certificates and put it in the openVPN config directory. Also edited the sample conf file to work with my files. But when I try and connect it just shows a blank window and says connection failed after a few seconds. I am running Windows.

Offline

#20 2013-07-13 16:44:06

Nyr
Trusted Member
Registered: 2013-03-04
Posts: 335

Re: OpenVPN automated installer

guardianin wrote:

Hi. I installed OpenVPN using your script yesterday. The installation itself was quick and painless. But I was not able to connect due to other problems. They have all been sorted out now though.

So how do I actually connect to my VPN now? I download the compressed file with the generated key and certificates and put it in the openVPN config directory. Also edited the sample conf file to work with my files. But when I try and connect it just shows a blank window and says connection failed after a few seconds. I am running Windows.

You shouldn't need to edit anything. If you are having connection problems, please paste a log.

Offline

#21 2013-07-17 05:40:56

guardianin
Member
Registered: 2013-07-12
Posts: 28

Re: OpenVPN automated installer

Nyr wrote:

You shouldn't need to edit anything. If you are having connection problems, please paste a log.

Ok, this is what I get:

Wed Jul 17 11:10:03 2013 Warning: cannot open --log file: C:\Program Files\OpenVPN\log\client.log: Access is denied.   (errno=5)
Wed Jul 17 11:10:03 2013 OpenVPN 2.3.2 x86_64-w64-mingw32 [SSL (OpenSSL)] [LZO] [PKCS11] [eurephia] [IPv6] built on Jun  3 2013
Wed Jul 17 11:10:03 2013 MANAGEMENT: TCP Socket listening on [AF_INET]127.0.0.1:25340
Wed Jul 17 11:10:03 2013 Need hold release from management interface, waiting...
Wed Jul 17 11:10:04 2013 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:25340
Wed Jul 17 11:10:04 2013 MANAGEMENT: CMD 'state on'
Wed Jul 17 11:10:04 2013 MANAGEMENT: CMD 'log all on'
Wed Jul 17 11:10:04 2013 MANAGEMENT: CMD 'hold off'
Wed Jul 17 11:10:04 2013 MANAGEMENT: CMD 'hold release'
Wed Jul 17 11:10:04 2013 Socket Buffers: R=[65536->65536] S=[65536->65536]
Wed Jul 17 11:10:04 2013 UDPv4 link local: [undef]
Wed Jul 17 11:10:04 2013 UDPv4 link remote: [AF_INET]snip:1194
Wed Jul 17 11:10:04 2013 MANAGEMENT: >STATE:1374039604,WAIT,,,
Wed Jul 17 11:10:04 2013 read UDPv4: Connection reset by peer (WSAECONNRESET) (code=10054)
Wed Jul 17 11:10:06 2013 read UDPv4: Connection reset by peer (WSAECONNRESET) (code=10054)
Wed Jul 17 11:10:10 2013 read UDPv4: Connection reset by peer (WSAECONNRESET) (code=10054)
Wed Jul 17 11:10:18 2013 read UDPv4: Connection reset by peer (WSAECONNRESET) (code=10054)

Last edited by guardianin (2013-07-17 09:19:30)

Offline

#22 2013-07-17 08:20:15

Nyr
Trusted Member
Registered: 2013-03-04
Posts: 335

Re: OpenVPN automated installer

guardianin wrote:

Ok, this is what I get:

You are trying to connect to the server over port 1194, that's the default OpenVPN port and you should had specified during installation one of your mapped ports (look at the welcome email from Inception Hosting).

Also, please remove the public node IP from the logs, isn't meant to be published.

Offline

#23 2013-07-17 09:23:52

guardianin
Member
Registered: 2013-07-12
Posts: 28

Re: OpenVPN automated installer

Nyr wrote:

You are trying to connect to the server over port 1194, that's the default OpenVPN port and you should had specified during installation one of your mapped ports (look at the welcome email from Inception Hosting).

Also, please remove the public node IP from the logs, isn't meant to be published.

Oh ok, removed IP.

Also, I am now able to connect and OpenVPN finally shows that an IP has been assigned (starts with 10), but when I query my IP location, it still shows my real location and not the UK. I tried rebooting the VPS, still the same.

Last edited by guardianin (2013-07-17 09:24:30)

Offline

#24 2013-07-17 10:49:54

Nyr
Trusted Member
Registered: 2013-03-04
Posts: 335

Re: OpenVPN automated installer

guardianin wrote:
Nyr wrote:

You are trying to connect to the server over port 1194, that's the default OpenVPN port and you should had specified during installation one of your mapped ports (look at the welcome email from Inception Hosting).

Also, please remove the public node IP from the logs, isn't meant to be published.

Oh ok, removed IP.

Also, I am now able to connect and OpenVPN finally shows that an IP has been assigned (starts with 10), but when I query my IP location, it still shows my real location and not the UK. I tried rebooting the VPS, still the same.

Please, paste the output of:

cat /etc/rc.local

Offline

#25 2013-07-17 10:53:28

guardianin
Member
Registered: 2013-07-12
Posts: 28

Re: OpenVPN automated installer

Sure, here you go:

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -j SNAT --to 10.10.10.192

exit 0

Offline

Board footer