2

I have setup port forwarding successfully before, but this time it just won't work.

I am using a WRT54G v6 Router, with the latest firmware. In the port forwarding section, I have set the port range 7000-7100 to get forwarded to the LAN ip 192.168.1.106, which is my computer. I have also setup my computer's network connection to use always the ip mentioned above, as in a static ip configuration.

However, when I test if e.g. port 7050 is open, I always get it is closed from websites like http://www.yougetsignal.com/tools/open-ports/ .

What could be causing the problem?

1 Answers1

4

Testing a forwarded port will only show a success if there is a "listener" on IP address you are forwarding the ports to that can accept the connection on the port.

So the first thing to do is start the application that will be connected to, and ensure it is listening on the port. You can do this with

netstat -an 

You should see something like

Proto  Local Address          Foreign Address        State
TCP    0.0.0.0:7050            0.0.0.0:0              LISTENING

If just starting the client isn't enough to get the listener running, then you can use netcat:

nc -l 7050

Make sure this works from within your network, if you can. An easy way would be from another machine that has telnet installed, with the following command:

telnet 192.168.1.106 7050

If it succeeds, and is a windows device you are testing from, you'll just see a flashing cursor. If it fails, then you'll get returned to the command line instantly, or get a time out. nmap is an alternative tool you can use to test.

Once you are certain that the PC is accepting connections on the port, then try the external testing service.

If possible, test from an external linux box. Ensure that you can ping the public IP of your router (you may need to enable this in the configuration of the router) then do the following from the linux box:

traceroute -I <public ip>
traceroute -p 7050 -T <your public IP>

The first traceroute will use ICMP to trace to your router, which should work if you have enabled ping on the router. The second one will either work, or stop at some point before your router. If it is the immediate hop before the router (as compared to the ICMP traceroute) then your router is not correctly forwarding. If it is earlier, then it means your ISP is blocking the incoming connection.

Paul
  • 61,193