0

I have 22 servers, where all servers have IP Private 192.168.0.0/24.

I installed OpenVPN on ubuntu server, I want to access all server via IP Private 192.168.0.0/24 from my local laptop.

On the OpenVPN server, eth0 has an IP Public 183.121.31.42 and eth1 has an IP private 192.168.0.5.

I have run this command:

iptables -t nat -A POSTROUTING -o eth1 -s 10.8.0.0/24 -j MASQUERADE
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

But I still can't connect to all of my servers via IP Private.

5
  • where did 10.8.0.0/24 come from? is that your OVPN tunnel network? Commented Aug 14, 2020 at 6:52
  • Yes, 10.8.0.0/24 its my OVPN tunnel network @FrankThomas
    – Junos
    Commented Aug 14, 2020 at 7:02
  • Could you help me please ? @FrankThomas
    – Junos
    Commented Aug 14, 2020 at 7:20
  • It is marginal if enough information has been provided for us to help you yet. You say you have 22 servers on a /24, but is OpenVPN running on the router? Has that ubuntu Box been set up as a router (ie to forward packets)? Are you routing 192.168.0.0/24 down the tunnel? (ie what does your VPN clients route table look like?)
    – davidgo
    Commented Aug 14, 2020 at 8:00
  • Does the openVPN connection terminate on this box? if so, I think you should put the rule on the OpenVPN intereface and drop the source address specification. so iptables -t nat -A POSTROUTING -o <OpenVPN Interface> -j MASQUERADE Commented Aug 14, 2020 at 8:31

0

You must log in to answer this question.

Browse other questions tagged .