config-perso/machines/kat-r86s/router.nix

90 lines
1.9 KiB
Nix
Raw Normal View History

2024-05-14 19:21:19 +02:00
{
config,
lib,
pkgs,
...
}:
{
2024-03-26 16:06:08 +01:00
boot.kernel.sysctl."net.ipv4.ip_forward" = true;
2024-03-15 10:46:02 +01:00
2024-05-24 13:32:41 +02:00
# networking.nat = {
# enable = true;
# internalInterfaces = [ "vlan-thurne" ];
# externalInterface = "enp1s0";
# };
# networking.interfaces.enp2s0 = {
# useDHCP = false;
# ipv4.addresses = [
# {
# address = "192.168.42.1";
# prefixLength = 24;
# }
# ];
# };
2024-03-26 16:06:08 +01:00
2024-05-24 13:32:41 +02:00
# networking.useDHCP = false;
networking.interfaces.enp3s0.useDHCP = lib.mkForce false;
networking.interfaces.enp2s0.useDHCP = lib.mkForce false;
networking.interfaces.enp1s0.useDHCP = lib.mkForce true;
networking.useNetworkd = true;
2024-05-06 15:00:43 +02:00
2024-05-24 13:32:41 +02:00
# services.dnsmasq = {
# enable = true;
# settings = {
# interface = [ "vlan-admin" ];
# bind-dynamic = true;
# dhcp-option = "3,0.0.0.0";
# dhcp-range = "192.168.222.100,192.168.222.254,255.255.255.0,infinite";
# };
# };
2024-05-14 19:18:30 +02:00
systemd.network = {
enable = true;
networks = {
"10-enp3s0" = {
name = "enp3s0";
networkConfig = {
2024-05-14 19:21:19 +02:00
VLAN = [
"vlan-admin"
"vlan-user-test"
];
2024-05-14 19:18:30 +02:00
LinkLocalAddressing = false;
LLDP = false;
EmitLLDP = false;
IPv6AcceptRA = false;
IPv6SendRA = false;
};
};
"10-vlan-admin" = {
name = "vlan-admin";
address = [
"fd26:baf9:d250:8000::ffff/64"
"192.168.222.1/24"
];
};
"10-vlan-user-test" = {
name = "vlan-user-test";
2024-05-31 23:33:58 +02:00
networkConfig.DHCP = "ipv4";
dhcpV4Config.RouteMetric = 10000;
2024-05-14 19:18:30 +02:00
};
};
netdevs = {
"10-vlan-admin" = {
netdevConfig = {
Name = "vlan-admin";
Kind = "vlan";
};
vlanConfig.Id = 3000;
};
"10-vlan-user-test" = {
netdevConfig = {
Name = "vlan-user-test";
Kind = "vlan";
};
vlanConfig.Id = 4000;
};
};
};
2024-03-15 10:46:02 +01:00
}