From ff18e9d277bd9a269c5b1756418c99432860ac32 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Sat, 20 May 2023 19:17:12 +0200 Subject: network: add IPv6 sysctls for interfaces (sysctl6) Some IPv6 sysctls are needed under an interface (e.g. proxy_ndp), so let's add them with the "sysctl6" option name. --- sbin/init.d/network | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/sbin/init.d/network b/sbin/init.d/network index cb16a74..7c97b39 100755 --- a/sbin/init.d/network +++ b/sbin/init.d/network @@ -16,6 +16,7 @@ # slave (implies type=bonding) # bonding # sysctl = (under net or net.ipv4.conf.\$if) +# sysctl6 = (under net.ipv6.conf.\$if) # sysset = (under class.net or class.net.\$if) # modprobe # load|unload @@ -75,6 +76,7 @@ option bridge_stp boolean_option 0 option tunnel_type option_alias_type option type standard_option option sysctl multiple_option +option sysctl6 multiple_option option sysset multiple_option option modprobe multiple_option option lladdr standard_option @@ -115,6 +117,7 @@ function do_help { echo " - slave (implies type=bonding)" echo " - bonding " echo " - sysctl = (under net or net.ipv4.conf.\$if)" + echo " - sysctl6 = (under net.ipv6.conf.\$if)" echo " - sysset = (under class.net or class.net.\$if)" echo " - modprobe " echo " - load|unload " @@ -622,7 +625,19 @@ function do_start { if [ -e "/proc/sys/net/ipv4/conf/$instname/$sysctl" ]; then echo "$value" > "/proc/sys/net/ipv4/conf/$instname/$sysctl" else - echo "Non-existent network sysctl entry for $instname : $arg" + echo "Non-existent IPv4 network sysctl entry for $instname : $arg" + fi + done + + for arg in "${opt_sysctl6[@]}"; do + local sysctl value + sysctl="${arg%%=*}" + sysctl="${sysctl//.//}" + value="${arg##*=}" + if [ -e "/proc/sys/net/ipv6/conf/$instname/$sysctl" ]; then + echo "$value" > "/proc/sys/net/ipv6/conf/$instname/$sysctl" + else + echo "Non-existent IPv6 network sysctl entry for $instname : $arg" fi done -- 2.35.3