DDWRT OpenVPN Troubleshooting Guide v37
DDWRT OpenVPN Troubleshooting Guide v37
This document hopes to aid DDWWRT users with suggestions to troubleshoot a non-function OVPN
server setup.
This is a work in progress and any suggestions are welcome.
As more problems and there solutions are posted this will be added, so it is also up to you DDWRT
users to report common mistakes and their solutions.
First thing to check is if you are up to date with a functioning build (do not use the router database)
how to do that is explained in the forum guide lines.
When reporting a problem and asking for advice, it helps if you share with us as much details from
your setup as possible
At least:
• router model, firmware build kernel version
• If your router is not connected to the internet i.e. does not have a public IP on its WAN,
share your network setup
• Post pictures of your OVPN Setup page and OVPN Status page (the whole page) when you
are trying to connect
• Post contents of Additional Config of the OVPN server
• Post the log of the client when you are trying to conn
Reboot
When you are done setting up always reboot the router.
You need permanent storage (jffs), after you have setup USB and NAS, copy /tmp/smb.conf and
/tmp/smb.db to /jfss/etc/ , those files will then be used by ksmbd for configuration after the router
reboots (or after you restart ksmbd, see below).
Use stopservice samba3, startservice samba3, to stop and start, this could be necessary also if your
USB is slow and ksmbd does not detect /jffs/etc/smb.conf (so if necessary add this to a route-up
script)
You can check from the CLI that /jffs/etc/smb.conf is used and that ksmbd listens on the interfaces
you want with: ps
1857 root 1256 S ksmbd.mountd -c /jffs/etc/smb.conf -u /jffs/etc/smb.db
1859 root 1304 S ksmbd.mountd -c /jffs/etc/smb.conf -u /jffs/etc/smb.db
1861 root 0 SW [ksmbd-vlan2]
1863 root 0 SW [ksmbd-eth1]
1865 root 0 SW [ksmbd-eth0]
1869 root 0 SW [ksmbd-tun2]
1872 root 0 SW [ksmbd-oet1]
1873 root 0 SW [ksmbd-br0]
I got it working from my Android phone with AndSMB but I had to choose SMB v1 in AndSMB (and
set the min Protocol to NT1).
Reset to defaults
Sometimes you have been tinkering and trying out lots of things so if it is not working then reset to
defaults and only alter as little as possible before setting up the OVPN server.
Check subnets
OVPN server can only function if there are 3 different subnets involved, the subnet of the router, the
subnet of the OVPN server and the subnet of the client all have to be different (for a normal TUN
setup).
It is therefore advised to use a subnet for your router which is not common so do not use
192.168.0.0 or 192.168.1.0.
Check status
Check if the server is running, go to Status/OpenVPN.
If the OVPN server is running the page will show "Connected Success", this does not mean there is a
connection, it only tells you that OVPN server is started normally. If you do not see this and the page
is blank, then the OVPN server cannot start because of a setup problem, mostly due to a problem
with certificates, so check/redo the certificates
DDWRT uses tun2 as its OpenVPN interface and takes care of all necessary firewall rules (except a
NAT rule if you want internet access. So do not add any firewall rules yourself beside the NAT rule.
Check if the OVPN interface exists:
ifconfig:
Opening up the specified port on the router and opening up the TUN interface :
iptables -vnL INPUT :
See the last 2 lines indicating port 1194 is opened and TUN2 is also opened
Forwarding traffic to and from that interface to that interface (TUN2) from all other interfaces
iptables -vnL FORWARD
MTU size problems (Connection, but no traffic, hang, slow loading, or no streaming media)
MTU problems often manifest themselves as connections which hang during periods of active usage,
or does not load the whole page when browsing. Or you can connect but not see or use streaming
media (like an IP Camera) or your connection is unexpected slow
In the log you can see messages like: read UDP [EMSGSIZE path-MTU=1388]: Message too long (code=90)
The MTU (Maximum Transmission Units) is the maximum datagram size in bytes that can be sent
unfragmented over a particular network path. OpenVPN requires that packets on the control or data
channels be sent unfragmented.
The easiest way to deal with this is using TCP as protocol instead of UDP (i.e. change "proto udp4" to
"proto tcp" on client and server
If this does not help or you do not want to use TCP then start with: fragment 1300
On both server and client and enable mssfix on client.
fragment has to be set on both sides, mssfix only needs to be set on one side (if set on both sides the
lowest value counts), in DDWRT mssfix will take its value from fragment.
But on older clients this will not always work you then have to lower the MTU settings from its
default 1500 to lower values like 1300 i.e.: tun-mtu 1300 in server and client config.
You might need to go even lower
If fragment is not set then mtu-disc yes is added to discover the right udp size which usually will work
OpenVPN 2.5
Some ciphers have been deprecated if necessary you can add deprecated ciphers with:
data-ciphers-fallback BF-CBC
Alternatively especially for the client, just set the cipher according to the server and add:
ncp-disable
see:
https://build.openvpn.net/man/openvpn-2.5/openvpn.8.html
https://github.com/OpenVPN/openvpn/blob/release/2.5/Changes.rst
References:
https://www.sonassi.com/help/troubleshooting/setting-correct-mtu-for-openvpn
https://community.openvpn.net/openvpn/wiki/271-i-can-ping-through-the-tunnel-but-any-real-
work-causes-it-to-lock-up-is-this-an-mtu-problem
https://openvpn.net/vpn-server-resources/troubleshooting-client-vpn-tunnel-connectivity/
https://openvpn.net/faq/tls-error-tls-key-negotiation-failed-to-occur-within-60-seconds-check-your-
network-connectivity/
https://wiki.ipfire.org/configuration/services/openvpn/troubles