common: Use IPv4/6 default configuration on all interfaces

The comment in the script has the story.
This commit is contained in:
Tobias Waldekranz
2023-05-12 14:24:41 +02:00
committed by Joachim Wiberg
parent c2042bb036
commit 32f6f22b47
2 changed files with 15 additions and 0 deletions
@@ -1 +1,2 @@
run [S] /lib/infix/sysctl-sync-ip-conf --
run [S] /lib/infix/nameif -- Probing network interfaces
+14
View File
@@ -0,0 +1,14 @@
#!/bin/sh
# When changing default IPv4/6 settings, this does not apply to
# existing interfaces. This syncs the default settings to all known
# interfaces at boot, such that physical interfaces will start from
# the same point as virtual ones.
sysctl net.ipv4.conf.default >/tmp/sysctl-ip-default
sysctl net.ipv6.conf.default >>/tmp/sysctl-ip-default
for iface in $(ip -j link show | jq -r .[].ifname); do
sed -e "s/.default./.${iface}./g" /tmp/sysctl-ip-default \
| sysctl -p -
done