dima4855
Greetings,
Have a small network problem which may have to do with iptables, openvpn and routing.
Linux Server A (192.168.10.1, external ip:66.145.458.xxx) is the gateway running openvpn server (accepting connections from outside world and firewall).
Linux Server B (192.168.10.9, 192.168.3.42) is a data server running openvpn client (essentially creating a site-to-site vpn) connection to a server outside the network.
Linux Server C in a different location that server B creates the tunnel to (192.168.3.1, external ip: 75.188.18.xxx)
Windows Client machines (192.168.10.xxx) whose gateway is Server A (192.168.10.1).
Problem:
Client machines are not able to ping or connect to server C.
Troubleshooting:
From server B I can ping Server C 192.168.3.1, however I cannot ping 192.168.3.1 from server a, thus I thought the problem is the route. Thus, I added the following route to server A:
route add -host 192.168.3.0 netmask 255.255.255.0 gw 192.168.10.9
This allowed me to now ping 192.168.3.42 from server A, but still is not allowing me to ping 192.168.3.1, so am I missing a route or does it simply not know to route the traffic through 192.168.3.42?
The odd thing is when I run traceroute to 192.168.3.1 I do not see it going to 192.168.10.9 or 192.168.3.42, it does not go anywhere.
I am sure it is something simple, but not sure if it's a openvpn, route or iptables problem.
We are going to be changing the gateway on one of the client machines tomorrow from server a to server b and we will see if anything changes.
Thanks for all your help in advance, I have not used openvpn or iptables in years and not an expert on iptables (at all).
Mimiko
You are making complicated. Why not connect Server C directly to Server A?
In your server A config file you have to use push "route 192.168.3.0 255.255.255.0 192.168.10.9" which will acknoledge clients conencting to server A where to find 192.168.3.0 network. This must be put in ccd files for each client, to exlude pushing this route to the server B which is a client to server A.
In server A you have to add a route for 192.168.3.0 to 192.168.10.9 gateway, as you did.
In server B you have to enable routing between both tunnels using iptables.
In server C you must add a route for 192.168.10.0 network to gateway 192.168.3.42, so server C will know where to send packets for that network.