Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

port forwarding in windows

I have two network board in my pc:

The main one has the local ip -> 192.168.1.111 The secondary ones has the local ip -> 192.168.0.200

The main one has internet connection and the second one is connected to a device with the IP 192.168.0.33, it has a http server in port 80.

I have an apache-server in the main connection (port 4422), and I can access from anywhere, what I want now is when I detect a connection from 4422 i want to redirect this connection to 192.168.2.33:80

How can I do this with windows?

like image 364
user1256477 Avatar asked Jul 17 '12 15:07

user1256477


People also ask

How do I enable port forwarding on Windows?

Set Up Port Forwarding on WindowsIn the left pane, click “Advanced settings” to open the Firewall rules window. As port forwarding generally involves inbound traffic (i.e. traffic coming to your PC from a company's data centres or servers), click “Inbound Rules” in the left pane.

How do I port forward using CMD?

If your business doesn't have a port forwarding utility, you can use the Command Prompt to manually set up port forwarding. CMD uses the Netsh command to initiate the port forwarding process. To make this work, you need to know the port number and IP address for both the source and destination hosts.

What is port forwarding and how do I use it?

Port forwarding is a way of making your router use a specific port to communicate with certain devices. By setting a specific port for your devices, you are telling your router to always accept requests for those ports and forward data to a device's private IP address.


1 Answers

I've solved it, it can be done executing:

netsh interface portproxy add v4tov4 listenport=4422 listenaddress=192.168.1.111 connectport=80 connectaddress=192.168.0.33 

To remove forwarding:

netsh interface portproxy delete v4tov4 listenport=4422 listenaddress=192.168.1.111 

Official docs

like image 94
user1256477 Avatar answered Oct 21 '22 22:10

user1256477