Active1 year, 4 months ago
I received a request from one of our developers that I am having trouble solving.
If you could change the servers ip address to another in the loopback reserved address space 127.0.0.0/8, then you probably wouldn't be attempting to set ports in the hosts file. Possible solution. You can work around this using Windows included Networking tool netsh as a port proxy. Windows 7 Forums is the largest help and support community, providing friendly help and advice for Microsoft Windows 7 Computers such as Dell, HP, Acer, Asus or a custom build. I was tired when 50th result in google named 'port forwarding' was actually question how to open port.
Here in the office they use linux desktops and I can forward the localhost:80 via a iptables nat to localhost:8080. What they want is the same thing at home in windows 7.
I got what I think are two ways of going about this. One to reconfigure the jboss webserver and all the webapps urls (messy). The other is find a way to redirect/nat the localhost port 8080 to port 80. Though in windows 7 I am unsure of how to do this.
Anyone have anyideas on how to do the second?
bdavenport
bdavenportbdavenport
3 Answers
AFAIK, Win7 has no iptables equivalent. Writing a server that does what you want (listens on a port, copies everything to/from another) should be easy enough. You can find one at this URL: http://www.quantumg.net/portforward.php (untested). Using a reverse proxy (Google is yout friend) may fit the bill for http-like traffic. Also check this post: https://stackoverflow.com/questions/3721000/port-forwarding-on-windows-7
Community♦
Alien Life FormAlien Life Form
Yes, windows does have a iptables equivalent, it is via the tool netsh and the portproxy interface.
The command to do what you want would be
Note, that this will only do IPv4 connections, if you also want to forward IPv6 connections you would also need to do
Scott ChamberlainScott ChamberlainPort Forwarding In Windows
99222 gold badges1717 silver badges3636 bronze badges
I think Windows has no iptables equivalent. Command
do port proxying but not packet forwarding. The main difference is
- performace is much worse than iptables (f.e. see https://plus.google.com/+OlafMonien/posts/fsjUjropYeR)
- source IP address is changed to localhost (127.0.0.1 or ::1 depends on IP version), you loose original request source IP address.
We had been using this technique to port forwarding but after those findings we had to use extra rules on network firewall to avoid usage of netsh.
Port Redirection Windows 10
MartinMartin