web-dev-qa-db-ja.com

Centos 7ファイアウォールがデフォルトで機能しない

私はgodaddyからのvpsを持っています。記事で述べたように、私のシステムにはcentos 7があります。サーバーをヘッドスタートするときに最初にしたことは次のとおりです。

$ yum update
$  yum install firewalld
$  systemctl start firewalld
$ systemctl enable firewalld
$ firewall-cmd --state
not running

私は何度も何度もフォーマットを試しましたが、それでもこれは得られます。

また私がしようとするとき

$ firewall-cmd --reload
Error: COMMAND_FAILED

そしてこれはfirewalldステータスです

firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2017-12-17 04:31:45 MST; 23h ago
     Docs: man:firewalld(1)
 Main PID: 131 (firewalld)
   CGroup: /system.slice/firewalld.service
           └─131 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid

Dec 17 04:34:37 s132-148-146-167.secureserver.net firewalld[131]: WARNING: '/usr/sbin/ebtables-restore --noflush' failed: The kernel doesn't support the ebtables 'broute' table.
Dec 17 04:34:37 s132-148-146-167.secureserver.net firewalld[131]: ERROR: COMMAND_FAILED
Dec 17 04:43:21 s132-148-146-167.secureserver.net firewalld[131]: WARNING: ALREADY_ENABLED: ftp
Dec 18 03:46:03 s132-148-146-167.secureserver.net firewalld[131]: WARNING: ipset not usable, disabling ipset usage in firewall.
Dec 18 03:46:03 s132-148-146-167.secureserver.net firewalld[131]: ERROR: Failed to read file "/proc/sys/net/netfilter/nf_conntrack_helper": [Errno 2] No such file or directory: '/proc/sys/net/netfilter/nf_conntrack_helper'
Dec 18 03:46:03 s132-148-146-167.secureserver.net firewalld[131]: WARNING: Failed to get and parse nf_conntrack_helper setting
Dec 18 03:46:03 s132-148-146-167.secureserver.net firewalld[131]: WARNING: INVALID_HELPER: 'nf_conntrack_ftp' is not available
Dec 18 03:46:03 s132-148-146-167.secureserver.net firewalld[131]: WARNING: '/usr/sbin/iptables-restore --wait=2 -n' failed: iptables-restore: line 64 failed
Dec 18 03:46:03 s132-148-146-167.secureserver.net firewalld[131]: WARNING: '/usr/sbin/ebtables-restore --noflush' failed: The kernel doesn't support the ebtables 'broute' table.
Dec 18 03:46:03 s132-148-146-167.secureserver.net firewalld[131]: ERROR: COMMAND_FAILED

助けてください。私は何か間違ったことをしているのですか、それとも不足していますか?それは私のオペレーティングシステムのデフォルトのファイアウォールエラーですか? GoDaddyのせいにする必要がありますか?

Firewalldログで見たエラー。

WARNING: ip6tables not usable, disabling IPv6 firewall.
WARNING: ICMP type 'reject-route' is not supported by the kernel for ipv6.
1
Yusuf Çağlar

Ebtablesに関する問題があると思います。 ebtablesがインストールされ、検証されていることを確認してください。

rpm -V ebtables -v           (You can check meanings of output on rpm man page)

Journalctlでサービスとステータスの確認を再開してみてください

systemctl restart ebtables
journalctl -u ebtables.service

systemctl restart firewalld
journalctl -u firewalld.service

注:また、journalctl -u firewalld.serviceは、問題のデバッグに役立ちます。

1
aesnak

FTPサービスが21の標準FTP制御ポートを使用している場合は、nf_conntrack_ftpモジュールをロードするだけです。

再起動後も持続させるには:

# cat /etc/modules-load.d/nf_conntrack_ftp.conf 
nf_conntrack_ftp
0
Akhil

私のエラー:

[root@localhost ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Mon 2018-12-17 13:38:24 CST; 1min 51s ago
     Docs: man:firewalld(1)
  Process: 6491 ExecStart=/usr/sbin/firewalld --nofork --nopid $FIREWALLD_ARGS (code=exited, status=0/SUCCESS)
 Main PID: 6491 (code=exited, status=0/SUCCESS)

Dec 17 13:38:24 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...
Dec 17 13:38:24 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.
Dec 17 13:38:24 localhost.localdomain firewalld[6491]: WARNING: ipset not usable, disabling ipset usage in firewall.
Dec 17 13:38:24 localhost.localdomain firewalld[6491]: ERROR: Failed to read file "/proc/sys/net/netfilter/nf_conntrack_helper": [Errno …_helper'
Dec 17 13:38:24 localhost.localdomain firewalld[6491]: WARNING: Failed to get and parse nf_conntrack_helper setting
Dec 17 13:38:24 localhost.localdomain firewalld[6491]: WARNING: iptables not usable, disabling IPv4 firewall.
Dec 17 13:38:24 localhost.localdomain firewalld[6491]: WARNING: ip6tables not usable, disabling IPv6 firewall.
Dec 17 13:38:24 localhost.localdomain firewalld[6491]: WARNING: ebtables not usable, disabling ethernet bridge firewall.
Dec 17 13:38:24 localhost.localdomain firewalld[6491]: FATAL ERROR: No IPv4 and IPv6 firewall.
Dec 17 13:38:24 localhost.localdomain firewalld[6491]: ERROR: Raising SystemExit in run_server

[root@localhost ~]# iptables -L -n
iptables v1.4.21: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.

私の解決策:

[root@localhost ~]# depmod
[root@localhost ~]# systemctl restart firewalld
0
lx-d