最近インフラレイヤーまで手を出さざるを得なく、
稼働中のサーバでテストするにはリスクがあるため、dockerを駆使しながら検証を行っております。
ここ数日iptablesにて送信先の制限を行うため、iptablesの設定を行っているのですが、
service起動時にエラーとなっており、検証ができておりません。
お手数ですがご教授願いますでしょうか。
service起動
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.
エラーの状況を確認
systemctl status iptables.service ● iptables.service - IPv4 firewall with iptables Loaded: loaded (/usr/lib/systemd/system/iptables.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Thu 2018-07-05 03:59:34 UTC; 49s ago Process: 844 ExecStart=/usr/libexec/iptables/iptables.init start (code=exited, status=1/FAILURE) Main PID: 844 (code=exited, status=1/FAILURE) Jul 05 03:59:34 e5cbea2b444a systemd[1]: Starting IPv4 firewall with iptables... Jul 05 03:59:34 e5cbea2b444a iptables.init[844]: /usr/libexec/iptables/iptables.init: line 22: /etc/init.d/functions: No such file or directory Jul 05 03:59:34 e5cbea2b444a iptables.init[844]: iptables: Applying firewall rules: iptables-restore: COMMIT expected at line 6 Jul 05 03:59:34 e5cbea2b444a iptables.init[844]: /usr/libexec/iptables/iptables.init: line 242: failure: command not found Jul 05 03:59:34 e5cbea2b444a systemd[1]: iptables.service: main process exited, code=exited, status=1/FAILURE Jul 05 03:59:34 e5cbea2b444a systemd[1]: Failed to start IPv4 firewall with iptables. Jul 05 03:59:34 e5cbea2b444a systemd[1]: Unit iptables.service entered failed state. Jul 05 03:59:34 e5cbea2b444a systemd[1]: iptables.service failed.
ここでエラーとなっており先に進めない状態です。
Failed to start IPv4 firewall with iptables
ちなみにfirewallは入っておりません。
============== 7/6 追加情報
色々なページを参照し、iptablesの設定自体はうまく行ったのですが、
接続がうまく行かなくなりました。
現在 dockerコンテナを3台立ち上げて検証しています。
master:172.17.0.4
slave:172.17.0.5
slave2:172.17.0.6
masterは、slaveのみ接続許可をするため下記設定をしましたが、
slave2 → masterの接続もできなくなってしまいました。
Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy DROP) target prot opt source destination ACCEPT all -- 0.0.0.0/0 172.17.0.5
service 起動の前に、"iptables -nvL" など、iptables 自体は実行できますか? コンテナの中から kernel の機能である netfilter/iptables は使用できないと思うのですが。
はい実行した結果
iptables -nvL
Chain INPUT (policy ACCEPT 439 packets, 538K bytes)
pkts bytes target prot opt in out source destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 378 packets, 17285 bytes)
pkts bytes target prot opt in out source destination
となりました

回答2件
あなたの回答
tips
プレビュー