0

I would like to set up a two hop VPN due to the network connection reliability, i.e. A=>B=>C=>Internet. A,B and C are at different locations on Internet. Currently, the tunnel between A and B is through OpenVPN (B as OpenVPN server on interface tun0 with ip 10.8.0.1, A as OpenVPN client with ip 10.8.0.2). B and C are currently connected via PPTP(C as the pptp server on interface ppp0 with ip 10.0.0.1, B using pptp-linux as pptp client on interface ppp0 with ip 10.0.0.235). What iptables rule do I need to add on B and C? Currently I have tried this on B

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

with this on C

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

But it does not work as expected. What else do I need for the iptables or the openvpn or pptp configurations? Thank you very much for all your help

  • 1
    Note that iptables doesn't route. Adding a postrouting (meaning after routing decision was made) rule with ppp0 in it won't magically make traffic that is going elsewhere suddenly go through ppp0. That's the role of routing to choose what to do. So your question should include routing informations to *maybe* help somebody solve your case. – A.B Mar 10 '20 at 22:47
  • @A.B that is correct, but probably not helpful. IPtables IS used in conjunction with routing tables to make decisions - and in this case rewrites the from address so that other servers don't need to know the internal routes (although I would not be doing it this way) – davidgo Mar 11 '20 at 03:59
  • @davidgo *if* the other server receives the traffic, which I'm not sure at all and which is why I was asking for routing informations. – A.B Mar 11 '20 at 09:17

0 Answers0