DD-WRT OpenVPN Client Setup Guide with NordVPN

Post new topic   This topic is locked: you cannot edit posts or make replies.    DD-WRT Forum Index -> Advanced Networking
Goto page 1, 2  Next
Author Message
Justanotherbrokenrouter
DD-WRT User


Joined: 27 Apr 2019
Posts: 172

PostPosted: Mon Feb 01, 2021 18:10    Post subject: DD-WRT OpenVPN Client Setup Guide with NordVPN Reply with quote
DD-WRT OpenVPN Setup Guide with NordVPN

These settings have been updated on 9-dec-2021 by moderator (egc)

Note: Since July 2023 you need a new encrypted username and password see:
https://support.nordvpn.com/Connectivity/Router/1047410342/DD-WRT-setup-with-NordVPN.htm

Path: Setup>Basic Setup
(Wan Connection Type)

Ignore WAN DNS = Checked
Note: This option was added in "DD-WRT" builds r44048, and higher.

Network Address Server Settings DHCP

Static DNS 1 = 103.86.96.100 (DNS of your choice) (Moderator: Keep your own DNS server e.g. 9.9.9.9 or 1.0.0.1 etc.)
Static DNS 2 = 103.86.99.100 (DNS of your choice) (Moderator: Keep your own DNS server e.g. 9.9.9.9 or 1.0.0.1 etc.)
Static DNS 3 = 0.0.0.0 (DNS of your choice, but 3rd DNS is not needed)
WINS = 0.0.0.0

Use DNSMasq for DNS = Checked
DHCP-Authoritative = Checked
Recursive DNS Resolving (Unbound) = Unchecked
Forced DNS Redirection = Unchecked

Path: Services>Services
Query DNS in strict order = Disable
______________________________

Path: Services>VPN
(OpenVPN Client)

Start OpenVPN Client = Enable
CVE-2019-14899 Mitigation = Enable
Server IP/Name = 0.0.0.0 https://nordvpn.com/servers/
Note: 0.0.0.0 is just a example of a IP address, and needs to be replaced with a valid IP address. Pick an actual "NordVPN" server IP address from the website URL provided above.
Port = 1194 (or 443 for the TCP protocol)
Tunnel Device = TUN
Tunnel Protocol = UDP4 (or TCP4)
Encryption Cipher = AES-256-CBC
Hash Algorithm = SHA-512
First Data Cipher = AES-256-CBC
Second Data Cipher = AES-128-GCM
Third Data Cipher = AES-256-GCM
User Pass Authentication = Enable
Username = Your NordVPN Username
Password = Your NordVPN Password
Advanced Options = Enable
TLS Cipher = None
LZO Compression = NO (No seems the right setting for Nord and not Disable (although that is the better setting))
NAT = Enable
Inbound Firewall on TUN = Checked
Killswitch = Checked (optional)
Tunnel MTU setting = 1400
Tunnel UDP MSS-Fix = Disable
Verify Server Cert = Checked
TLS Key choice = TLS Auth

Note: Data Cipher information for newer DD-WRT builds r44627, or higher.
Set a value for the Data Ciphers 1,2 and 3.
Set the First Data Cipher the same as your Encryption Cipher ("NordVPN" uses AES-256-CBC), set the Second Data Cipher at AES-128-GCM, and the Third Data Cipher at AES-256-GCM.
______________________________

Note: Paste the "TLS Key" here that is in the ovpn file downloaded from website URL's posted below. File can be opened in a text editor of your choice. "Notepad" works fine.
Note: The "TLS Key", and "CA Cert" does not have to change everytime you change "Server IP/Name" as long as the next "Server IP/Name" selected is in the same city of country used before.

TLS Key = https://nordvpn.com/servers/
https://nordvpn.com/ovpn/

-----BEGIN OpenVPN Static key V1-----


-----END OpenVPN Static key V1-----
______________________________


Note: You can add multiple NordVPN servers for redundancy if you enable "Multiple servers"
With multiple NordVPN servers entered and "Choose Random Server" ticked/enabled, each time the router is rebooted it will randomly pick a different server to connect to.

In the Additonial Config add:
verb 4

In rare circumstances you might need to add
tun-mtu-extra 32
tun-mtu 1500
mssfix 1450

______________________________

Note: Paste the "CA Cert" below that is in the ovpn file downloaded from website URL posted below. File can be opened in a text editor of your choice. "Notepad" works fine.
Note: The "TLS Key", and "CA Cert" does not have to change everytime you change "Server IP/Name" as long as the next "Server IP/Name" selected is in the same city of country used before.

CA Cert = https://nordvpn.com/servers/
https://nordvpn.com/ovpn/

-----BEGIN CERTIFICATE-----


-----END CERTIFICATE-----
______________________________



Note: After set-up its recommended to run a "DNS Leak Test" to make sure your DNS is not leaking. https://dnsleak.com/
Note: "WebRTC Leak Test" is just as important to pass as "DNS Leak Test" Follow the link below to start learning how to disable "WebRTC" in your web browser.
https://browserleaks.com/webrtc
Note: "Firefox" on PC, and other web browers offer "Enable DNS over HTTPS". This will cause your DNS to leak to Provider picked, and sometimes is enabled by default. To disable in "Firefox" the Path: is (Toolbar) Open Menu: Options>General>Network Settings>Settings, and Then Uncheck "Enable DNS over HTTPS"
Run "DNS Leak Test" to verify its disabled.


Last edited by Justanotherbrokenrouter on Wed Aug 25, 2021 10:17; edited 32 times in total
Sponsor
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12877
Location: Netherlands

PostPosted: Mon Feb 01, 2021 18:51    Post subject: Reply with quote
Thanks that is much needed.

There is definitely room for improvement in their instructions.

You can just tick/enable "Inbound firewall on TUN" to implement the kill switch. (on recent builds)

As this is useful for all I will transfer this thread.

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
eibgrad
DD-WRT Guru


Joined: 18 Sep 2010
Posts: 9157

PostPosted: Mon Feb 01, 2021 19:31    Post subject: Reply with quote
FYI, there is no such thing as '--reject-with udp-reset'. udp is a stateless protocol, whereas tcp is stateful, and thus only tcp can be 'reset'. That iptables rule is simply erroring out. The following is sufficient.

Code:
WAN_IF=`nvram get wan_iface`
iptables -I FORWARD -i br0 -o $WAN_IF -j REJECT --reject-with icmp-host-prohibited
iptables -I FORWARD -i br0 -p tcp -o $WAN_IF -j REJECT --reject-with tcp-reset


Also, beware that 'nvram get wan_iface' is not 100% reliable. For example, when the WAN is configured w/ PPPoE, it may return nothing. That's why I prefer the following instead, which examines the actual routing table to find the relevant network interface for the WAN (based on a search for the default route (0.0.0.0/0)).

Code:
WAN_IF="$(ip route | awk '/^default/{print $NF}')"


Neither of the above is a showstopper, but at least worth mentioning.
Justanotherbrokenrouter
DD-WRT User


Joined: 27 Apr 2019
Posts: 172

PostPosted: Mon Feb 01, 2021 22:32    Post subject: Reply with quote
egc wrote:
Thanks that is much needed.

There is definitely room for improvement in their instructions.

You can just tick/enable "Inbound firewall on TUN" to implement the kill switch. (on recent builds)

As this is useful for all I will transfer this thread.


Thanks for moving this thread to a more useful area.
Update as needed. Laughing Well there instructions just got updated!
Justanotherbrokenrouter
DD-WRT User


Joined: 27 Apr 2019
Posts: 172

PostPosted: Fri Feb 19, 2021 15:22    Post subject: Reply with quote
If anyone has any information that can help improve this guide please comment below with directions, and I will edit soon as possible. I obviously don't have problems doing so. Last edited by Justanotherbrokenrouter on Fri Feb 19, 2021 5:36; edited 16 times in total. Rolling Eyes Laughing I will try tonight to edit more information about Additional Configuration.
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12877
Location: Netherlands

PostPosted: Fri Feb 19, 2021 16:28    Post subject: Reply with quote
persist key and persist tun are already set by DDWRT so can be removed.

DDWRT (if no fragment is set) will use "mtu-disc yes" which will normally discover the right MTU size so there usually is no need for fragment and mssfix

So try without mssfix

I am not sure about tun-mtu-extra, I thought that it is for TAP connections so also try without.

So actually do what @eibgrad frequently tells us: "do not put anything in the additional config"

Wait till he chimes in he is our VPN expert Smile

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
Justanotherbrokenrouter
DD-WRT User


Joined: 27 Apr 2019
Posts: 172

PostPosted: Mon Feb 22, 2021 3:16    Post subject: Reply with quote
[quote="egc"]persist key and persist tun are already set by DDWRT so can be removed.

DDWRT (if no fragment is set) will use "mtu-disc yes" which will normally discover the right MTU size so there usually is no need for fragment and mssfix

So try without mssfix

I am not sure about tun-mtu-extra, I thought that it is for TAP connections so also try without.

So actually do what @eibgrad frequently tells us: "do not put anything in the additional config"

Wait till he chimes in he is our VPN expert Smile[/quetc?

Your right many Additional config settings are already set by DD-WRT. With that said I will remove persist key, and tun. "mtu-disc yes" is very helpful, and should be added to Additional config. Mssfix, and fragment can be enabled, or set in OpenVPN Client so no real need to have those in Additional config either.

Just figured I'd ask. QOS doesn't work when OpenVPN Client is enabled. VPN works, but QOS no longer limits connection to values set until OpenVPN Client is disabled. I've tested with speed test. Yes I would like to hear from the VPN guru.
Any thoughts on QOS egc?
eibgrad
DD-WRT Guru


Joined: 18 Sep 2010
Posts: 9157

PostPosted: Mon Feb 22, 2021 6:00    Post subject: Reply with quote
IIRC, QoS has *never* worked w/ the OpenVPN client. I'm pretty sure it's bound exclusively to the WAN.

The only way I know to have QoS associated w/ the OpenVPN client is indirectly. For example, suppose you use a secondary router daisy-chained to the primary (WAN to LAN respectively) that's configured w/ the OpenVPN client. You could specify the WAN ip of that router in the QoS of the primary router. From the perspective of QoS, that WAN ip is just another device on the primary router's network. Of course, *all* traffic on the secondary router, WAN or VPN bound, is treated the same by QoS. Whether that matters is up to you, but if you're not using PBR (policy based routing), everything ends up routed over the VPN anyway, so obviously it shouldn't matter.

Other than that, and AFAIK, QoS and OpenVPN on the same router doesn't work.

_________________
ddwrt-ovpn-split-basic.sh (UPDATED!) * ddwrt-ovpn-split-advanced.sh (UPDATED!) * ddwrt-ovpn-client-killswitch.sh * ddwrt-ovpn-client-watchdog.sh * ddwrt-ovpn-remote-access.sh * ddwrt-ovpn-client-backup.sh * ddwrt-mount-usb-drives.sh * ddwrt-blacklist-domains.sh * ddwrt-wol-port-forward.sh * ddwrt-dns-monitor.sh (NEW!)
Justanotherbrokenrouter
DD-WRT User


Joined: 27 Apr 2019
Posts: 172

PostPosted: Mon Feb 22, 2021 6:17    Post subject: Reply with quote
eibgrad wrote:
IIRC, QoS has *never* worked w/ the OpenVPN client. I'm pretty sure it's bound exclusively to the WAN.

The only way I know to have QoS associated w/ the OpenVPN client is indirectly. For example, suppose you use a secondary router daisy-chained to the primary (WAN to LAN respectively) that's configured w/ the OpenVPN client. You could specify the WAN ip of that router in the QoS of the primary router. From the perspective of QoS, that WAN ip is just another device on the primary router's network. Of course, *all* traffic on the secondary router, WAN or VPN bound, is treated the same by QoS. Whether that matters is up to you, but if you're not using PBR (policy based routing), everything ends up routed over the VPN anyway, so obviously it shouldn't matter.

Other than that, and AFAIK, QoS and OpenVPN on the same router doesn't work.


Exactly what I was thinking, but not in so many words. Just wanted to be sure. Thanks eibgrad.
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12877
Location: Netherlands

PostPosted: Mon Feb 22, 2021 6:55    Post subject: Reply with quote
mtu-disc yes is also set by DDWRT unless you use fragment because fragment will stop the path mtu discovery as you set the mtu manually Smile
_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
Justanotherbrokenrouter
DD-WRT User


Joined: 27 Apr 2019
Posts: 172

PostPosted: Mon Feb 22, 2021 15:38    Post subject: Reply with quote
egc wrote:
mtu-disc yes is also set by DDWRT unless you use fragment because fragment will stop the path mtu discovery as you set the mtu manually Smile


I don't use fragment. If I don't use mtu-disc yes syslog returns message --mtu-disc is not supported on this OS

I haven't contacted NordVPN about this "tun-mtu-extra 32"
Not much talk about it on the internet. Could be the reason I'm having to write mtu-disc yes in Additional Config. if it is also a DD-WRT default also.


Last edited by Justanotherbrokenrouter on Mon Feb 22, 2021 15:54; edited 2 times in total
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12877
Location: Netherlands

PostPosted: Mon Feb 22, 2021 15:46    Post subject: Reply with quote
If you do not use fragment mtu-disc yes is already set by DDWRT have a look in /tmp/openvpncl/openvpn.conf

This is what DDWRT sets without anything in additional config:

Quote:
root@R7800-2:~# cat /tmp/openvpncl/openvpn.conf
ca /tmp/openvpncl/ca.crt
cert /tmp/openvpncl/client.crt
key /tmp/openvpncl/client.key
management 127.0.0.1 16
management-log-cache 100
verb 3
mute 3
syslog
writepid /var/run/openvpncl.pid
client
resolv-retry infinite
nobind
persist-key
persist-tun
script-security 2
dev tun1
proto udp4
cipher AES-256-CBC
auth sha512
data-ciphers AES-256-CBC:AES-256-GCM:AES-128-CBC
remote uk.vpnunlimitedapp.com 1194
comp-lzo no
tun-mtu 1500
mtu-disc yes
remote-cert-tls server
fast-io
route-up /tmp/openvpncl/route-up.sh
route-pre-down /tmp/openvpncl/route-down.sh

root@R7800-2:~#


The mtu-disc yes not supported is a bug in OpenVPN if you choose udp instead of udp4 for the tunnel protocol

See post of Mile-Lile:
https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=328245&start=15

Edit: so you should choose udp4 Smile

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
Justanotherbrokenrouter
DD-WRT User


Joined: 27 Apr 2019
Posts: 172

PostPosted: Mon Feb 22, 2021 16:52    Post subject: Reply with quote
egc wrote:
If you do not use fragment mtu-disc yes is already set by DDWRT have a look in /tmp/openvpncl/openvpn.conf

This is what DDWRT sets without anything in additional config:

Quote:
root@R7800-2:~# cat /tmp/openvpncl/openvpn.conf
ca /tmp/openvpncl/ca.crt
cert /tmp/openvpncl/client.crt
key /tmp/openvpncl/client.key
management 127.0.0.1 16
management-log-cache 100
verb 3
mute 3
syslog
writepid /var/run/openvpncl.pid
client
resolv-retry infinite
nobind
persist-key
persist-tun
script-security 2
dev tun1
proto udp4
cipher AES-256-CBC
auth sha512
data-ciphers AES-256-CBC:AES-256-GCM:AES-128-CBC
remote uk.vpnunlimitedapp.com 1194
comp-lzo no
tun-mtu 1500
mtu-disc yes
remote-cert-tls server
fast-io
route-up /tmp/openvpncl/route-up.sh
route-pre-down /tmp/openvpncl/route-down.sh

root@R7800-2:~#


The mtu-disc yes not supported is a bug in OpenVPN if you choose udp instead of udp4 for the tunnel protocol

See post of Mile-Lile:
https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=328245&start=15

Edit: so you should choose udp4 Smile


Its hard to write the Additional Config for everyone because Defaults change depending on DD-WRT build used. I'm on build DD-WRT v3.0-r44048 std (08/02/20)due to build just being more stable.
So I guess its best to write Additional Config to maybe what is missing, or needed according to your builds /tmp/openvpncl/openvpn.conf

So actually do what @eibgrad frequently tells us: "do not put anything in the additional config"
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12877
Location: Netherlands

PostPosted: Mon Feb 22, 2021 17:10    Post subject: Reply with quote
Yes that is indeed problematic you can not use the latest and greatest build without loosing stability it seems Sad

and indeed not all things are available for you (like udp4) you can try with adding in the additional config:
proto udp4, but you need some extra work indeed

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
Justanotherbrokenrouter
DD-WRT User


Joined: 27 Apr 2019
Posts: 172

PostPosted: Mon Feb 22, 2021 23:27    Post subject: Reply with quote
egc wrote:
Yes that is indeed problematic you can not use the latest and greatest build without loosing stability it seems Sad

and indeed not all things are available for you (like udp4) you can try with adding in the additional config:
proto udp4, but you need some extra work indeed


Correct! Well I think we have pulled this guide through the mud long enough. Time for me to leave well alone. Guide tested, and works.
Goto page 1, 2  Next Display posts from previous:    Page 1 of 2
Post new topic   This topic is locked: you cannot edit posts or make replies.    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