-1

I have a problem on my server when I start an application that listen to a port: I can connect to it from the same machine, but not from the ouside world. I noticed this problem when trying to create an irc bouncer with irssiproxy (I successfully did it on another server before). irssiproxy is supposed to listen to a port that I specify and another instance of irssi can connect to it. This works properly if I start another instance of irssi on my server, but it doesn't work from any other machine on the internet. (remark: I used successfully both 127.0.0.1 and the public ip when trying from the same machine).

First I was thinking that the problem came from my irssi setup, but I tried to listen to a port with netcat and to connect to it, and I had a similar issue:

nc -l -v -p XXXX

then from the same machine: telnet 127.0.0.1 XXXX (or telnet [public-ip] XXXX). In both case I successfully connected:

Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.

but doing the same from my home PC or another server (using the public ip this time ofc), I always end up with a timeout:

Trying XXX.XXX.XXX.XXX...
telnet: Unable to connect to remote host: Connection timed out

About my server: it's a dedicated server running on Debian (jessie that I upgraded from wheezy, but never really used before). I have a working apache2 on it, no problem to connect through port 80 even with telnet. The machine properly answers to ping as well.

I tried to run nc both from the root account and my user account.

I am not a Linux expert but is there anything that could prevent a port on which a program listen to to be accessed from outside?

Also, just in case there's a hint in it, when I start nc I always have this message: nnetfd reuseport failed : Protocol not available.

1 Answers1

0

The problem came from my iptables that were misconfigured. I fixed the problem by setting the input policy to ACCEPT:

iptables -P INPUT ACCEPT