I'm trying to set up a simple server to be accessible from the Internet. To do so, I have opened port 8080 by executing the following command:
$ sudo firewall-cmd --zone=public --add-port=8080/tcp --permanent
When I try to connect to my server by executing:
$ telnet my-external-ip 8080
telnet: connect to address my-external-ip: Connection refused
I have no problem when I connect to my server using local address, i.e. I can connect to http://localhost:8080/
I'm behind router but I set correct forwarding. I use CentOS Linux 7.
When I run
$ ss -tnlp |grep 8080
LISTEN 0 128 :::8080 :::* users:(("java",pid=6836,fd=309))
UPDATE As user Paul H. suggested in the comments, the reason behind why I couldn't connect is that my router doesn't allow for NAT loopback. My configuration of Linux was OK.