F
F
Falseclock2017-10-06 11:47:01
Network administration
Falseclock, 2017-10-06 11:47:01

How to make a gateway to another subnet through OpenVPN?

We have an internal mesh 192.168.1.0/24
This mesh has a node (Debian, 192.168.1.198) that connects to a remote server as an OpenVPN client.
The remote server has its own subnet 192.168.10.0/24

Everything works, 192.168.1.198 successfully pings the network 192.168.10.0/24

Now it is necessary on the other nodes of the 192.168.1.0/24 subnet so that they also see 192.168.10.0/24

Installed a route on one of the machines , get hooked 192.168.10.0/24 through 192.168.1.198
On 192.168.1.198 set the rule

iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -d 192.168.10.0/24 -j MASQUERADE

Everything works, I can ping 192.168.10.0/24 from the network 192.168.1.0/24.

But on the contrary, from the network 192.168.10.0/24 I can’t ping 192.168.1.0/24

What needs to be tweaked?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Psq, 2017-10-06
@Psq

Most likely, the route to the network 192.168.1.0/24 is not specified on your server and the network at the other end simply does not know where to send packets.
Try adding
route 192.168.1.0 255.255.255.0 on the server # specify the subnet to which we will access via vpn
push "route 192.168.10.0 255.255.255.0" # pass the route to clients
This article has an example of connecting two offices...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question