0

When i use;

nc -v 151.XXX.240.227 9001

on my Centos server, i get

nc: connect to 151.XXX.240.227 port 9001 (tcp) failed: Connection timed out

In my Windows 7 computer, Tcpview shows that port 9001 is listening, i also forwarded port 9001 from my router.

How can i debug this connection problem?

Thanks

EDIT

The problem was with the router port forwarding, in port forwarding i was using my own ip as client, changing it to ipv4 that i found with ipconfig command in cmd solved the problem.

6
  • Is your port opened 9001? May 3, 2013 at 10:58
  • I think so, how can i be sure? I also tried with canyouseeme.org and it also cant connect to my ip on port 9001. It says Error: I could not see your service on 151.2XX.240.227 on port (9001) Reason: Connection timed out May 3, 2013 at 11:07
  • On your windows box check firewall and make sure you have opened port 9001 in outbound and inbound. May 3, 2013 at 11:34
  • Thats what i am asking here hoping to get help how to do it. May 3, 2013 at 11:40
  • CentOS has quite restrictive default iptables ruleset. Try turn off iptables and check whether it helps.
    – user172266
    May 3, 2013 at 11:54

1 Answer 1

0

Here is how to open both Windows Firewall incoming 9001, and iptables outbound 9001.

Linux

iptables -A OUTPUT -p tcp -d 151.XXX.240.227 --dport 9001 -j ACCEPT

Windows

netsh advfirewall firewall add rule name="Open Port 9001" dir=in action=allow protocol=TCP localport=9001
3
  • I runned first command in server and I runned 2. command in windows cmd and it answered : Ok but still i get Connection timed out error May 3, 2013 at 12:16
  • still i get Connection timed out error from nc command but in canyouseeme.org the error changed from connection timed out to Error: I could not see your service on 151.250.235.47 on port (9001) Reason: Connection refused , in tcpview it shows phpstorm is listening on port 9001 which is correct May 3, 2013 at 12:22
  • Do you have the ports opened on your router also? May 5, 2013 at 11:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .