I am running application on 192.168.196.199:8080 on local PC. This application is accessible inside GCP VM using Zerotier interface i.e:
curl 192.168.196.199:8080
Generates Some Response
GCP VM has following interface IPs:
Zerotier: 192.168.196.82
Internal IP: 10.128.0.11
Gateway: 10.128.0.1
I want application to be accessible through 10.128.0.11:8080. I tried googling and most of them were related to iptables. I tried following, but it failed to achieve my goal:
sudo iptables -t nat -A PREROUTING -p tcp -d 10.128.0.11 --dport 8080 -j DNAT --to-destination 192.168.196.199:8080
sudo iptables -t nat -A POSTROUTING -p tcp -d 192.168.196.199 --dport 8080 -j SNAT --to-source 10.128.0.11:8080
Please help me out here, I'm stuck. Thanks. Network Demonstration Here