I have an openvpn server setup that works great
can get in using the clients and get onto my network no problem
i also have a private internet access VPN and have setup a virtual machine as a VPN gateway for it
so if I'm at home i can either use my routers IP as the gateway and i get the normal ISP IP address
or i can use the virtual machine IP as the gateway and i get the PIA VPN address
works pretty well
so router is 192.168.10.1
vpn gateway is 192.168.10.14
if i set 192.168.10.1 as my gateway i get a standard uk IP address
if i set 192.168.10.14 as my gateway if get whatever IP i have connected to PIA using. Canada for example
what i would like to do is be able to connect in to my VPN server from outside and push the .14 gateway to the clients instead of the .1 gateway
i tried just altering the gateway in /etc/network/interfaces on the openvpn server to .14 but the clients can now no longer connect (the server itself can get out to the internet file), the clients just sit waiting for server. If i change the gateway back to .1 then the clients work again
here is my openvpn server.conf which is on .18
port 1194
proto udp
dev tun
sndbuf 0
rcvbuf 0
ca ca.crt
cert server.crt
key server.key
dh dh.pem
tls-auth ta.key 0
topology subnet
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
keepalive 10 120
cipher AES-128-CBC
comp-lzo
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
verb 3
crl-verify crl.pem
Then my interfaces file with the .14 gateway commented out
iface eth0 inet static
pre-up /etc/firewall-openvpn-rules.sh
address 192.168.10.18
netmask 255.255.255.0
network 192.168.10.0
gateway 192.168.10.1
#gateway 192.168.10.14
dns-nameserver 8.8.8.8
and then some iptables
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o wlan0 -j SNAT --to-source 192.168.10.18 #[Local IP]
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o tun1 -j MASQUERADE
then on my .14 gateway machine i have some IP table rules setup for forwarding out anything that comes in on eth0 out through tun1 (which is the PIA VPN)
iptables -t nat -A POSTROUTING -s 192.168.10.0/24 -o eth0 -j SNAT --to-source 192.168.10.14
iptables -t nat -A POSTROUTING -s 192.168.10.0/24 -o tun1 -j MASQUERADE
#
# For IP Forwarding through PIA
#
iptables -A FORWARD -i eth0 -o tun1 -j ACCEPT
iptables -A FORWARD -i tun1 -o eth0 -j ACCEPT
so what I'm looking for is to change the gateway on the openvpn server to be .14 instead of .1
Any ideas, I am in no way an expert and most of this is trial and error from different guides.
Thanks