Firewall port open but not reachable

Hello

I am trying to access a fedora 33 machine on the same LAN with my fedora 34 machine. I can use ssh to access the 33 from the 34. Telnet about ssh gives me:

telnet 192.168.1.77 22

Trying 192.168.1.77...
Connected to 192.168.1.77.
Escape character is '^]'.
SSH-2.0-OpenSSH_8.4

However it seems that I can not access a custom port that I opened. On my 33 machine I open the 7878 port like this:

[odorf@localhost ~]$ sudo firewall-cmd --permanent  --zone=FedoraWorkstation --add-port=7878/tcp
success
[odorf@localhost ~]$ sudo firewall-cmd --reload
success
[odorf@localhost ~]$ sudo firewall-cmd --list-all
FedoraWorkstation
  target: default
  icmp-block-inversion: no
  interfaces: 
  sources: 
  services: dhcpv6-client mdns samba-client ssh
  ports: 1025-65535/udp 1025-65535/tcp 7878/tcp 7878/udp
  protocols: 
  masquerade: no
  forward-ports: 
  source-ports: 
  icmp-blocks: 
  rich rules: 

I was afraid that it was due to selinux, so I disabled it but the problem still persists.
Even on the same machine, the 33, I get this:

[odorf@localhost ~]$ nc -zv 127.0.0.1 7878
Ncat: Version 7.80 ( https://nmap.org/ncat )
Ncat: Connection refused.

[odorf@localhost ~]$ telnet 127.0.0.1 7878
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused

The same happens when I try to access the 33 from the 34:

[odorf@phoenix tmp]$ nc -zv 192.168.1.77 7878
Ncat: Version 7.80 ( https://nmap.org/ncat )
Ncat: Connection refused.

[odorf@phoenix tmp]$ telnet 192.168.1.77 7878
Trying 192.168.1.77...
telnet: connect to address 192.168.1.77: Connection refused

[odorf@phoenix tmp]$ nc -zv 192.168.1.77 22
Ncat: Version 7.80 ( https://nmap.org/ncat )
Ncat: Connected to 192.168.1.77:22.
Ncat: 0 bytes sent, 0 bytes received in 0.01 seconds.

I honestly, have no idea what is happening. Any help would be appreciated

Are you sure that whatever you are trying to connect to is listening on port 7878?

1 Like

No, but even if there is nothing there to listen, shouldn’t the ports be displayed as reachable? I am trying to debug a custom server of mine, but before that, I have to be absolute certain that the port is reachable, connectable and working.

I don’t think so. Without something listening on the port, there is nothing to connect to.

Even if it isn’t your custom server, you could set something else to listen on port 7878 for testing purposes.

1 Like

Hm, you are right. I changed the ssh port to 7878 and it works. So it’s not the port’s problem. Thank you for the help.

1 Like