-2

Is there any way to access to openvpn server lan in the following scenario?

Server1 (vpn server)

IP (eth1): 10.0.0.199/24

Vpn IP (tun0): 10.8.0.1/24

Server2

IP (eth1): 10.0.0.198/24

Client

IP (eth1): 192.168.64.2/24

Vpn IP (tun0): 10.8.0.1/24

Only Server1 is publicly open to internet, and servers are connected through a local switch with 10.0.0.0/24 ip range. All machines have ubuntu 16.04 installed, ip-forwarding enabled and ufw disabled.

Client is connected to vpn server, but can't access to Server2 by pinging 10.0.0.198. However, Server2 can access to client machine by pinging 10.8.0.4.

Routes are configured as below:

openvpn server.conf

route 192.168.64.0 255.255.255.0
push "route 10.0.0.0 255.255.255.0"
push "route 192.168.64.0 255.255.255.0"

ccd/client

ifconfig-push 10.8.0.4/24 10.8.0.1
iroute 192.168.64.0 255.255.255.0

EDIT: Server2 has also this route: 10.8.0.0/24 via 10.0.0.199

Note: I don't have access to routers/gateways of neither client nor server1. So, I am trying to find a way to access server2 without touching routers.

0

Looks like you're missing a route on Server2. Try adding this:

 ip route add 10.0.8.0/24 via 10.0.0.199
  • This route is also added, i forgot to mention. Because of this, Server2 can access to client i think. But the opposite is not working. – abeyaz Feb 23 at 9:00
  • Then you need to enable the IP forwarding on your Server1 so it can forward the IP packets between interfaces. – drookie Feb 23 at 11:24
  • already enabled on all machines – abeyaz Feb 23 at 12:23

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.