Merge branch 'master' of git://git.ipfire.org/network
authorStefan Schantl <stefan.schantl@ipfire.org>
Sat, 5 Sep 2015 19:45:30 +0000 (21:45 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Sat, 5 Sep 2015 19:45:30 +0000 (21:45 +0200)
src/functions/functions.pppoe-server

index 5c9860b..02e4b9a 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}