RHEL7 &RHEL5 设置防火墙

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 防火墙设置:

1Log in as root.

2In a terminal window type:system-config-securitylevel

3In the Security Level Configuration tool, select Disable Firewall as shown below.

              ​

4Confirm and save the new configuration by clicking Yes. The tool will be closed.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值