大网数据广告活动
服务器运维问答

Missing firewallD in CentOS 7 VPS

· 52CE 我爱测

i fresh installed CentOS 7 in a OVH VPS. but when i ran the command firewall-cmd i got this: -bash: firewall-cmd: command not found so i was looking how resolve that and i saw that basically i needed to install it. So I was tryin…

问题原文

原帖链接 · DiogoSaraiva · CC BY-SA 3.0

i fresh installed CentOS 7 in a OVH VPS. but when i ran the command firewall-cmd i got this:

-bash: firewall-cmd: command not found

so i was looking how resolve that and i saw that basically i needed to install it.

So I was trying to fully disable iptables with: systemctl mask iptables but i received a error that i strange because i was running as root:

Failed to execute operation: Access denied

I tried the following commands too before:

[root@vps****** ~]# systemctl status iptables
● iptables.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)

and

[root@vps****** ~]# systemctl stop iptables
Failed to stop iptables.service: Unit iptables.service not loaded.

so i thought that iptables was not installed as well but when i run the command iptables --version i get iptables v1.4.21 so i guess it it installed...

So, what is causing iptables not be recognized with systemctl and why firewallD is not installed as default?

some people have similar problem because OpenVZ, but OVH don't use OpenVZ anymore...

system info:

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) 

已采纳解答

原帖链接 · dr_ · CC BY-SA 3.0

I think I remember having seen something peculiar on OVH's VPS. In my case, if I remember well, everything was compiled into the kernel -- there were no kernel modules loaded dynamically.

In your case you don't need to bother disabling iptables -- I'm not even sure that you can, since firewalld uses iptables underneath. Simply install and configure firewalld and you'll be fine.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-04-25)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。