The Red Hat firewall

From MyWiki
Revision as of 10:57, 12 May 2016 by George2 (Talk | contribs)

Jump to: navigation, search

less /etc/sysconfig/system-config-firewall
The configuration for firewalld is stored in various XML files in /usr/lib/firewalld/ and /etc/firewalld/. This allows a great deal of flexibility as the files can be edited, written to, backed up, used as templates for other installations and so on.
systemctl status firewalld

iptables-save
service firewalld stop
service firewalld start
systemctl disable firewalld
systemctl enable firewalld
firewall-cmd

Reference - https://www.certdepot.net/rhel7-get-started-firewalld/

firewall-cmd --permanent --zone=trusted --add-source=192.168.2.0/24
firewall-cmd --reload
firewall-cmd --zone=trusted --list-sources
Note: Add the –permanent option if you only want to display permanent settings.

Example

firewall-cmd --zone=internal --add-service=ssh --permanent
firewall-cmd --zone=internal --add-source=1.2.3.4/32 --permanent
firewall-cmd --zone=public --remove-service=ssh --permanent
firewall-cmd --reload