Bootstrap FreeKB - Firewalld - firewall-cmd - reload firewalld
Firewalld - firewall-cmd - reload firewalld

Updated:   |  Firewalld articles

If you are not familar with firewalld and the firewall-cmd, check out our Getting Started article.

The --reload flag will reload the latest firewalld configuration, like this.

firewall-cmd --reload

 

Let's say the --list-all command returns the following.

~]# firewall-cmd --list-all
public
  target: default
  icmp-block-inversion: no
  interfaces: eth0
  sources:
  services:
  ports:
  protocols:
  masquerade: no
  forward-ports:
  sourceports:
  icmp-blocks:
  rich rules:

 

And then you use the --add-port option to allow TCP connections to port 12345, but you did not include the --permanent flag.

firewall-cmd --add-port=12345/tcp

 

At this point, the firewall is setup to allow TCP connections to port 12345.

Let's say the --list-all command returns the following.

~]# firewall-cmd --list-all
public
  target: default
  icmp-block-inversion: no
  interfaces: eth0
  sources:
  services:
  ports:
  protocols: 12345/tcp
  masquerade: no
  forward-ports:
  sourceports:
  icmp-blocks:
  rich rules:

 

However, if you --reload the firewall . . .

firewall-cmd --reload

 

Now the firewall is no longer configured to allow TCP connections to port 12345.

~]# firewall-cmd --list-all
public
  target: default
  icmp-block-inversion: no
  interfaces: eth0
  sources:
  services:
  ports:
  protocols:
  masquerade: no
  forward-ports:
  sourceports:
  icmp-blocks:
  rich rules:



Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 1cd750 in the box below so that we can be sure you are a human.