OpenVPN – How to Set Up OpenVPN Traffic Relay

networkingopenvpn

English is not my mother tongue; please excuse any errors on my part 🙂

I try to set up link tunnel using OpenVPN, here is the network topology diagram

+------------------+              +------------------+
|   172.32.103.5   |              |   192.168.24.99  |
|                  |              |                  |
| OpenVPN-client1  +--------------+ OpenVPN-server1  |
|     10.8.0.2     |              |     10.8.0.1     |
+------------------+              |                  |                 +------------------+
                                  | OpenVPN-client2  |                 |   192.168.101.2  |
                                  |    192.168.0.4   +-----------------+                  |
                                  |                  |                 | OpenVPN-server2  |
                                  |                  |                 |     192.168.0.2  |
                                  +------------------+                 +------------------+

Both OpenVPN work fine. But I can't ping 192.168.101.2(server2) from 172.32.103.5(client1). I tried tcpdump on client2(tun0) and I can see echo request from 192.168.24.99 to 192.168.0.2. On the contrary, when I ping server2 from client2, I can see echo request from 192.168.0.4 to 192.168.0.2 and its replay package.

I have search on google but get not solutions. And I don't even know how to describe this problem precisely.

How to solve problem? Thanks in advance.

Best Answer

Ran iptables -t nat -I POSTROUTING -s 10.8.0.0/24 -j MASQUERADE on 192.168.24.99 solved the problem.

Related Question