Default Gateway through remote VPN client
Posted: Sat Nov 07, 2020 9:01 am
I've got 1 server and 2 clients. I want to route all traffic from "client2" and any other clients through the VPN but not through the VPN server's default route itself but back through "client" one of the clients on the VPN. Whats the best way to achieve this? Below is my attempt using ifconfig-push and iroute on "client" but how can I configure the "redirect-gateway" directive to route all traffic through "client" instead of the server?
Server: 10.8.0.1
cn="client": 10.8.0.2
cn="client2": 10.8.0.3
server.conf
client-config-dir ccd
client-to-client
server 10.8.0.0 255.255.255.0
push "route 10.8.0.2 255.255.255.0"
;push "route 192.168.20.0 255.255.255.0"
push "redirect-gateway def1"
push "dhcp-option DNS 1.1.1.1"
ccd/client
ifconfig-push 10.8.0.2 255.255.255.255
iroute 10.8.0.2 255.255.255.255
ccd/client2
route 10.8.0.2 255.255.255.0
Server: 10.8.0.1
cn="client": 10.8.0.2
cn="client2": 10.8.0.3
server.conf
Server Config
client-config-dir ccd
client-to-client
server 10.8.0.0 255.255.255.0
push "route 10.8.0.2 255.255.255.0"
;push "route 192.168.20.0 255.255.255.0"
push "redirect-gateway def1"
push "dhcp-option DNS 1.1.1.1"
ccd/client
Server Config
ifconfig-push 10.8.0.2 255.255.255.255
iroute 10.8.0.2 255.255.255.255
ccd/client2
Server Config
route 10.8.0.2 255.255.255.0