1
0

Fix ipv6 support for gre module

This commit is contained in:
clerie 2021-01-13 13:45:26 +01:00
parent 5f95721f3d
commit fff74fed87
3 changed files with 17 additions and 3 deletions

View File

@ -72,8 +72,15 @@
clerie.gre-tunnel = { clerie.gre-tunnel = {
enable = true; enable = true;
ipv6= {
gre-gatekeeper6 = {
remote = "fd00:152:152:101::1";
local = (lib.head config.networking.interfaces.lo.ipv6.addresses).address;
address = "fd00:153:153:201::2/64";
};
};
ipv4 = { ipv4 = {
gre-gatekeeper = { gre-gatekeeper4 = {
remote = "10.152.101.1"; remote = "10.152.101.1";
local = (lib.head config.networking.interfaces.lo.ipv4.addresses).address; local = (lib.head config.networking.interfaces.lo.ipv4.addresses).address;
address = "169.254.201.2/24"; address = "169.254.201.2/24";

View File

@ -124,8 +124,15 @@
clerie.gre-tunnel = { clerie.gre-tunnel = {
enable = true; enable = true;
ipv6= {
gre-carbon6 = {
remote = "fd00:152:152:104::1";
local = (lib.head config.networking.interfaces.lo.ipv6.addresses).address;
address = "fd00:153:153:201::1/64";
};
};
ipv4 = { ipv4 = {
gre-carbon = { gre-carbon4 = {
remote = "10.152.104.1"; remote = "10.152.104.1";
local = (lib.head config.networking.interfaces.lo.ipv4.addresses).address; local = (lib.head config.networking.interfaces.lo.ipv4.addresses).address;
address = "169.254.201.1/24"; address = "169.254.201.1/24";

View File

@ -21,7 +21,7 @@ let
script = '' script = ''
${tunnel.preSetup} ${tunnel.preSetup}
ip${optionalString isIPv6 " -6"} tunnel add ${name} mode gre remote ${tunnel.remote} local ${tunnel.local} ip${optionalString isIPv6 " -6"} tunnel add ${name} mode ${optionalString isIPv6 "ip6"}gre remote ${tunnel.remote} local ${tunnel.local}
ip link set ${name} up ip link set ${name} up
ip${optionalString isIPv6 " -6"} a add ${tunnel.address} dev ${name} ip${optionalString isIPv6 " -6"} a add ${tunnel.address} dev ${name}
${tunnel.postSetup} ${tunnel.postSetup}