How to allow port with firewalld

#firewalld #linux #security #cli

  1. (optional) Check the current status of the firewall
sudo firewall-cmd --state
sudo firewall-cmd --list-ports
  1. Allow the port
sudo firewall-cmd --zone=public --add-port=[port_number]/tcp --permanent
  1. Reload the firewall
sudo firewall-cmd --reload