RHEL/firewalld
< RHEL
List Ports
Add Port
firewall-cmd --add-port=80/tcp --permanent firewall-cmd --reload
Notes
Firewall
Show running status:
systemctl status firewalld # or firewall-cmd --state
Show open services (and associated ports):
firewall-cmd --get-services # cockpit dhcpv6-client http https ssh
Show explicit ports added:
firewall-cmd --list-ports
Open ports now (temporary):
firewall-cmd --zone=public --add-service=http firewall-cmd --zone=public --add-service=https
Add specific port:
firewall-cmd --zone=public --add-port=27000/tcp # flexlm lmgrd service
ref: [1]
--
Open ports now (temporary):
firewall-cmd --zone=public --add-service=http firewall-cmd --zone=public --add-service=https firewall-cmd --zone=public --add-port=27000/tcp # lmgrd
Add to startup script (persistent - does not alos open):
firewall-cmd --zone=public --add-service=http --permanent firewall-cmd --zone=public --add-service=https --permanent firewall-cmd --zone=public --add-port=27000/tcp --permanent # lmgrd
If you didn't use the --permanent, to save:
firewall-cmd --runtime-to-permanent
ref: [2]