centos7 - 防火墙未运行
问题描述
当我尝试向 FirewallsD 添加端口时,出现以下异常:
centos 7 answer FirewallD is not running
当我尝试重新加载时
sudo firewall-cmd --reload
centos 7 answers 当我尝试开始时 FirewallD 没有运行
sudo firewall-cmd --start
centos 7 answers FirewallD 没有运行
我能做些什么?
解决方案
按照以下步骤firewalld
在centos 7中默认安装服务。
首先: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
第三:验证 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
推荐阅读
- sql - DB2 无法从内部查询中选择不同的列值
- flurl - Flurl:呼叫失败,状态码为 308(永久重定向),但没有自动重定向
- wso2 - wso2 微网关 x-wso2-disable-security=true 禁用节流
- php - Google Firebase 推送通知未与图像一起发送
- java - 使用带和不带 times(1) 参数的 verify() 方法
- google-cloud-platform - 使用 Google Cloud 计算库创建新地址时在结果中找不到外部 IP
- java - 如何在 Java 的可变持续时间内逐渐倒数到零?
- git - 如何将文件添加到git中的现有存储?
- javascript - 为什么我的日期打印错误使用 Intl.DateTimeFormat?
- angular - Angular NgZone.runOutsideAngular 和 OnPush 变化检测策略