[deleted]
Hi there was old discussion from 2012 with the same problem but the guy never posted his full solution
Basically I need to tunnel client to server A and from there to Server B
I tried few things which did not work I understand that part of the solution involve with linux routing table
what i have so far is this:
remote ServerA 11111
proto udp4
port 1189
dev tap0
ifconfig 192.168.5.10 255.255.255.0
route 255.255.255.0 192.168.5.1
secret /etc/openvpn/static.key
comp-lzo
keepalive 10 60
ping-timer-rem
persist-key
persist-tun
#mssfix 1200
mute-replay-warnings
port 11111
proto udp4
dev tap0
secret /etc/openvpn/server/static.key
ifconfig 192.168.5.1 255.255.255.0
push "route-gateway 192.168.5.1"
#push "redirect-gateway def1 bypass-dhcp"
#push "dhcp-option DNS 8.8.8.8"
#push "dhcp-option DNS 8.8.4.4"
comp-lzo
keepalive 10 60
ping-timer-rem
#mssfix 1200
persist-tun
persist-key
remote ServerB 11111
proto udp4
port 1199
dev tap1
#topology subnet
ifconfig 192.168.20.10 255.255.255.0
route 255.255.255.0 192.168.20.1
secret /etc/openvpn/server/static.key
comp-lzo
keepalive 10 60
ping-timer-rem
persist-key
persist-tun
#mssfix 1200
mute-replay-warnings
now client can ping ServerA
192.168.5.1 no problem
Server A can ping Server B
192.168.20.1 no problem
My goal is that specific traffic lets say google for example 8.8.8.0/24
will go from client to serverB via server A
so i added route add -net 8.8.8.0/24 gw 192.168.5.1 in the client
and i want serverA automatically will take anything coming from 192.168.5.0/24 and send it to 192.168.20.1 (Server B)
but only traffic coming from 192.168.5.0/24
Anyone know how to do that please?
Marco.