User Tools

Site Tools


networking:firewall:firewalld

This is an old revision of the document!


FirewallD

Firewall Status and Control

firewall-cmd --state

firewall-cmd --reload

firewall-cmd --complete-reload

firewall-cmd --get-zones

firewall-cmd --get-default-zone

firewall-cmd --get-services

firewall-cmd --get-services

firewall-cmd --get-icmptypes

firewall-cmd --list-all-zones

firewall-cmd --zone=public --list-all

Allow a Service

Allow HTTP and HTTPS to a web server:

firewall-cmd --permanent --zone=public --add-service=http --add-service=https
firewall-cmd --reload

Change SSH Port

:!: You may need to install management tools for selinux:

yum -y install policycoreutils-python

Change the port in the SSH daemon configuration:

vim /etc/ssh/sshd_config

Fix selinux RBAC:

semanage port -a -t ssh_port_t -p tcp 2222

Modify the firewall:

firewall-cmd --permanent --zone=public --add-port=2222/tcp
firewall-cmd --reload

Restart the SSH service:

systemctl restart sshd.service

netstat -tapn
networking/firewall/firewalld.1437082084.txt.gz · Last modified: 2015/07/16 15:28 by gcooper