
RHEL7 で iptables を使用しようとしています。次の操作を実行しました。
systemctl mask firewalld
systemctl stop firewalld
yum install iptables-services
systemctl enable iptables
systemctl start iptables
しかし、最後の行にエラーがあります:
Job for iptables.service failed because the control process exited with error code. See "systemctl status iptables.service" and "journalctl -xe" for details.
journalctl -u service-name.service
-- No entries --
そしてjournalctl -xe
Jan 13 12:30:03 localhost.localdomain systemd[1]: Unit iptables.service entered failed state.
Jan 13 12:30:03 localhost.localdomain systemd[1]: iptables.service failed.
Jan 13 12:30:03 localhost.localdomain polkitd[10240]: Unregistered Authentication Agent for unix-process:27798:561438909 (system bus name :1.22082, object path /org/freedesktop/P
lines 1222-1263/1263 (END)
失敗したことだけがわかるが、原因はわからない。unix プロセスの認証エージェントが未登録です意味があるのか、関連があるのか。常に iptables エラー行に続くためだと思います。しかし、これが何を意味するのか、具体的にどのように修正するのかはわかりません。また、どちらが原因でどちらが結果なのかもわかりません。
さらに:
sudo iptables -S
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: permissive
Mode from config file: enforcing
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 28
そしてiptables-restore
ぶら下がります。
解決済み:
ハンドルがロックされているのか、それとも何か他の原因があるのか、正確にはわかりませんが、数回再起動して を実行した後iptables-restore
、サービスを開始できるようになりました。
iptables サービスを開始するにはどうすればよいですか?
答え1
短い答えですが、私も同様の問題を抱えていましたが、再起動で解決しました。起動時にサービスが開始され、その後、通常どおり停止および開始することができました。
答え2
順番に実行するとうまくいきました。service iptables save systemctl stop firewalld systemctl enable firewalld systemctl start iptables systemctl status iptables systemctl enable iptables