SOLUTION 2
For this you only need 1 server.conf
After looking at your example/guide, lets say it looks like this:
1194.conf
local 123.255.123.123
port 1194
proto udp
dev tun
tun-mtu 1500
tun-mtu-extra 32
mssfix 1450
ca /etc/openvpn/easy-rsa/2.0/keys/ca.crt
cert /etc/openvpn/easy-rsa/2.0/keys/server.crt
key /etc/openvpn/easy-rsa/2.0/keys/server.key
dh /etc/openvpn/easy-rsa/2.0/keys/dh1024.pem
plugin /usr/share/openvpn/plugin/lib/openvpn-auth-pam.so /etc/pam.d/login
client-cert-not-required
username-as-common-name
##Im setting this to something practical:
server 10.10.1.0 255.255.255.0
push "redirect-gateway def1"
push "dhcp-option DNS 208.67.222.222"
push "dhcp-option DNS 4.2.2.1"
keepalive 5 30
comp-lzo
persist-key
persist-tun
status 1194.log
verb 3
##Im adding some new lines:
client-config-dir /etc/openvpn/ccd
route 10.10.2.0 255.255.255.0
Create the afformentioned client-config-dir.
bash:
mkdir /etc/openvpn/ccd
What are your usernames? lets do example, "username1", "username2", "username5"
bash:
touch /etc/openvpn/ccd/username1
touch /etc/openvpn/ccd/username2
touch /etc/openvpn/ccd/username5
Edit /etc/openvpn/ccd/username1:
ifconfig-push 10.10.2.1 10.10.2.2
Edit /etc/openvpn/ccd/username2:
ifconfig-push 10.10.2.5 10.10.2.6
Edit /etc/openvpn/ccd/username5:
ifconfig-push 10.10.2.9 10.10.2.10
...more to follow...
IPTABLES:
iptables -A FORWARD -s 10.10.1.0/24 -j ACCEPT
iptables -A FORWARD -s 10.10.2.0/24 -j ACCEPT
#iptables -t nat -A POSTROUTING -s 10.10.1.0/24 -j SNAT --to 111.255.111.111
#iptables -t nat -A POSTROUTING -s 10.10.2.0/24 -j SNAT --to 222.255.222.111
A basic summary of what is happening:
- Default VPN lan is 10.10.1.x
- Secondary VPN lan is 10.10.2.x
- Any user with a filename in ./ccd will be given a 10.10.2.x address
- The 10.10.2.x address is hardcoded for each user: eg username1 10.10.2.1
- IPTABLES will assign all the users with a 10.10.2.x address to the alternate WAN IP (222.255.222.222 or whatever)
- Any user who's name is not in the ccd will simply get the default LAN of 10.10.1.x, and therefore the default (non alternate) WAN IP also.
This *is* the finished product. Its been tested and works.
Important note: learn your IP addressing schema for Windows. IP's can only be paired as
[ 1, 2] [ 5, 6] [ 9, 10] [ 13, 14] [ 17, 18]
[ 21, 22] [ 25, 26] [ 29, 30] [ 33, 34] [ 37, 38]
[ 41, 42] [ 45, 46] [ 49, 50] [ 53, 54] [ 57, 58]
[ 61, 62] [ 65, 66] [ 69, 70] [ 73, 74] [ 77, 78]
[ 81, 82] [ 85, 86] [ 89, 90] [ 93, 94] [ 97, 98]... and so on
more info:
http://openvpn.net/index.php/open-source/documentation/howto.html