[resolved] Multiple clients on OpenVPN - Routing Issue
Posted: Wed Dec 14, 2011 9:23 am
Hello and thank you for reading this post.
I am based in China and, in order to access the internet unimpeded, have set up a linux VPS in a Eurpoean country. My aim is that 3 clients can connect to the VPS server and then browse the external internet through the VPS, at the same time.
Currently, all clients can connect to the VPS, without issue. My problem is that only one client is receiving the external IP address of the VPS. The other clients are connected to the VPS through openVPN, but do not take the VPS IP.
I have generated one set of server certs / keys and 3 sets of individual client crts / keys.
I would appreciate any assistance people can give with this. Thanks.
# SERVER.conf
#CLIENT.conf
#Route tables
#iptables status
#UFW Status
I am based in China and, in order to access the internet unimpeded, have set up a linux VPS in a Eurpoean country. My aim is that 3 clients can connect to the VPS server and then browse the external internet through the VPS, at the same time.
Currently, all clients can connect to the VPS, without issue. My problem is that only one client is receiving the external IP address of the VPS. The other clients are connected to the VPS through openVPN, but do not take the VPS IP.
I have generated one set of server certs / keys and 3 sets of individual client crts / keys.
I would appreciate any assistance people can give with this. Thanks.
# SERVER.conf
Code: Select all
local xx.xxx.xxx.xxx # IP of the connection provided by my VPS provider
port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh1024.pem
server 10.8.1.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "route 10.8.1.0 255.255.255.0"
push "redirect-gateway def1"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
keepalive 10 120
comp-lzo
persist-key
persist-tun
status openvpn-status.log
verb 3
mute 20
Code: Select all
client
dev tun
proto udp
remote xx.xxx.xxx.xxx 1194 #IP of the connection provided by my VPS provider
resolv-retry infinite
nobind
user nobody
group nobody
persist-key
persist-tun
ca ca.crt
cert client-name.crt #differs for each client
key client-name.key #differs for each client
comp-lzo
verb 3
mute 20
Code: Select all
myname@server:~$ route -v
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.8.1.2 * 255.255.255.255 UH 0 0 0 tun0
10.8.1.0 10.8.1.2 255.255.255.0 UG 0 0 0 tun0
xx.xx.xx.xx * 255.255.255.0 U 0 0 0 eth0
default xx.xx.xx.xx 0.0.0.0 UG 100 0 0 eth0
Code: Select all
myname@server:~# iptables -L -t nat
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
SNAT all -- 10.8.0.0/24 anywhere to:xx.xx.xx.xx
MASQUERADE all -- 10.8.1.0/24 anywhere
SNAT all -- anywhere anywhere to:xx.xx.xx.xx
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Code: Select all
myname@server:~$ sudo ufw status
Status: active
To Action From
-- ------ ----
22/tcp ALLOW Anywhere
1194 ALLOW Anywhere