1
0
mirror of synced 2024-11-29 16:16: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
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
cat > /etc/systemd/system/load-iptables-rules.service <<'EOF'
[Unit]