我在 OVH 上安装了一台装有 CentOS 7 的新服务器:
yum install firewalld
然后启用并重新启动
systemctl enable firewalld
reboot
我现在可以使用 ssh 登录,但防火墙没有出现
[root@~]# firewall-cmd --state
failed
[root@~]# firewall-cmd --get-default-zone
<empty line>
[root@~]# firewall-cmd --get-active-zones
<empty line>
[root@~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2019-12-05 16:49:13 CET; 7min ago
Docs: man:firewalld(1)
Main PID: 1989 (firewalld)
CGroup: /system.slice/firewalld.service
└─1989 /usr/bin/python2 -Es /usr/sbin/firewalld --nofork --nopid
Dec 05 16:49:13 systemd[1]: Starting firewalld - dynamic firewall daemon...
Dec 05 16:49:13 systemd[1]: Started firewalld - dynamic firewall daemon.
Dec 05 16:49:14 firewalld[1989]: ERROR: '/usr/sbin/iptables-restore -w -n' failed: iptables-restore v1.4.21: iptables-restore: unable to initialize table 'security'
Error occurred at line: 11...
Dec 05 16:49:14 firewalld[1989]: ERROR: '/usr/sbin/ip6tables-restore -w -n' failed: ip6tables-restore v1.4.21: ip6tables-restore: unable to initialize table 'security'
Error occurred at line: 11...
Dec 05 16:49:14 firewalld[1989]: ERROR: '/usr/sbin/iptables-restore -w -n' failed: iptables-restore v1.4.21: iptables-restore: unable to initialize table 'security'
Error occurred at line: 10...
Dec 05 16:49:14 firewalld[1989]: ERROR: '/usr/sbin/ip6tables-restore -w -n' failed: ip6tables-restore v1.4.21: ip6tables-restore: unable to initialize table 'security'
Error occurred at line: 10...
Dec 05 16:49:14 firewalld[1989]: ERROR: COMMAND_FAILED: '/usr/sbin/ip6tables-restore -w -n' failed: ip6tables-restore v1.4.21: ip6tables-restore: unable to initialize table 'security'
Error occurred at line: 10...
Dec 05 16:49:27 firewalld[1989]: ERROR: INVALID_ZONE
Hint: Some lines were ellipsized, use -l to show in full.
如果我尝试以下操作仍然会收到错误:
[root@/]# firewall-cmd --zone=public --change-interface=eth0
Error: 'filter'
我该如何解决这个问题???