We provision servers with chef so we have same configuration for Ubuntu 16.04 and 18.04 versions.
And there is same rule for restoring iptables rules
cat /etc/network/if-pre-up.d/iptables_load
/sbin/iptables-restore < /etc/iptables/general
but it doesn't work for Ubuntu 18.04.
If I run it manually it works. Does it mean this script isn't running at startup?
UPDATE
I created systemd service as it is described here and it works fine.
[Unit]
Description = Apply iptables rules
[Service]
Type=oneshot
ExecStart=/etc/network/if-pre-up.d/iptables_load
[Install]
WantedBy=network-pre.target
iptables-persistent
a try, see askubuntu.com/questions/84781/…ifdown -a
followed byifup -a
? Can you maybe put some kind of debugging code in that script to write messages to the logs or displays messages so you know if/when it is getting called?@reboot
hook in thecrontab
. By the way: You can answer your own question, that's perfectly legitimate.