当我试图向FirewallsD添加一个端口时,我会得到以下异常:
centos 7 answer FirewallD is not running当我试图重新装载
sudo firewall-cmd --reloadcentos 7回答:当我尝试从
sudo firewall-cmd --startcentos 7回答FirewallD没有运行
我能做什么?
发布于 2020-07-25 10:43:08
遵循下面的步骤,用于在centos 7中默认安装firewalld服务。
首先:firewalld是在centos 7中预先安装的。如果没有安装firewalld,请安装它.若要验证和安装,请发出以下命令。
rpm -qa firewalld
# expected output: firewalld-0.6.3-2.el7_7.2.noarch
# if not installed, install it
yum install firewalld第二:firewalld主要作为服务运行。检查主机上是否存在服务。
ll /usr/lib/systemd/system | grep firewalld
# expected output: -rw-r--r-. 1 root root 674 Jan 30 2018 firewalld.service
# OR
ll /etc/systemd/system | grep firewalld第三:验证防火墙服务是否已运行并启用。
如果服务正在运行且未启用,则每次重新启动都会将其关闭。使用下面的命令。
# check the status of the service (running and enabled)
systemctl status firewalld
# if the service is not running, start it
systemctl start firewalld
# if the service has exited, restart it(check for error if any)
systemctl restart firewalld
# if the service is not enabled, enable it
systemctl enable firewalld发布于 2021-07-06 07:20:37
首先通过以下命令检查firewalld状态:
sudo systemctl status firewalld如果得到输出Active: active,那么运行以下命令:
sudo systemctl enable firewalld但--如果得到输出Active: inactive (dead)或Loaded: masked (/dev/null; bad),请执行以下命令:
sudo systemctl unmask --now firewalld输出应该指示symlink has been removed。然后运行以下命令:
sudo systemctl enable firewalld启用防火墙后,启动firewalld服务:
sudo systemctl start firewalld当系统执行命令时,没有输出。因此,明智的做法是验证防火墙是否已被成功激活。
使用以下方法检查防火墙状态:
sudo systemctl status firewalld如果您看到了Active: active (running)消息,现在您可以做您想做的事情了。
发布于 2021-03-15 08:22:48
首先安装并启动消防服务
sudo yum install -y firewalld
sudo systemctl start firewalld 然后开始使用防火墙-cmd命令添加规则。使用--永久标志在系统重新启动后保持更改。
如果使用远程ssh访问,则可能必须打开SSH服务。
最后,使用新的配置更新firewalld。
sudo firewall-cmd --reloadhttps://stackoverflow.com/questions/63085297
复制相似问题