Since at least one person did ask about my config, I thought I'd post the details here for the benefit of others.
To start, I should mention that I largely followed these instructions:
http://www.howtogeek.com/64433/how-to-i ... rt-router/
...although not verbatim. There were some differences in my resulting config, but the above article got me close enough to figure things out.
I'm using:
- OpenVPN 2.0.0 client on on iPad 4. Works fine w/ WiFi and LTE.
- A Linksys WRT-54G v2 w/ firmware: DD-WRT v24-sp2 (11/02/09) vpn.
Router scripts
On the router, I'm not using any custom startup/shutdown scripts, except for the following firewall script:
Code: Select all
iptables -I INPUT 1 -p tcp --dport 443 -j ACCEPT
iptables -I FORWARD 1 --source 192.168.4.0/24 -j ACCEPT
iptables -I FORWARD -i br0 -o tun0 -j ACCEPT
iptables -I FORWARD -i tun0 -o br0 -j ACCEPT
Notes:
- 192.168.4.0/24 is my internal subnet
- I'm using port tcp/443 because some locations I use my iPad at have super-aggressive egress policies (i.e., they don't allow anything but outbound http/s traffic on 80/443). Naturally, this could cause problems if you're running an SSL-based web server on your external IP. (I'm not).
- You do
not have to open port 443 under the DD-WRT's NAT->Port Forwarding in order for this to all work-- the iptables cmds takes care of it.
OpenVPN Daemon settings (DD-WRT)
Start OpenVPN : Enabled (duh

)
Start Type: Wan Up
[Upload all the required certs/keys per instructions elsewhere]
OpenVPN Config
Code: Select all
push "route 192.168.4.0 255.255.255.0"
server 10.8.1.0 255.255.255.0
dev tun0
proto tcp
port 443
keepalive 10 120
comp-lzo
dh /tmp/openvpn/dh.pem
ca /tmp/openvpn/ca.crt
cert /tmp/openvpn/cert.pem
key /tmp/openvpn/key.pem
verb 5
cipher bf-cbc
management localhost 5001
Notes:
- Again, 192.168.4.0/24 is my internal LAN subnet
- 10.8.1.0/24 is the IP range that your VPN clients will live in. Pretty much arbitrary.
- I chose 'cipher bf-cbc' for performance reasons. If you're extremely security-conscious, 'cipher AES-128-CB' may be a better choice.
- Probably can lower verbosity (verb 5) level. Had it set high during troubleshooting.
Lastly, here's the OpenVPN .ovpn client config itself:
OpenVPN Client .ovpn config
Notes:
- I chose to upload my keys and certs as separate files, but the unified (inline) method works fine as well.
- If you're on residential broadband (that uses dynamic IPs), make your life easier and sign up with a dynamic DNS service. (I'm using myhost.dyndns.org as an example in client config below)
Code: Select all
##############################################
# Sample client-side OpenVPN 2.0 config file #
# for connecting to multi-client server. #
# #
# This configuration can be used by multiple #
# clients, however each client should have #
# its own cert and key files. #
# #
# On Windows, you might want to rename this #
# file so it has a .ovpn extension #
##############################################
# Specify that we are a client and that we
# will be pulling certain config file directives
# from the server.
client
# Use the same setting as you are using on
# the server.
# On most systems, the VPN will not function
# unless you partially or fully disable
# the firewall for the TUN/TAP interface.
;dev tap
dev tun
# Windows needs the TAP-Win32 adapter name
# from the Network Connections panel
# if you have more than one. On XP SP2,
# you may need to disable the firewall
# for the TAP adapter.
;dev-node MyTap
# Are we connecting to a TCP or
# UDP server? Use the same setting as
# on the server.
proto tcp
#proto udp
# The hostname/IP and port of the server.
# You can have multiple remote entries
# to load balance between the servers.
remote myhost.dyndns.org 443
pull
# Choose a random host from the remote
# list for load-balancing. Otherwise
# try hosts in the order specified.
;remote-random
# Keep trying indefinitely to resolve the
# host name of the OpenVPN server. Very useful
# on machines which are not permanently connected
# to the internet such as laptops.
resolv-retry infinite
# Most clients don't need to bind to
# a specific local port number.
nobind
# Downgrade privileges after initialization (non-Windows only)
;user nobody
;group nobody
# Try to preserve some state across restarts.
persist-key
persist-tun
# If you are connecting through an
# HTTP proxy to reach the actual OpenVPN
# server, put the proxy server/IP and
# port number here. See the man page
# if your proxy server requires
# authentication.
;http-proxy-retry # retry on connection failures
;http-proxy [proxy server] [proxy port #]
# Wireless networks often produce a lot
# of duplicate packets. Set this flag
# to silence duplicate packet warnings.
;mute-replay-warnings
# SSL/TLS parms.
# See the server config file for more
# description. It's best to use
# a separate .crt/.key file pair
# for each client. A single ca
# file can be used for all clients.
ca ca.crt
cert ipad4.crt
key ipad4.key
# Verify server certificate by checking
# that the certicate has the nsCertType
# field set to "server". This is an
# important precaution to protect against
# a potential attack discussed here:
# http://openvpn.net/howto.html#mitm
#
# To use this feature, you will need to generate
# your server certificates with the nsCertType
# field set to "server". The build-key-server
# script in the easy-rsa folder will do this.
ns-cert-type server
# If a tls-auth key is used on the server
# then every client must also have the key.
;tls-auth ta.key 1
# Select a cryptographic cipher.
# If the cipher option is used on the server
# then you must also specify it here.
#cipher AES-128-CBC
cipher bf-cbc
# Enable compression on the VPN link.
# Don't enable this unless it is also
# enabled in the server config file.
comp-lzo
# Set log file verbosity.
verb 5
# Silence repeating messages
;mute 20
# --float tells OpenVPN to accept authenticated packets from any address, not only the address which was specified in the --remote option.
# Useful if you're using round-robin DNS. Also useful if your server has a dynamic IP address which the ISP could change.
# I use float so I can connect from inside AND outside my router.
float
Closing comments
- There are likely a number of spurious/unnecessary settings in my conf files from early troubleshooting attempts. At first I thought of cleaning them up before posting here, then realized that it would be better to show exact copies of a known-working config (albeit a bit messy).
- This is a standard split-tunnel config. I've been messing around trying to get a full-tunnel working but admittedly, it's not a high priority for me.
- I hope this helps others. Because of other obligations, I don't frequent these forums that often, but if you have any questions about my config -- just ask here and I'll try to respond when I can.