freifunk: fix network config

This commit is contained in:
Astro 2022-06-13 20:38:18 +02:00
parent b20949080d
commit 6e50d39cbe
2 changed files with 23 additions and 5 deletions

View File

@ -21,6 +21,11 @@ let
rt_table_upstream = 100;
node51001AddrPart = "200.2";
mac = {
core = "00:de:13:cb:9a:7b";
bmx = "00:de:13:cb:9a:7c";
};
in {
imports = [
"${modulesPath}/profiles/minimal.nix"
@ -46,8 +51,12 @@ in {
interfaces = [ {
type = "tap";
id = "freifunk";
mac = "00:de:13:cb:9a:7b";
id = "freifunk-core";
mac = mac.core;
} {
type = "tap";
id = "freifunk-bmx";
mac = mac.bmx;
} ];
};
@ -157,11 +166,19 @@ in {
};
};
};
links = {
# Wired mesh interface
"10-bmx" = {
enable = true;
matchConfig = { MACAddress = mac.bmx; };
linkConfig.Name = meshInterface;
};
};
networks = {
# Wired mesh interface
"10-bmx" = {
enable = true;
matchConfig = { Name = meshInterface; };
matchConfig = { MACAddress = mac.bmx; };
addresses = [{
addressConfig = {
Address = "10.201.${ddmeshAddrPart}/16";
@ -199,7 +216,7 @@ in {
# ZW
"20-core" = {
enable = true;
matchConfig = { Name = "core"; };
matchConfig = { MACAddress = mac.core; };
addresses = map (Address: { addressConfig = { inherit Address; }; }) (
[
"${coreAddress}/${toString core.subnet4Len}"

View File

@ -2,7 +2,8 @@
microvm.autostart = [ "oparl" "leon" "nfsroot" ];
c3d2.server.bridgePorts = {
serv = [ "oparl" "leon" "nfsroot" ];
core = [ "freifunk" ];
core = [ "freifunk-core" ];
bmx = [ "freifunk-bmx" ];
};
nix = {