feat(sj-srv1): switch to hostBridge set up

the hostside veth interfaces seem to be buggy and this is more efficient
anyway.
This commit is contained in:
steveej 2024-08-24 00:16:29 +02:00
parent e1d4a1019a
commit 84b473d38c
4 changed files with 34 additions and 11 deletions

View file

@ -1,5 +1,6 @@
{
specialArgs,
hostBridge,
hostAddress,
localAddress,
imapsPort ? 993,
@ -227,5 +228,5 @@
}
];
inherit hostAddress localAddress;
inherit hostBridge hostAddress localAddress;
}

View file

@ -1,5 +1,6 @@
{
specialArgs,
hostBridge,
hostAddress,
localAddress,
syncthingPort ? 22000,
@ -56,5 +57,5 @@
}
];
inherit hostAddress localAddress;
inherit hostBridge hostAddress localAddress;
}

View file

@ -1,5 +1,6 @@
{
specialArgs,
hostBridge,
hostAddress,
localAddress,
httpPort,
@ -330,5 +331,5 @@ in {
}
];
inherit hostAddress localAddress;
inherit hostBridge hostAddress localAddress;
}

View file

@ -29,9 +29,26 @@
networking.nat = {
enable = true;
internalInterfaces = ["ve-*"];
externalInterface = "eth0";
internalInterfaces = ["br0"];
};
networking.bridges = {
br0 = {
interfaces = [];
};
};
networking.interfaces = {
br0 = {
ipv4.addresses = [
{
address = "192.168.101.1";
prefixLength = 24;
}
];
};
};
boot.kernel.sysctl = {
"net.ipv4.ip_forward" = 1;
};
@ -84,14 +101,15 @@
autoStart = true;
hostAddress = "192.168.100.10";
localAddress = "192.168.100.11";
hostBridge = "br0";
hostAddress = "192.168.101.1";
localAddress = "192.168.101.10/24";
imapsPort = 993;
sievePort = 4190;
};
websrv0 =
webserver =
import ../../containers/webserver.nix
{
specialArgs = {
@ -100,8 +118,9 @@
autoStart = true;
hostAddress = "192.168.100.12";
localAddress = "192.168.100.13";
hostBridge = "br0";
hostAddress = "192.168.101.1";
localAddress = "192.168.101.11/24";
httpPort = 80;
httpsPort = 443;
@ -114,8 +133,9 @@
};
autoStart = true;
hostAddress = "192.168.100.14";
localAddress = "192.168.100.15";
hostBridge = "br0";
hostAddress = "192.168.101.1";
localAddress = "192.168.101.12/24";
syncthingPort = 22000;
};