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:
parent
0442d25217
commit
39a92e52c0
@ -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]
|
||||||
|
Loading…
Reference in New Issue
Block a user