Not sure which firewall is running

Issues related to configuring your network
Post Reply
spud
Posts: 3
Joined: 2017/09/19 12:27:11

Not sure which firewall is running

Post by spud » 2017/09/19 12:38:47

I'm on a CentOS 7 VPS. After installation, ports 22, 80, 8080 were immediately available from the outside, but port 8090 is blocked.
When I try to add an exception to firewalld, I get

Code: Select all

$ firewall-cmd --add-port=8090/tcp
FirewallD is not running
$ systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:firewalld(1)
I have also tried

Code: Select all

sudo iptables -I INPUT -p tcp --dport 8090 -j ACCEPT
sudo iptables -I FORWARD -p tcp --dport 8090 -j ACCEPT
sudo iptables -P OUTPUT ACCEPT
to no avail.

How do I find out which firewall is blocking the port?

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Not sure which firewall is running

Post by TrevorH » 2017/09/19 12:53:44

Well for a start you cannot trust the output of firewall-cmd or systemctl if not run as root. Rerun your commands as root and see if you get the same results. If systemctl status firewalld reports it not running when you are root then it isn't running so the remaining alternative is that you are using iptables-services - try iptables-save.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

spud
Posts: 3
Joined: 2017/09/19 12:27:11

Re: Not sure which firewall is running

Post by spud » 2017/09/19 21:19:00

Ok,

Code: Select all

sudo iptables-save
did it for me.

Thanks!

spud
Posts: 3
Joined: 2017/09/19 12:27:11

Re: Not sure which firewall is running

Post by spud » 2017/09/21 13:45:00

Now I have a problem opening up several ports.
The following opens up 8090 for me:

Code: Select all

sudo iptables -I INPUT -p tcp --dport 8090 -j ACCEPT
sudo iptables -I FORWARD -p tcp --dport 8090 -j ACCEPT
sudo iptables -P OUTPUT ACCEPT
sudo iptables-save
The following, however, opens up no ports after restart.

Code: Select all

sudo iptables -I INPUT -p tcp --dport 8090 -j ACCEPT
sudo iptables -I FORWARD -p tcp --dport 8090 -j ACCEPT
sudo iptables -I INPUT -p tcp --dport 8095 -j ACCEPT
sudo iptables -I FORWARD -p tcp --dport 8095 -j ACCEPT
sudo iptables -P OUTPUT ACCEPT
sudo iptables-save

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Not sure which firewall is running

Post by TrevorH » 2017/09/21 14:00:34

sudo iptables-save doesn't do what you think it does. It just prints the rules, it doesn't save them. Use service iptables save to do that.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply