I can't open a port

Hello. I am currently trying to open port 19132 on my clean dedicated machine, but I can’t get it working. Here are things I have tried:

  1. After installing Virtualmin, I tried to open port 19132 on iptables and firewalld by using these commands respectively:

    firewall-cmd --zone=public --permanent --add-port=19132/tcp
    iptables -A INPUT -p tcp -m tcp --dport 19132 -j ACCEPT

  2. I am using Hetzner’s dedi, so I tried to open all of the ports in their control panel so that there’s one less thing to worry about.

And these are things I’ve noticed:

  1. On a fresh server with nothing installed, port 22 is the only thing that is open on my machine. (Or at least amongst common ports)
  2. After installing Virtualmin only, number of ports were opened, like 80 and 443.
  3. lsof -i :19132 suggests that the server is listening to port 19132
  4. Despite doing all above, online port check tools suggest that port 19132 is closed.

What am I missing? What do I have to do in order to open a port?
Also, as I mentioned on the things I’ve noticed, Virtualmin was able to open ports on its own during installation. How can it do that?

Could be that Hetzner are blocking the port in the data centre. I know I’ve had to ask data centres to open non-standard (or at least lesser used) ports before.

Craig

Hi,

You don’t need to use iptables command if you use firewalld-cmd, as it under the hood uses same iptables.

You need to make sure that the zone you are modifying (public in your case) is actually set as an active zone.

Also, as I mentioned on the things I’ve noticed, Virtualmin was able to open ports on its own during installation. How can it do that?

Have you restart it after applying the change? It may vary but it’s never bad to reload the service which you currently modifying/working on.

Read related Q/A.

5 Useful Examples of firewall-cmd command.

is it by any chance listening to loopback ip only?
do you see “*:19132 (LISTEN)” on lsof output ? or something like “localhost:19132 (LISTEN)” ?

Just incase this is related to OS version - I noticed a difference between Ubuntu and CentOS firewalld settings on fresh installs.