2

I have 2 openvpn instances on one server (TCP and udp). One has clients in subnet 10.8.0.0/24 and another 10.8.1.0/24. Server IPs are 10.8.0.1 and 10.8.1.1:

openvpn server with 2 instances and 2 clients

Is it possible to ping 10.8.0.2 client from 10.8.1.2 client?

  1. I added route to 10.8.0.0/24 on 1.2 client via 10.8.1.1 so ping packets with dst 10.8.0.2 address should go to openvpn server and come from tun1 interface.

  2. I also enabled net.ipv4.ip_forward=1 in sysctl.conf and rerun sysctl --system.

  3. Then I configured iptables to forward:

    iptables -A FORWARD -i tun1 -o tun0 -s 10.8.1.0/24 -d 10.8.0.0/24 -j ACCEPT
    iptables -A FORWARD -i tun0 -o tun1 -s 10.8.0.0/24 -d 10.8.1.0/24 -j ACCEPT
    

But still it does not work... I am missing something...


Also need to add analogical route on other client!

  • 1
    Does 10.8.0.2 have a route to 10.8.1.0/24 via the server? You will have to add routes both ways. – Teun Vink Jun 22 '16 at 8:02
1

Answer is that I were needed to add route on both clients

  • Leaving it here for others: Also on server, do not forget to enable net.ipv4.ip_forward = 1 in /etc/sysctl.conf. Also check your firewall rules. – jiri.ohnheiser Nov 1 '17 at 23:37

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.