I can´t connect to a port that is listening


#1

I created a server that can receive data from any interface. This code runs perfect, because I´ve been using it for three months. But eventually I can´t connect to this port, it is only possible to reach it from 127.0.0.1.

I have done a netstat and I can see that it is all ok:
tcp 0 0 0.0.0.0:50010 0.0.0.0:* LISTEN

The only different thing that I did is to upgrade to legato 16.10.3, but then I have downgrade to 16.10.1 and is still not working.

Any ideas?


#2

I´ve just downgraded to Legato 16.10.1 to try again. this time it works, so it seems a issue of legato 16.10.3


#3

Hi @Luis,

the distribution with 16.10.3 is a bit more secure by default and doesn’t allow much connections from the ethernet to the target.
The firewall (iptables) has been configured with pretty tight default rules.
You need to update iptables rules in /etc/iptables/rules.v4 (or/and .v6 for IPv6) to list the ports that you want to allow.

In your case I assume it would look something like:

# Allow TCP port 50010 for app X
-A INPUT -i eth0 -p tcp -m tcp --dport 50010 -j ACCEPT

#4

Thanks for your reply @CoRfr

It has been very useful