0

I want to know if there is a way to redirect all incoming and outgoing traffic of a public IP (Say 136.0.98.197) to an internal IP (Say 192.168.1.100), so that the incoming packets of the public IP go to the internal one, and the outgoing packets of the internal IP go to the public one.

The public IP belongs to my own PC, so there is no worry about security problems.

Here is a solution for Linux by iptables. I am not sure if this solution do the job for outgoing traffic and I also want to do this for Windows not Linux. There maybe some equivalent commands for netsh or powershell, but I am not much of a network technician!

  • If you want to forward traffic to 192.168.1.100 from `136.0.98.197 it has to be all traffic on that given port or (all ports in the case of a DMZ). You also would need a network device with this compatibility – Ramhound Jun 26 '17 at 21:19
0

I have used the following in the past.

netsh interface ipv4 add route 192.168.1.100/32 metric=10 12 136.0.98.197

192.168.1.100/32 is the destination.

12 is the interface name/number

136.0.98.197 is the gateway to get to the internal IP. I have used the IP you have given above as the example.

For outbound, the default gateway could take care of that, or you could do the opposite and use 0.0.0.0/0

NetSH TechNet

*note 2008R2 and 2012 seemed to change the way to do it. In the gateway section, for 2008 use the IP address of the server/NIC instead of the gateway IP. Not sure if the NetSh documentation reflects this change though.

Thanks, Tim.

  • didn't work! let me clarify, for example 172.217.9.14 is the IP of Google.com. I want to map this IP to 192.168.1.1, so that, when I enter 192.168.1.100 in Internet Explorer, it would be directed to Goolge.com. – user2548538 Jun 27 '17 at 13:47

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.