add network config

This commit is contained in:
2025-04-21 18:56:39 +08:00
parent 3dd0ba719b
commit b3867b403f
2 changed files with 43 additions and 1 deletions

View File

@@ -0,0 +1,42 @@
{ config, pkgs, hostname, ... }: {
networking = {
hostId = "5def12be";
hostName = "${hostname}";
wireless.enable = false; # Enables wireless support via wpa_supplicant.
# Configure network proxy if necessary
# proxy.default = "http://user:password@proxy:port/";
# proxy.noProxy = "127.0.0.1,localhost,internal.domain";
networkmanager = {
enable = true;
};
enableIPv6 = true;
# Set up bridge network
interfaces.eno1 = {
useDHCP = false;
};
bridges = {
br0 = { interfaces = [ "eno1" ]; };
};
interfaces.br0 = {
useDHCP = false;
ipv4.addresses = [
{
address = "10.7.43.10";
prefixLength = 24;
}
];
};
defaultGateway = {
address = "10.7.43.1";
interface = "br0";
};
nameservers = [ "10.7.43.1" ];
};
}

View File

@@ -29,7 +29,7 @@
ipv4.addresses = [
{
address = "10.7.43.20";
prefixLength = 32;
prefixLength = 24;
}
];
};