I have a linux server running Centos7 that uses a VPN to route to a public IP homed in a remote network. I want to NAT from an IP address on that remote network to a local subnet over a VPN connection using PPP devices. When my tunnels come up, I can ping the 203.0.113.5 IP address from the public internet, but I can not seem to get the NAT statements to work correctly.
Map:
203.0.113.1 ROUTER TO INTERNET
|
|eth0 VPN Server Public Interface
-----------------------
|VPN Server |
-----------------------
203.0.113.2 VPN Public IP
||ppp0 Tunnel Virtual Device
||10.0.0.1/24 Tunnel Gateway IP
||
||
||10.0.0.10/24 Tunnel Client IP
||ppp0 Tunnel Client Device
198.51.100.129 Broadband Public IP
|eth0 Public Interface
-----------------------
|THIS SERVER |
-----------------------
eth1| |eth2
203.0.113.5/32 192.168.1.1/24
203.0.113.5 is a public IP. 192.168.1.1/24 is the private network. The VPN comes up with 10.0.0.0/24 network, and routing 203.0.113.5 via the Tunnel Client IP (and 203.0.113.0/30 via 10.0.0.1, default via 203.0.113.1) lets me ping 10.0.1.5 from the public internet. That is working, and I have confirmed it is THIS SERVER that is responding. I want to nat out the VPN, using the public IP 203.0.113.5. This doesn't seem, to work. I have tried the following NAT statements:
iptables -t nat -A POSTROUTING -s 192.168.1.1/24 -o ppp0 -j MASQUERADE --to-source 203.0.113.5
iptables -t nat -A POSTROUTING -s 192.168.1.1/24 -o ppp0 -j SNAT --to-source 203.0.113.5
I do not see and communication, I can not perform a name lookup, or a ping from machines in the 192.168.1.1 network.
Any advice would be appreciated