I want to know if there is a way to redirect all incoming and outgoing traffic of a public IP (Say to an internal IP (Say, 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 from ` 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

I have used the following in the past.

netsh interface ipv4 add route metric=10 12 is the destination.

12 is the interface name/number 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

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 is the IP of Google.com. I want to map this IP to, so that, when I enter 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.