fixing ipv6

This commit is contained in:
afeiszli 2022-05-02 10:48:00 -04:00
parent 2e4ae94521
commit 80cc86783d
6 changed files with 14 additions and 2 deletions

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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:

View file

@ -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"

View file

@ -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)
}
}
}
}