There are some reasons when you have two or more instances on one server.

Assume that:

  • Clients of the first instance are in
  • Clients of second in
  • Server IPs is (tun0 interface) and (tun1).
  • Each network has clients and

2 instances of OpenVPN

Task is allow ping between and .

Add routes

On we need to add route to network via IP

Knowing this OS will forward packets with IP 10.8.0.ххх to, so they will go to server and appear on tun1.

1st way to make it manually

1st way to make it manually, e.g. if Client 2 run Windows:

route -p add mask

Same thing with Client 1, e.g. if it runs Linux:

route add -net netmask gw

This is not the cool way because it needs performing manual actions on clients and after reboot, changes will be lost.

2nd and correct way is to use automatic routes

We need to configure them with push "route х.х.х.х mask" option.

For network OpenVPN config we need to add:

push "route"

In this case, when Client 2 will connect to OpenVPN it will automatically do things that we performed manually. Add the same line but with route to another config.

IP Forward in sysctl

Add (or uncomment) next to /etc/sysctl.conf


and reload it:

sysctl --system


The last thing: change iptables on the server:

iptables -A FORWARD -i tun1 -o tun0 -s -d -j ACCEPT
iptables -A FORWARD -i tun0 -o tun1 -s -d -j ACCEPT

Also, take care of persistent saving iptables settings.