30 lines
837 B
Nix
30 lines
837 B
Nix
{config, ...}: {
|
|
networking = {
|
|
inherit (config.secrets.secrets.local.networking) hostId;
|
|
};
|
|
systemd.network.networks = {
|
|
"lan01" = {
|
|
address = ["192.168.178.32/24"];
|
|
gateway = ["192.168.178.1"];
|
|
#matchConfig.MACAddress = config.secrets.secrets.local.networking.interfaces.lan01.mac;
|
|
matchConfig.Name = "mv-lan01";
|
|
dns = ["192.168.178.2"];
|
|
networkConfig = {
|
|
IPv6PrivacyExtensions = "yes";
|
|
MulticastDNS = true;
|
|
};
|
|
};
|
|
};
|
|
# To be able to ping containers from the host, it is necessary
|
|
# to create a macvlan on the host on the VLAN 1 network.
|
|
networking.macvlans.mv-lan01 = {
|
|
interface = "lan01";
|
|
mode = "bridge";
|
|
};
|
|
|
|
boot.initrd.systemd.network = {
|
|
enable = true;
|
|
networks = {inherit (config.systemd.network.networks) "lan01";};
|
|
};
|
|
}
|