Browse Source

Merge pull request #1056 from gravitl/feature_v0.13.1_versioning

fixing ipv6
Alex Feiszli 3 years ago
parent
commit
686026824c

+ 1 - 0
compose/docker-compose.contained.yml

@@ -16,6 +16,7 @@ services:
       - net.ipv4.ip_forward=1
       - net.ipv4.conf.all.src_valid_mark=1
       - net.ipv6.conf.all.disable_ipv6=0
+      - net.ipv6.conf.all.forwarding=1
     restart: always
     environment:
       SERVER_NAME: "broker.NETMAKER_BASE_DOMAIN"

+ 1 - 0
compose/docker-compose.nocaddy.yml

@@ -16,6 +16,7 @@ services:
       - net.ipv4.ip_forward=1
       - net.ipv4.conf.all.src_valid_mark=1
       - net.ipv6.conf.all.disable_ipv6=0
+      - net.ipv6.conf.all.forwarding=1
     restart: always
     environment:
       SERVER_NAME: "broker.NETMAKER_BASE_DOMAIN"

+ 1 - 0
compose/docker-compose.nodns.yml

@@ -16,6 +16,7 @@ services:
       - net.ipv4.ip_forward=1
       - net.ipv4.conf.all.src_valid_mark=1
       - net.ipv6.conf.all.disable_ipv6=0
+      - net.ipv6.conf.all.forwarding=1
     restart: always
     environment:
       SERVER_NAME: "broker.NETMAKER_BASE_DOMAIN"

+ 1 - 0
compose/docker-compose.reference.yml

@@ -15,6 +15,7 @@ services:
       - net.ipv4.ip_forward=1
       - net.ipv4.conf.all.src_valid_mark=1
       - net.ipv6.conf.all.disable_ipv6=0
+      - net.ipv6.conf.all.forwarding=1
     restart: always
     network_mode: host # Must configure with very particular settngs for host networking to work. Do not just set on!
     environment:

+ 1 - 0
compose/docker-compose.yml

@@ -16,6 +16,7 @@ services:
       - net.ipv4.ip_forward=1
       - net.ipv4.conf.all.src_valid_mark=1
       - net.ipv6.conf.all.disable_ipv6=0
+      - net.ipv6.conf.all.forwarding=1
     restart: always
     environment:
       SERVER_NAME: "broker.NETMAKER_BASE_DOMAIN"

+ 9 - 2
logic/wireguard.go

@@ -3,6 +3,7 @@ package logic
 import (
 	"errors"
 	"fmt"
+	"net"
 	"os"
 	"os/exec"
 	"strconv"
@@ -397,10 +398,16 @@ func setServerRoutes(iface, network string) {
 	parentNetwork, err := GetParentNetwork(network)
 	if err == nil {
 		if parentNetwork.AddressRange != "" {
-			local.SetCIDRRoute(iface, parentNetwork.AddressRange, nil)
+			ip, cidr, err := net.ParseCIDR(parentNetwork.AddressRange)
+			if err == nil {
+				local.SetCIDRRoute(iface, ip.String(), cidr)
+			}
 		}
 		if parentNetwork.AddressRange6 != "" {
-			local.SetCIDRRoute(iface, parentNetwork.AddressRange6, nil)
+			ip, cidr, err := net.ParseCIDR(parentNetwork.AddressRange6)
+			if err == nil {
+				local.SetCIDRRoute(iface, ip.String(), cidr)
+			}
 		}
 	}
 }