I am trying to setup a fresh dd-wrt router to work with OpenVpn. However, the OpenVpn I need to use has a automatically generated config file. That looks like:
# Automatically generated OpenVPN client config file
# Generated on Wed Sep 11 17:15:39 2013 by ip-10-164-12-159
# Note: this config file contains inline private keys
# and therefore should be kept confidential!
# Note: this configuration is user-locked to the username below
# OVPN_ACCESS_SERVER_USERNAME=openvpn
# Define the profile name of this particular configuration file
# OVPN_ACCESS_SERVER_PROFILE=-redacted-
# OVPN_ACCESS_SERVER_CLI_PREF_ALLOW_WEB_IMPORT=True
# OVPN_ACCESS_SERVER_CLI_PREF_ENABLE_CONNECT=True
# OVPN_ACCESS_SERVER_CLI_PREF_ENABLE_XD_PROXY=True
# OVPN_ACCESS_SERVER_WSHOST=-redacted-
# OVPN_ACCESS_SERVER_WEB_CA_BUNDLE_START
# -----BEGIN CERTIFICATE-----
# -redacted-
# -----END CERTIFICATE-----
# OVPN_ACCESS_SERVER_WEB_CA_BUNDLE_STOP
# OVPN_ACCESS_SERVER_IS_OPENVPN_WEB_CA=0
# OVPN_ACCESS_SERVER_ORGANIZATION=OpenVPN Technologies, Inc.
setenv FORWARD_COMPATIBLE 1
client
proto udp
nobind
remote -redacted-
port 443
dev tun
dev-type tun
ns-cert-type server
reneg-sec 604800
sndbuf 100000
rcvbuf 100000
auth-user-pass
# NOTE: LZO commands are pushed by the Access Server at connect time.
# NOTE: The below line doesn't disable LZO.
comp-lzo no
verb 3
setenv PUSH_PEER_INFO
<ca>
-----BEGIN CERTIFICATE-----
-redacted-
-----END CERTIFICATE-----
</ca>
<cert>
-----BEGIN CERTIFICATE-----
-redacted-
-----END CERTIFICATE-----
</cert>
<key>
-----BEGIN PRIVATE KEY-----
-redacted-
-----END PRIVATE KEY-----
</key>
key-direction 1
<tls-auth>
#
# 2048 bit OpenVPN static key (Server Agent)
#
-----BEGIN OpenVPN Static key V1-----
-redacted-
-----END OpenVPN Static key V1-----
</tls-auth>
If a SSH into my router (this means I have turned sshd on) I can use this configuration to connect to the OpenVpn server. If I look at the VPN Server Access Control Page is shows that I have successfully connected. However, I believe the routing table of the dd-wrt is not sending traffic from the wifi device to the VPN.
I am very new to routing and have not been able to work any of the dd-wrt tutorials (they all assume that you use another type of configuration, which I cannot use). Therefore my questions is in two parts:
Can someone guide me in setting up the iptables (or whatever sends the traffic from the wifi networking device) in a scriptable fashion so that I can run the iptables script and then start OpenVPN on the router.
How do I change this to work only on a VAP (virtual access point) or only with certain ip addresses (so only the device with the ip of x.x.x.x connected to the AP goes through the VPN).
Note: I normally like to have these scripts on my computer and then I ssh them onto whatever dd-wrt router is around and then run them to open a VPN connection.
Going through google and this site hasn't helped my very much so far.