1
0
mirror of synced 2024-12-02 01:26:03 +03:00

Improve IPTables on boot

- For systems with "netplan" (e.g. Ubuntu 18.04), do not create
  load-iptables-rules service if iptables-persistent is installed
  (to avoid conflicts on boot)
- Ref: cf77372
This commit is contained in:
hwdsl2 2018-10-21 22:05:00 -05:00
parent 0442d25217
commit 39a92e52c0

View File

@ -434,7 +434,8 @@ iptables-restore < /etc/iptables.rules
exit 0 exit 0
EOF EOF
if [ -f /usr/sbin/netplan ]; then IPT_PST="/usr/share/netfilter-persistent/plugins.d/15-ip4tables"
if [ -f /usr/sbin/netplan ] && [ ! -f "$IPT_PST" ]; then
mkdir -p /etc/systemd/system mkdir -p /etc/systemd/system
cat > /etc/systemd/system/load-iptables-rules.service <<'EOF' cat > /etc/systemd/system/load-iptables-rules.service <<'EOF'
[Unit] [Unit]