]> git.ipfire.org Git - people/stevee/network.git/commitdiff
ipv6: When auto-configuration is enabled, forwarding must be disabled
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 14 Apr 2015 12:31:50 +0000 (12:31 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 14 Apr 2015 12:31:50 +0000 (12:31 +0000)
src/functions/functions.ipv6

index 32ba81ae945d3966061f6d01bf2ca958b764a823..55540527816836c8dd871965b2c6db724c05b43e 100644 (file)
@@ -27,6 +27,12 @@ function ipv6_device_autoconf_enable() {
 
        sysctl_set "net.ipv6.conf.${device}.accept_ra" 1
        sysctl_set "net.ipv6.conf.${device}.autoconf" 1
+
+       log INFO "Enabled IPv6 auto-configuration on '${device}'"
+
+       # Disable IPv6 forwarding which cannot be used when the
+       # device is using IPv6 auto-configuration.
+       ipv6_device_forwarding_disable "${device}"
 }
 
 function ipv6_device_autoconf_disable() {
@@ -35,6 +41,30 @@ function ipv6_device_autoconf_disable() {
 
        sysctl_set "net.ipv6.conf.${device}.accept_ra" 0
        sysctl_set "net.ipv6.conf.${device}.autoconf" 0
+
+       log INFO "Disabled IPv6 auto-configuration on '${device}'"
+
+       # Enable IPv6 forwarding again
+       ipv6_device_forwarding_enable "${device}"
+
+       # Automatically disable privacy extensions
+       ipv6_device_privacy_extensions_disable "${device}"
+}
+
+function ipv6_device_forwarding_enable() {
+       local device="${1}"
+
+       sysctl_set "net.ipv6.conf.${device}.forwarding" 1
+
+       log INFO "Enabled IPv6 forwarding on '${device}'"
+}
+
+function ipv6_device_forwarding_disable() {
+       local device="${1}"
+
+       sysctl_set "net.ipv6.conf.${device}.forwarding" 0
+
+       log INFO "Disabled IPv6 forwarding on '${device}'"
 }
 
 # Enable IPv6 RFC3041 privacy extensions if desired