From 39a92e52c05db9688213d7fc6e65e37ca9edbdf0 Mon Sep 17 00:00:00 2001 From: hwdsl2 Date: Sun, 21 Oct 2018 22:05:00 -0500 Subject: [PATCH] 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 --- vpnsetup.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vpnsetup.sh b/vpnsetup.sh index bc24ffc..9549754 100755 --- a/vpnsetup.sh +++ b/vpnsetup.sh @@ -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]