Need to install firewalld in your system, run the following command as root access,
Install:
# yum install firewalld
Also install this graphical user interface tool firewall-config,
# yum install firewall-config
Enable / Disable :
To enable a firewalld service to be started on bootup:
# systemctl enable firewalld.service
ln -s '/usr/lib/systemd/system/firewalld.service'
'/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service'
ln -s '/usr/lib/systemd/system/firewalld.service'
'/etc/systemd/system/basic.target.wants/firewalld.service'
To disable a firewalld service to be started on bootup:
# systemctl disable firewalld.service
rm '/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service'
rm '/etc/systemd/system/basic.target.wants/firewalld.service'
Start/Stop firewalld :
Start or stop or check the status of firewalld run the following commands,
# systemctl start firewalld
# systemctl status firewalld
# systemctl stop firewalld
# systemctl status firewalld
# systemctl stop firewalld
firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled)
Active: active (running) since Thu 2015-02-26 11:05:44 IST; 1s ago
Main PID: 5741 (firewalld)
CGroup: /system.slice/firewalld.service
├─5741 /usr/bin/python /usr/sbin/firewalld --nofork --nopid
└─6012 /usr/bin/python /usr/sbin/firewalld --nofork --nopid
Another command is firewall-cmd to connect to the daemon
# firewall-cmd --state
running
To know the interface assigned to a zone,
# firewall-cmd --zone=public --list-interfaces
p4p1
Also we can view the network zones currently active,
# firewall-cmd --get-service
amanda-client bacula bacula-client dhcp dhcpv6 dhcpv6-client dns ftp
high-availability http https imaps ipp ipp-client ipsec kerberos kpasswd ldap
ldaps libvirt libvirt-tls mdns mountd ms-wbt mysql nfs ntp openvpn pmcd
pmproxy pmwebapi pmwebapis pop3s postgresql proxy-dhcp radius rpc-bind samba
samba-client smtp ssh telnet tftp tftp-client transmission-client vnc-server
wbem-https
To reload the firewall with out interrupting user connections run below command,
# firewall-cmd --reload
success
To Check firewalld version :
# firewall-cmd --version
or
# firewall-cmd -V
or
# firewall-cmd -V
0.3.8
Help :
Do you know more information about firewall,
# firewall-cmd --help
Comments (0)