devices.srv1.node2: fix network

This commit is contained in:
陈浩南 2024-09-27 13:57:39 +08:00
parent 52b9ed4441
commit 024598227a
2 changed files with 5 additions and 8 deletions

View File

@ -9,7 +9,7 @@ inputs:
nixpkgs.march = "broadwell";
networking.networkd.static =
{
eno1 = { ip = "192.168.1.12"; mask = 24; gateway = "192.168.1.1"; dns = "192.168.1.1"; };
br0 = { ip = "192.168.1.12"; mask = 24; gateway = "192.168.1.1"; dns = "192.168.1.1"; };
eno2 = { ip = "192.168.178.3"; mask = 24; };
};
cluster.nodeType = "worker";
@ -38,10 +38,7 @@ inputs:
# make slurm sub process to be able to communicate with the master
networking.firewall.trustedInterfaces = [ "eno2" ];
# add a bridge for kvm
networking =
{
bridges.br0.interfaces = [ "eno1" ];
interfaces.br0.useDHCP = true;
};
# 设置桥接之后不能再给eno1配置ip需要转而给 br0 配置ip
networking.bridges.br0.interfaces = [ "eno1" ];
};
}

View File

@ -75,10 +75,10 @@ inputs:
(builtins.map
(network:
{
name = "10-${network.ssid}";
name = "10-${network}";
value =
{
matchConfig.Name = network.ssid;
matchConfig.Name = network;
networkConfig = { DHCP = "yes"; IPv6AcceptRA = true; };
linkConfig.RequiredForOnline = "routable";
};