Okay, can we go back to those iptables commands?
iptables -t nat -A PREROUTING -d {VPS_PUBLIC_IP}/32 -p tcp -m tcp --dport {PORT} -j DNAT --to-destination {VPN_CLIENT_ADDRESS}
iptables -t nat -A POSTROUTING -s {VPN_SUBNET}/24 -o eth0 -j MASQUERADE
Just to confirm, is the -o eth0
in the second command essentially the interface where all the traffic is coming in? I’ve setup a quick Wireguard VPN with Docker, setup the client so that it routes ALL traffic through the VPN. Doing something like curl ifconfig.me
now shows the public IP of the VPS… this is good. But it seems like the iptables command aren’t working for me.
Would this work for my use case? I just want a service to be able to see the real source IPs but still going through a proxy