]> git.ipfire.org Git - people/stevee/network.git/commitdiff
pppoe-server: Enable IPv6
authorStefan Schantl <stefan.schantl@ipfire.org>
Sat, 5 Sep 2015 18:29:46 +0000 (18:29 +0000)
committerStefan Schantl <stefan.schantl@ipfire.org>
Sat, 5 Sep 2015 18:29:46 +0000 (18:29 +0000)
Clients which support IPv6 will now be allocated a link-local
IPv6 address.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/functions/functions.pppoe-server

index 5c9860b096d8ecd894ca2066d3ff04fa95063147..02e4b9a0899032cfeb0a956f44815ebdcb67a034 100644 (file)
@@ -60,6 +60,7 @@ pppoe_server_options() {
        local auth="false"
        local default_asyncmap="true"
        local dns_servers
+       local ipv6="true"
        local lcp_echo_failure=5
        local lcp_echo_interval=60
        local proxyarp="true"
@@ -74,6 +75,9 @@ pppoe_server_options() {
                        --default-asyncmap=*)
                                default_asyncmap=$(cli_get_val ${1})
                                ;;
+                       --disable-ipv6)
+                               ipv6="false"
+                               ;;
                        --dns-server=*)
                                dns_servers="${dns_servers} $(cli_get_val ${1})"
                                ;;
@@ -120,6 +124,17 @@ pppoe_server_options() {
                print >> ${file}
        fi
 
+       # IPv6
+       if enabled ipv6; then
+               # Generate a random gateway address
+               local gw_addr="::$(random 4):$(random 4)"
+               (
+                       print "# IPv6"
+                       print "ipv6 ${gw_addr}"
+                       print
+               ) >> ${file}
+       fi
+
        # DNS servers
        if isset dns_servers; then
                print "# DNS servers" >> ${file}