質問編集履歴
3
更新
title
CHANGED
File without changes
|
body
CHANGED
@@ -30,4 +30,42 @@
|
|
30
30
|
puppetなるソフトウェアと、DockerやKubernetesで指定したiptablesの内容が競合して、適用されなくなるバグがあると報告しています。
|
31
31
|
|
32
32
|
しかし、puppetはinstallしていません。
|
33
|
-
/if-pre-up.d以下で、iptablesをいじるのは`iptables_start`のみなのですが、それでも何かとぶつかっているのでしょうか。
|
33
|
+
/if-pre-up.d以下で、iptablesをいじるのは`iptables_start`のみなのですが、それでも何かとぶつかっているのでしょうか。
|
34
|
+
|
35
|
+
### さらに追記 同日
|
36
|
+
[こちら](https://serverfault.com/questions/914493/ubuntu-18-04-doesnt-load-iptables-rules-after-reboot)では、systemdにやらせると良いということで、次のようにserviceを作りました。
|
37
|
+
|
38
|
+
```
|
39
|
+
root@instance1:~# cat /etc/network/iptables
|
40
|
+
#!/bin/bash
|
41
|
+
/sbin/iptables-restore < /etc/iptables.rules
|
42
|
+
exit 0
|
43
|
+
root@instance1:~# cat /etc/systemd/system/router-rules.service
|
44
|
+
[Unit]
|
45
|
+
Description = Apply base firewall rules for router functionality
|
46
|
+
|
47
|
+
[Service]
|
48
|
+
Type=oneshot
|
49
|
+
ExecStart=/etc/network/iptables
|
50
|
+
|
51
|
+
[Install]
|
52
|
+
WantedBy=network-pre.target
|
53
|
+
root@instance1:~# systemctl enable router-rules.service
|
54
|
+
root@instance1:~# reboot
|
55
|
+
```
|
56
|
+
再起動後、
|
57
|
+
```
|
58
|
+
root@instance1:~# systemctl status router-rules.service
|
59
|
+
● router-rules.service - Apply base firewall rules for router functionality
|
60
|
+
Loaded: loaded (/etc/systemd/system/router-rules.service; enabled; vendor preset: enabled)
|
61
|
+
Active: inactive (dead) since Thu 2019-05-16 03:21:48 JST; 22s ago
|
62
|
+
Process: 619 ExecStart=/etc/network/iptables (code=exited, status=0/SUCCESS)
|
63
|
+
Main PID: 619 (code=exited, status=0/SUCCESS)
|
64
|
+
|
65
|
+
May 16 03:21:48 instance1 systemd[1]: Starting Apply base firewall rules for router functionality...
|
66
|
+
May 16 03:21:48 instance1 iptables[619]: iptables-restore v1.6.0: Set cali40masq-ipam-pools doesn't exist.
|
67
|
+
May 16 03:21:48 instance1 iptables[619]: Error occurred at line: 179
|
68
|
+
May 16 03:21:48 instance1 iptables[619]: Try `iptables-restore -h' or 'iptables-restore --help' for more information.
|
69
|
+
May 16 03:21:48 instance1 systemd[1]: Started Apply base firewall rules for router functionality.
|
70
|
+
```
|
71
|
+
と表示されます。
|
2
追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -17,4 +17,17 @@
|
|
17
17
|
|
18
18
|
が、ログインし、`iptables -L`を実行すると、dockerやkuberentesのiptablesの設定は反映されているのですが、自前の設定は反映されません。まるで、dockerらが`iptables -F`した後に、設定を追加したような挙動です。
|
19
19
|
|
20
|
-
`etc/network/if-pre-up.d/iptables_start`をログイン後実行するとその設定は維持されます。
|
20
|
+
`etc/network/if-pre-up.d/iptables_start`をログイン後実行するとその設定は維持されます。
|
21
|
+
|
22
|
+
### 追記2019/5/16
|
23
|
+
いくつか挙動を確認したところ、どうやら`iptables-restore`が実行されるタイミングで、設定の反映が途中で止まるようでした。
|
24
|
+
ログを見たところ、
|
25
|
+
``` log
|
26
|
+
ifup[829]: iptables-restore v1.6.0: Set cali40masq-ipam-pools doesn't exist.
|
27
|
+
ifup[829]: Error occurred at line: 179
|
28
|
+
```
|
29
|
+
とありまして、関連する記事としては、[StarlingX Projectの開発者ページ?](https://bugs.launchpad.net/starlingx/+bug/1815124)がありまして、
|
30
|
+
puppetなるソフトウェアと、DockerやKubernetesで指定したiptablesの内容が競合して、適用されなくなるバグがあると報告しています。
|
31
|
+
|
32
|
+
しかし、puppetはinstallしていません。
|
33
|
+
/if-pre-up.d以下で、iptablesをいじるのは`iptables_start`のみなのですが、それでも何かとぶつかっているのでしょうか。
|
1
誤字
title
CHANGED
File without changes
|
body
CHANGED
@@ -17,4 +17,4 @@
|
|
17
17
|
|
18
18
|
が、ログインし、`iptables -L`を実行すると、dockerやkuberentesのiptablesの設定は反映されているのですが、自前の設定は反映されません。まるで、dockerらが`iptables -F`した後に、設定を追加したような挙動です。
|
19
19
|
|
20
|
-
`etc/network/if-pre-up.d/iptables_start`をログイン後
|
20
|
+
`etc/network/if-pre-up.d/iptables_start`をログイン後実行するとその設定は維持されます。
|