Help: Private Internet Access openVPN - D-Link - DIR-632

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Goto page Previous  1, 2, 3  Next
Author Message
ChuckHL
DD-WRT Novice


Joined: 22 Jun 2012
Posts: 31

PostPosted: Sun May 19, 2013 16:54    Post subject: Reply with quote
Personally I have not use such service provider nor have that router. The service provider I use is HideMyAss with a Linksys E1200 Build 18946 Small-OpenVPN. But regardless of the service provider and router, my intention is not to promote any service or router. Rather, allow me to show how I configured my DDWRT router to work with such service provider. The configuration may be similar to your service provider and you may just need to tweak it a little bit.






I hope the configuration will be similar and that this might help you.

Regards
Sponsor
esamett
DD-WRT Novice


Joined: 14 May 2013
Posts: 12

PostPosted: Sun May 19, 2013 21:27    Post subject: Reply with quote
thanks. Your service seems to use a different authentication method. PIA only has you set the CA.CRT

By the way, how did you copy/paste the certificates into DD-WRT. The CA.CRT file gets extra "newlines" added when I use notepad. I don't know if this alters the certificate or not.


I think I will do full restore to OEM firmware and try again. A thread on another router says that this arcane step is required.
ChuckHL
DD-WRT Novice


Joined: 22 Jun 2012
Posts: 31

PostPosted: Sun May 19, 2013 22:28    Post subject: Reply with quote
esamett wrote:
thanks. Your service seems to use a different authentication method. PIA only has you set the CA.CRT

By the way, how did you copy/paste the certificates into DD-WRT. The CA.CRT file gets extra "newlines" added when I use notepad. I don't know if this alters the certificate or not.


I think I will do full restore to OEM firmware and try again. A thread on another router says that this arcane step is required.


To copy the CRT file I used textpad. It's a free program and hanldes properly the newline and carriage return special characters.

Another difference that I don't know if might be affecting you is that my config does not have this:

/usr/bin/killall openvpn
/usr/sbin/openvpn --config /tmp/openvpncl/openvpn.conf --route-up /tmp/openvpncl/route-up.sh --down-pre /tmp/openvpncl/route-down.sh --daemon
JBeard
DD-WRT Novice


Joined: 02 Jun 2013
Posts: 2

PostPosted: Sun Jun 02, 2013 11:51    Post subject: Re: Help: Private Internet Access openVPN - D-Link - DIR-632 Reply with quote
esamett wrote:
[Moved from main Atheros Thread - Sorry for mistake]



I have been trying for over a month to getting PIA openVPN to work. I have tried a couple DD-WRT builds. Router works fine as standard router. PIA tech support has been unsuccessful in working with me. I tried a custom script they sent me and their posted technique of filling in VPN fields via GUI- both unsuccessful. One technician told me that copy/paste doesn't work from Windows for entering the CA.CRT file. I have noticed that the CA.CRT has extra line breaks the original file does not have when I copy/paste. Running a configuration script via SSH did not yield a working VPN.

There was as recent post on the Atheros Thread about having success with "VPN" using a certain DD-WRT build but no details were revealed. Google has not revealed much to me about openVPN and my router.

Please post here if anybody has openVPN working on their DIR-632, particularly if they use the Private Internet Access VPN service. Perhaps you could post the EXACT technique and build that worked for you. A Configuration Backup file from the router would also be useful - please redact your login / password.

Thanks.


Hi there,

I managed to get it working after hours of googling however I can't find the link so I'll just copy/paste my startup script.
First in Services->VPN enable openVPN Server/Daemon, startup type - System and Config as - Daemon. The create a startup script in Administration-> Commands, just paste your own user/pass and change the server to your choice (mine is "nl.privateinternetaccess.com" )

--------------------------

#!/bin/sh

USERNAME="USER"
PASSWORD="PASS"
PROTOCOL="udp"
# Add - delete - edit servers between ##BB## and ##EE##
REMOTE_SERVERS="
##BB##
# NETHERLANDS
remote nl.privateinternetaccess.com 1194
##EE##
"

#### DO NOT CHANGE below this line unless you know exactly what you're doing ####

CA_CRT='-----BEGIN CERTIFICATE-----
MIID2jCCA0OgAwIBAgIJAOtqMkR2JSXrMA0GCSqGSIb3DQEBBQUAMIGlMQswCQYD
VQQGEwJVUzELMAkGA1UECBMCT0gxETAPBgNVBAcTCENvbHVtYnVzMSAwHgYDVQQK
ExdQcml2YXRlIEludGVybmV0IEFjY2VzczEjMCEGA1UEAxMaUHJpdmF0ZSBJbnRl
cm5ldCBBY2Nlc3MgQ0ExLzAtBgkqhkiG9w0BCQEWIHNlY3VyZUBwcml2YXRlaW50
ZXJuZXRhY2Nlc3MuY29tMB4XDTEwMDgyMTE4MjU1NFoXDTIwMDgxODE4MjU1NFow
gaUxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJPSDERMA8GA1UEBxMIQ29sdW1idXMx
IDAeBgNVBAoTF1ByaXZhdGUgSW50ZXJuZXQgQWNjZXNzMSMwIQYDVQQDExpQcml2
YXRlIEludGVybmV0IEFjY2VzcyBDQTEvMC0GCSqGSIb3DQEJARYgc2VjdXJlQHBy
aXZhdGVpbnRlcm5ldGFjY2Vzcy5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJ
AoGBAOlVlkHcxfN5HAswpryG7AN9CvcvVzcXvSEo91qAl/IE8H0knKZkIAhe/z3m
hz0t91dBHh5yfqwrXlGiyilplVB9tfZohvcikGF3G6FFC9j40GKP0/d22JfR2vJt
4/5JKRBlQc9wllswHZGmPVidQbU0YgoZl00bAySvkX/u1005AgMBAAGjggEOMIIB
CjAdBgNVHQ4EFgQUl8qwY2t+GN0pa/wfq+YODsxgVQkwgdoGA1UdIwSB0jCBz4AU
l8qwY2t+GN0pa/wfq+YODsxgVQmhgaukgagwgaUxCzAJBgNVBAYTAlVTMQswCQYD
VQQIEwJPSDERMA8GA1UEBxMIQ29sdW1idXMxIDAeBgNVBAoTF1ByaXZhdGUgSW50
ZXJuZXQgQWNjZXNzMSMwIQYDVQQDExpQcml2YXRlIEludGVybmV0IEFjY2VzcyBD
QTEvMC0GCSqGSIb3DQEJARYgc2VjdXJlQHByaXZhdGVpbnRlcm5ldGFjY2Vzcy5j
b22CCQDrajJEdiUl6zAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4GBAByH
atXgZzjFO6qctQWwV31P4qLelZzYndoZ7olY8ANPxl7jlP3YmbE1RzSnWtID9Gge
fsKHi1jAS9tNP2E+DCZiWcM/5Y7/XKS/6KvrPQT90nM5klK9LfNvS+kFabMmMBe2
llQlzAzFiIfabACTQn84QLeLOActKhK8hFJy2Gy6
-----END CERTIFICATE-----'

OPVPNENABLE=`nvram get openvpncl_enable | awk '$1 == "0" {print $1}'`

if [ "$OPVPNENABLE" != 0 ]; then
nvram set openvpncl_enable=0
nvram commit
fi

sleep 10
mkdir /tmp/pia; cd /tmp/pia
echo -e "$USERNAME\n$PASSWORD" > userpass.conf
echo "$CA_CRT" > ca.crt
echo "#!/bin/sh
iptables -t nat -I POSTROUTING -o tun0 -j MASQUERADE" > route-up.sh
echo "#!/bin/sh
iptables -t nat -D POSTROUTING -o tun0 -j MASQUERADE" > route-down.sh
chmod 644 ca.crt; chmod 600 userpass.conf; chmod 700 route-up.sh route-down.sh
sleep 10
echo "client
auth-user-pass /tmp/pia/userpass.conf
management 127.0.0.1 5001
management-log-cache 50
dev tun0
proto $PROTOCOL
comp-lzo adaptive
fast-io
script-security 2
mtu-disc yes
verb 4
mute 5
cipher bf-cbc
auth sha1
tun-mtu 1500
resolv-retry infinite
nobind
persist-key
persist-tun
tls-client
remote-cert-tls server
log-append piavpn.log
ca ca.crt
status-version 3
status status
daemon
$REMOTE_SERVERS" > pia.conf
ln -s /tmp/pia/piavpn.log /tmp/piavpn.log
ln -s /tmp/pia/status /tmp/status
(killall openvpn; openvpn --config /tmp/pia/pia.conf --route-up /tmp/pia/route-up.sh --down /tmp/pia/route-down.sh) &
exit 0
esamett
DD-WRT Novice


Joined: 14 May 2013
Posts: 12

PostPosted: Sun Jun 02, 2013 15:48    Post subject: Which DD-WRT build? Reply with quote
Your reply is greatly appreciated. Can you direct me to the firmware build you succeeded with? I have read that some people have had to try many builds before finding one that works. They do no know why.

thanks...
wbennett767
DD-WRT Novice


Joined: 03 Jun 2013
Posts: 5

PostPosted: Mon Jun 03, 2013 23:56    Post subject: Reply with quote
I am in the same boat. I am using Private Internet Access and using the DD-WRT settings provided by PIA does not work.
05dyna
DD-WRT Guru


Joined: 25 Jan 2008
Posts: 968

PostPosted: Mon Jun 10, 2013 19:34    Post subject: Re: Help: Private Internet Access openVPN - D-Link - DIR-632 Reply with quote
esamett wrote:
[Moved from main Atheros Thread - Sorry for mistake]



I have been trying for over a month to getting PIA openVPN to work. I have tried a couple DD-WRT builds. Router works fine as standard router. PIA tech support has been unsuccessful in working with me. I tried a custom script they sent me and their posted technique of filling in VPN fields via GUI- both unsuccessful. One technician told me that copy/paste doesn't work from Windows for entering the CA.CRT file. I have noticed that the CA.CRT has extra line breaks the original file does not have when I copy/paste. Running a configuration script via SSH did not yield a working VPN.

There was as recent post on the Atheros Thread about having success with "VPN" using a certain DD-WRT build but no details were revealed. Google has not revealed much to me about openVPN and my router.

Please post here if anybody has openVPN working on their DIR-632, particularly if they use the Private Internet Access VPN service. Perhaps you could post the EXACT technique and build that worked for you. A Configuration Backup file from the router would also be useful - please redact your login / password.

Thanks.



I was trying to get this to work today myself.The instructions from Private Internet Access don't work for me either. I read their forums and one of their user's came up with a solution that works for me however it cuts my upload & down speeds to less than half even when I change to the nearest location. see link below.

https://www.privateinternetaccess.com/forum/index.php?p=/discussion/345/setting-up-dd-wrt-openvpn-client-/p1

BTW please let me know if you get it working. The folks at PIA say to use Tomato...
05dyna
DD-WRT Guru


Joined: 25 Jan 2008
Posts: 968

PostPosted: Tue Jun 11, 2013 21:08    Post subject: Reply with quote
I upgraded to the latest dd-wrt firmware (r21676) and was about to get it working with the regular PIA instructions. Speeds are about what they should be for using the VPN, there is a loss.... I run it for a while and see how it goes

DD-WRT: VPN OpenVPN Setup

Access the Administration area and then go to Commands and finally Startup.
Enter the following:
echo username >> /tmp/password.txt
echo password >> /tmp/password.txt
/usr/bin/killall openvpn
/usr/sbin/openvpn --config /tmp/openvpncl/openvpn.conf --route-up /tmp/openvpncl/route-up.sh --down-pre /tmp/openvpncl/route-down.sh --daemon
Access the VPN tab found under the Services section.
Enable the OpenVPN Client.
Set the Server IP/name to us-east.privateinternetaccess.com [*].
Set the Port to 1194.
Set the Tunnel Device to TUN.
Set the Tunnel Protocol to UDP.
Set the Encryption Cipher to Blowfish CBC (Default).
Set the Hash Algorithm to SHA1.
Set the nsCertType to unchecked.
Set the Advanced Options to Enabled.
Set Use LZO Compression to Enable.
Set NAT to Enable.
In the Additional Config enter the following:
auth-user-pass /tmp/password.txt
persist-key
persist-tun
tls-client
remote-cert-tls server
Copy and paste the contents of ca.crt found in our OpenVPN Config Files, into the CA cert field.
garvus
DD-WRT Novice


Joined: 08 Feb 2014
Posts: 2

PostPosted: Sat Feb 08, 2014 5:17    Post subject: Private Internet Access OpenVPN (SOLVED) TPlink WDR 3600 Reply with quote
JBEARD is a GENIUS!!!!!!!!!!!!!!
I have a TPLink wdr 3600 with dwrt feb 2014 build 23503

I also added the ca cert info to the vpn server page.

I have the correct ip according to websites.....netflix works also
JammyBstard
DD-WRT Novice


Joined: 14 Apr 2014
Posts: 2

PostPosted: Tue Apr 15, 2014 8:37    Post subject: Re: Help: Private Internet Access openVPN - D-Link - DIR-632 Reply with quote
JBeard wrote:


Hi there,

I managed to get it working after hours of googling however I can't find the link so I'll just copy/paste my startup script.
First in Services->VPN enable openVPN Server/Daemon, startup type - System and Config as - Daemon. The create a startup script in Administration-> Commands, just paste your own user/pass and change the server to your choice (mine is "nl.privateinternetaccess.com" )


Nice one JBeard this is working for me too!

WRT54GS V1.1 - DD-WRT v24-sp2 (10/10/09) vpn

Services->VPN
enable openVPN Daemon,
Startup type - System
Config as - Daemon (I didn't have this option)

Note Open VPN Client is set to Disable!

Worked first time.

Thanks again.
RocheGom
DD-WRT Novice


Joined: 25 Apr 2014
Posts: 1

PostPosted: Fri Apr 25, 2014 21:42    Post subject: Reply with quote
Hi, I have the same problem and I can read that it´s been solved with JBeard comment, but i´m a bit amateur and i´d like to know if someone can explain the excat way to make work PIA VPN on a router, I can see the info from JBeard is the right one I can copy paste some of the info but some i don´t understand where to change it, Please help!!!
Rashtus
DD-WRT Novice


Joined: 10 Jan 2014
Posts: 7

PostPosted: Tue Apr 29, 2014 8:18    Post subject: Re: Help: Private Internet Access openVPN - D-Link - DIR-632 Reply with quote
esamett wrote:

Please post here if anybody has openVPN working on their DIR-632, particularly if they use the Private Internet Access VPN service. Perhaps you could post the EXACT technique and build that worked for you. A Configuration Backup file from the router would also be useful - please redact your login / password.

Thanks.


I suspect your problem may lie in your DHCP and/or dnsmasq settings. The reason I say this is I have PIA working very well per the instructions on their web site (not using the script) and the problem I had initially was around dnsmasq settings. Might I suggest that you review them.
zazzn
DD-WRT Novice


Joined: 22 Nov 2009
Posts: 26

PostPosted: Wed May 21, 2014 5:17    Post subject: Reply with quote
Hi all,

can you help out here, i'm not sure why it's not working and the logs seem ambiguous to me.

erverlog Clientlog 20140520 22:28:11 VERIFY KU OK
20140520 22:28:11 Validating certificate extended key usage
20140520 22:28:11 NOTE: --mute triggered...
20140520 22:28:19 8 variation(s) on previous 5 message(s) suppressed by --mute
20140520 22:28:19 I [Private_Internet_Access] Peer Connection Initiated with 198.23.103.86:1194
20140520 22:28:21 SENT CONTROL [Private_Internet_Access]: 'PUSH_REQUEST' (status=1)
20140520 22:28:21 PUSH: Received control message: 'PUSH_REPLY redirect-gateway def1 dhcp-option DNS 209.222.18.222 dhcp-option DNS 209.222.18.218 ping 10 route 10.147.1.1 topology net30 ifconfig 10.147.1.6 10.147.1.5'
20140520 22:28:21 OPTIONS IMPORT: timers and/or timeouts modified
20140520 22:28:21 OPTIONS IMPORT: --ifconfig/up options modified
20140520 22:28:21 OPTIONS IMPORT: route options modified
20140520 22:28:21 NOTE: --mute triggered...
20140520 22:28:21 1 variation(s) on previous 5 message(s) suppressed by --mute
20140520 22:28:21 I TUN/TAP device tun1 opened
20140520 22:28:21 TUN/TAP TX queue length set to 100
20140520 22:28:21 I /sbin/ifconfig tun1 10.147.1.6 pointopoint 10.147.1.5 mtu 1500
20140520 22:28:21 /sbin/route add -net 198.23.103.86 netmask 255.255.255.255 gw 76.21.48.1
20140520 22:28:21 /sbin/route add -net 0.0.0.0 netmask 128.0.0.0 gw 10.147.1.5
20140520 22:28:21 /sbin/route add -net 128.0.0.0 netmask 128.0.0.0 gw 10.147.1.5
20140520 22:28:21 /sbin/route add -net 10.147.1.1 netmask 255.255.255.255 gw 10.147.1.5
20140520 22:28:21 I Initialization Sequence Completed
20140520 22:28:22 N write UDPv4 [EMSGSIZE Path-MTU=1500]: Message too long (code=97)
20140520 22:28:22 N write UDPv4 [EMSGSIZE Path-MTU=1500]: Message too long (code=97)
20140520 22:28:23 N write UDPv4 [EMSGSIZE Path-MTU=1500]: Message too long (code=97)
20140520 22:28:26 N write UDPv4 [EMSGSIZE Path-MTU=1500]: Message too long (code=97)
20140520 22:28:31 N write UDPv4 [EMSGSIZE Path-MTU=1500]: Message too long (code=97)
20140520 22:28:32 NOTE: --mute triggered...
20140520 22:28:52 16 variation(s) on previous 5 message(s) suppressed by --mute
20140520 22:28:52 MANAGEMENT: Client connected from 127.0.0.1:5001
20140520 22:28:52 D MANAGEMENT: CMD 'state'
20140520 22:28:52 MANAGEMENT: Client disconnected
20140520 22:28:52 MANAGEMENT: Client connected from 127.0.0.1:5001
jeanericblass
DD-WRT Novice


Joined: 01 Mar 2016
Posts: 11

PostPosted: Thu Sep 22, 2016 11:13    Post subject: Reply with quote
yeah "05dyna" give the better information with resources "https://www.privateinternetaccess.com/forum/index.php?p=/discussion/345/setting-up-dd-wrt-openvpn-client-/p1 "


But if any one of you still facing any issue to setup openvpn or configure pia with openvpn then i will suggest them to ask from PIA support team for getting the solid result.

However further more it is better to read detail review of PIA VPN specially for those who have no idea about PIA VPN services
tyboge
DD-WRT Novice


Joined: 13 Apr 2017
Posts: 5

PostPosted: Thu Apr 13, 2017 2:48    Post subject: Reply with quote
Hi,

I am looking for similar assistance and have done quite of bit of research but not quite able to get this working.

I have a netgear r7500v2 running the Kong build from 4-4.

I have tried the tutorials, PIA site and also startup script methods but havent quite found a solution.

Has anyone been successful with OpenVPN PIA with r7500v2 or 7800?

Any help is appreciated.

Code:
Log
Serverlog:




Clientlog:
19691231 16:00:13 W WARNING: file '/tmp/openvpncl/credentials' is group or others accessible
19691231 16:00:13 I OpenVPN 2.4.0 arm-unknown-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [MH/PKTINFO] [AEAD] built on Apr 4 2017
19691231 16:00:13 I library versions: OpenSSL 1.0.2h 3 May 2016 LZO 2.09
19691231 16:00:13 MANAGEMENT: TCP Socket listening on [AF_INET]127.0.0.1:16
19691231 16:00:13 W WARNING: No server certificate verification method has been enabled. See http://openvpn.net/howto.html#mitm for more info.
19691231 16:00:13 W NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
19691231 16:00:18 N RESOLVE: Cannot resolve host address: us-california.privateinternetaccess.com:1198 (Try again)
19691231 16:00:23 N RESOLVE: Cannot resolve host address: us-california.privateinternetaccess.com:1198 (Try again)
19691231 16:00:23 W Could not determine IPv4/IPv6 protocol
19691231 16:00:23 I SIGUSR1[soft init_instance] received process restarting
19691231 16:00:23 Restart pause 5 second(s)
19691231 16:00:28 W WARNING: No server certificate verification method has been enabled. See http://openvpn.net/howto.html#mitm for more info.
19691231 16:00:28 W NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
19691231 16:00:33 N RESOLVE: Cannot resolve host address: us-california.privateinternetaccess.com:1198 (Try again)
19691231 16:00:38 N RESOLVE: Cannot resolve host address: us-california.privateinternetaccess.com:1198 (Try again)
19691231 16:00:38 W Could not determine IPv4/IPv6 protocol
19691231 16:00:38 I SIGUSR1[soft init_instance] received process restarting
19691231 16:00:38 Restart pause 5 second(s)
19691231 16:00:43 W WARNING: No server certificate verification method has been enabled. See http://openvpn.net/howto.html#mitm for more info.
19691231 16:00:43 W NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
19691231 16:00:48 N RESOLVE: Cannot resolve host address: us-california.privateinternetaccess.com:1198 (Try again)
19691231 16:00:53 N RESOLVE: Cannot resolve host address: us-california.privateinternetaccess.com:1198 (Try again)
19691231 16:00:53 W Could not determine IPv4/IPv6 protocol
19691231 16:00:53 I SIGUSR1[soft init_instance] received process restarting
19691231 16:00:53 Restart pause 5 second(s)
19691231 16:00:53 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:16
19691231 16:00:53 D MANAGEMENT: CMD 'state'
19691231 16:00:53 MANAGEMENT: Client disconnected
19691231 16:00:53 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:16
19691231 16:00:53 D MANAGEMENT: CMD 'state'
19691231 16:00:53 MANAGEMENT: Client disconnected
19691231 16:00:53 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:16
19691231 16:00:53 D MANAGEMENT: CMD 'state'
19691231 16:00:53 MANAGEMENT: Client disconnected
19691231 16:00:53 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:16
19691231 16:00:53 D MANAGEMENT: CMD 'status 2'
19691231 16:00:53 MANAGEMENT: Client disconnected
19691231 16:00:53 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:16
19691231 16:00:53 D MANAGEMENT: CMD 'log 500'
19691231 16:00:00
Goto page Previous  1, 2, 3  Next Display posts from previous:    Page 2 of 3
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum