Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

migrated from serverfault.com Jan 15 '12 at 9:07

This question came from our site for professional system and network administrators.

    
Is port 7050 open? You can test this using telnet localhost 7050 –  artistoex Jan 15 '12 at 9:59
    
Is the port open on the PC's firewall as well? –  Ƭᴇcʜιᴇ007 Jan 15 '12 at 16:55
    
Yes, the port is open and accessible from the host computer –  Wolter Hellmund Jan 15 '12 at 20:30

1 Answer 1

up vote 4 down vote accepted

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.

share|improve this answer
    
Well I was not aware of that a listener was required haha. Anyway, I have Transmission listening on port 7001, so I used that port instead. The telnet command works great from my computer, but I have not been able to test it from another computer in the network. I will let you know when I can, and the results. Thank you for your help! –  Wolter Hellmund Jan 15 '12 at 20:24
    
I think I managed to connect from another computer. I used a Windows computer this time, and its native telnet client. I connected to the port 7001, and then the cmd went black. I could write, but the text didn't get rendered. Then I hit the escape character and exited telnet. However, there was never a report of a connection failure. I tried using another port, and I did get an error. –  Wolter Hellmund Jan 16 '12 at 21:18
    
I have just completed an additional test: I opened a connection from my host with nc -l 7002 and connected to it successfully from the other computer. I sent some text, and the text was received. My host is opening the ports correctly. –  Wolter Hellmund Jan 16 '12 at 21:28
    
No, just in my network. –  Wolter Hellmund Jan 17 '12 at 0:01
    
The traceroute stops at an ip which is in my country but is not my router. It may belong to my ISP. Do you think its necessary for me to post the traceroute output? –  Wolter Hellmund Jan 17 '12 at 1:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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