我新安装了一个OVH VPS的CentOS 7。 但是当我运行命令firewall-cmd我得到这个:
-bash: firewall-cmd: command not found
所以我看着如何解决这个问题,我看到基本上我需要安装它。
所以我试图完全禁用iptables: systemctl mask iptables但我收到一个错误,我奇怪,因为我是以root身份运行:
Failed to execute operation: Access denied
我也试过以下命令:
[root@vps****** ~]# systemctl status iptables ● iptables.service Loaded: not-found (Reason: No such file or directory) Active: inactive (dead)
和
[root@vps****** ~]# systemctl stop iptables Failed to stop iptables.service: Unit iptables.service not loaded.
所以我认为iptables没有安装,但是当我运行命令iptables --version我得到iptables v1.4.21所以我想它安装…
那么,什么导致iptables不能被systemctl识别,为什么firewallD没有被默认安装?
有些人有类似的问题,因为OpenVZ,但OVH不再使用OpenVZ …
系统信息:
cat /proc/sys/kernel/osrelease 3.10.0-327.13.1.el7.x86_64
–
cat /etc/centos-release CentOS Linux release 7.2.1511 (Core)
我想我记得在OVH的VPS上看到了一些奇特的东西。 就我而言,如果我记得好的话,一切都被编译到内核中 – 没有dynamic加载的内核模块。
在你的情况下,你不需要打扰禁用iptables – 我甚至不知道你可以,因为firewalld使用下面的iptables。 只需安装和configurationfirewalld,你会没事的。