1.RHEL7 防火墙设置:
Checking if the firewall is running
To check if the firewall is running, login as user root, and enter the command:firewall-cmd --state.The returned state should be: running
Alternatively, use the systemctl utility:login as user root, and enter the command:systemctl is-active firewalld.The returned state should be: active
Stopping the firewall
To stop the firewall, login as user root, and enter the command:systemctl stop firewalld
To check that the firewall is not running, enter the command:firewall-cmd --state.The returned state should be: not running
Starting the firewall
To start the firewall, login as user root, and enter the command:systemctl start firewalld.
To check that the firewall is running, enter the command:firewall-cmd --state.The returned state should be: running
Disabling the firewall
To disable the firewall, so that it does not start on booting the system, login as user root, and enter the following command:systemctl disable firewalld
The following output is displayed
rm '/etc/systemd/system/basic.target.wants/firewalld.service'
rm '/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service'
To check that the firewall is disabled, enter the command:systemctl is-enabled firewalld.The returned state should be: disabled
Enabling the firewall
To enable the firewall, so that it starts after booting the system, login as user root, and enter the following commands:systemctl enable firewalld
The following output is displayed
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 check that the firewall is enabled, enter the command:systemctl is-enabled firewalld.The returned state should be: enabled
2.RHEL5 防火墙设置:
1)Log in as root.
2)In a terminal window type:system-config-securitylevel
3)In the Security Level Configuration tool, select Disable Firewall as shown below.
4)Confirm and save the new configuration by clicking Yes. The tool will be closed.