I have a question regarding OpenVPN and Linux NATing.
OpenVPN server (10.0.0.1) <--> (10.0.0.9) OpenVPN client (192.168.0.1) <--> (192.168.0.0/24) Internal LAN
I have set up a basic iptables rule on the client that says
/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE. With this, I can ping from the server to the internal LAN. However, when I look at the tcpdump on the server side, I see the internal LAN IP. I need to see the 10.0.0.9 IP of the OpenVPN server for classification reasons so I know where it went. Is there a way I can do another NAT on the return traffic so when the server sees the ping response, it comes from the 10.0.0.9 IP instead of the 192.168.0.X IP?
Thanks for your help.
Edit - I thought I would be able to do something like this but it doesn't seem to be working.
/sbin/iptables -t nat -A POSTROUTING -o tun0 -j SNAT --to-source 10.0.0.9