How to allow access to the server port?

Have Ubuntu server running npm-App on port 8000. On the server the App is working (can access using localhost:8000), but with the computers on the LAN at the address 10.0.1.33:8000 (server address) gives an error "timed out". As the server also runs Apache, and it is available in 10.0.1.33:80
July 9th 19 at 13:53
3 answers
July 9th 19 at 13:55
Solution
do netstat-tnlp
if there still is localhost
127.0.0.1:8000
so the server listens only to himself.
Alter the config to listen all 0.0.0.0
Then using iptables to give out access. for example, as shown by Vladimir only entry without OUTPUT
iptables -A INPUT -p tcp --dport 8000 -j ACCEPT
iptables -A INPUT -p udp --dport 8000 -j ACCEPT
OUTPUT is not needed if the connection comes from an external source. There are already data is transmitted in a state of established.
Yes, in principle this key is mainly used for Datirovaniya network.
Well, it's just in case, little if need be, in any case, it wouldn't hurt. Unless of course the server has no malware - Nikita20 commented on July 9th 19 at 13:58
July 9th 19 at 13:57
iptables -A INPUT -p tcp --dport 8000 -j ACCEPT
iptables -A OUTPUT-p tcp --dport 8000 -j ACCEPT
Iptables v1.4.21: unknown option "--dport" - Nikita20 commented on July 9th 19 at 14:00
: did not finish, sorry, I corrected the answer - Jermey_Kshlerin commented on July 9th 19 at 14:03
July 9th 19 at 13:59
It makes sense to look at the /etc/hosts file.allow
Syntax:
Service (all - all) : reclient : action (allow|deny)
Running the rule, which was first performed...

P. S. at least on freebsd it works

Find more questions by tags LinuxUbuntuNetwork administration