Compare commits

...

4 commits

5 changed files with 83 additions and 58 deletions

View file

@ -91,6 +91,9 @@
# Style. # Style.
(mkLockedPref "toolkit.legacyUserProfileCustomizations.stylesheets" true) (mkLockedPref "toolkit.legacyUserProfileCustomizations.stylesheets" true)
# Prefer IPv6.
(mkLockedPref "network.dns.preferIPv6" true)
]; ];
userChrome = '' userChrome = ''

View file

@ -1,21 +1,18 @@
{ ... }: { { ... }: {
systemd.network = { systemd.network.networks = {
networks = { "10-lan" = {
"10-lan" = { matchConfig.Name = "enp5s0";
matchConfig.Name = "enp5s0"; linkConfig.RequiredForOnline = "routable";
linkConfig.RequiredForOnline = "routable"; networkConfig = {
networkConfig = { DHCP = false;
DHCP = "yes"; DNS = "10.0.0.1";
DNS = "10.0.0.1";
IPv6AcceptRA = true;
};
address = [
"10.0.0.7/24"
];
routes = [
{ routeConfig.Gateway = "10.0.0.1"; }
];
}; };
address = [
"10.0.0.7/24"
];
routes = [
{ Gateway = "10.0.0.1"; }
];
}; };
}; };
} }

View file

@ -1,21 +1,19 @@
{ ... }: { { ... }: {
systemd.network = { systemd.network.networks = {
networks = { "10-lan" = {
"10-lan" = { matchConfig.Name = "enp4s0";
matchConfig.Name = "enp4s0"; linkConfig.RequiredForOnline = "routable";
linkConfig.RequiredForOnline = "routable"; networkConfig = {
networkConfig = { DHCP = false;
DHCP = "yes"; DNS = "10.0.0.1";
DNS = "10.0.0.1"; # IPv6AcceptRA = true;
IPv6AcceptRA = true;
};
address = [
"10.0.0.3/24"
];
routes = [
{ routeConfig.Gateway = "10.0.0.1"; }
];
}; };
address = [
"10.0.0.3/24"
];
routes = [
{ Gateway = "10.0.0.1"; }
];
}; };
}; };
} }

View file

@ -19,9 +19,6 @@ in {
# Disable SSH access from everywhere, configure access bellow. # Disable SSH access from everywhere, configure access bellow.
services.openssh.openFirewall = false; services.openssh.openFirewall = false;
# NOTE: Debugging.
systemd.services."systemd-networkd".environment.SYSTEMD_LOG_LEVEL = "debug";
# Wan configuration. # Wan configuration.
systemd.network = { systemd.network = {
networks = { networks = {
@ -29,38 +26,49 @@ in {
matchConfig.Name = wan; matchConfig.Name = wan;
linkConfig.RequiredForOnline = "carrier"; linkConfig.RequiredForOnline = "carrier";
dhcpV4Config = { dhcpV4Config = {
UseDNS = false;
UseRoutes = true;
ClientIdentifier = "mac"; ClientIdentifier = "mac";
UseDNS = false;
UseRoutes = true;
}; };
dhcpV6Config = { dhcpV6Config = {
UseDNS = false; DUIDRawData = "00:03:00:01:a8:a1:59:47:fd:a2";
DUIDType = "vendor";
UseDNS = false;
WithoutRA = "solicit";
# PrefixDelegationHint = "::/56";
}; };
networkConfig = { networkConfig = {
DHCP = "yes"; DHCP = "yes";
DNS = "1.1.1.1"; DNS = "1.1.1.1";
IPv6AcceptRA = true; IPv6AcceptRA = false;
IPv6SendRA = false;
DHCPPrefixDelegation = true;
};
dhcpPrefixDelegationConfig = {
UplinkInterface = ":self";
SubnetId = 0;
Announce = false;
}; };
}; };
"20-enp6s0f0" = { "20-enp6s0f0" = {
matchConfig.Name = "enp6s0f0";
networkConfig.Bridge = lan;
linkConfig.RequiredForOnline = "enslaved"; linkConfig.RequiredForOnline = "enslaved";
matchConfig.Name = "enp6s0f0";
networkConfig.Bridge = lan;
}; };
"20-enp6s0f1" = { "20-enp6s0f1" = {
matchConfig.Name = "enp6s0f1";
networkConfig.Bridge = lan;
linkConfig.RequiredForOnline = "enslaved"; linkConfig.RequiredForOnline = "enslaved";
matchConfig.Name = "enp6s0f1";
networkConfig.Bridge = lan;
}; };
"20-enp7s0f0" = { "20-enp7s0f0" = {
matchConfig.Name = "enp7s0f0";
networkConfig.Bridge = lan;
linkConfig.RequiredForOnline = "enslaved"; linkConfig.RequiredForOnline = "enslaved";
matchConfig.Name = "enp7s0f0";
networkConfig.Bridge = lan;
}; };
"20-enp7s0f1" = { "20-enp7s0f1" = {
matchConfig.Name = "enp7s0f1";
networkConfig.Bridge = lan;
linkConfig.RequiredForOnline = "enslaved"; linkConfig.RequiredForOnline = "enslaved";
matchConfig.Name = "enp7s0f1";
networkConfig.Bridge = lan;
}; };
"30-${lan}" = { "30-${lan}" = {
matchConfig.Name = lan; matchConfig.Name = lan;
@ -71,16 +79,30 @@ in {
]; ];
routes = [ routes = [
# Wifi 5G clients. # Wifi 5G clients.
{ routeConfig = { {
Gateway = wifi;
Destination = "192.168.1.0/24"; Destination = "192.168.1.0/24";
}; } Gateway = wifi;
}
# Wifi 2G clients. # Wifi 2G clients.
{ routeConfig = { {
Gateway = wifi;
Destination = "192.168.2.0/24"; Destination = "192.168.2.0/24";
}; } Gateway = wifi;
}
]; ];
networkConfig = {
DHCPPrefixDelegation = true;
IPv6AcceptRA = false;
IPv6SendRA = true;
};
ipv6SendRAConfig = {
# EmitDNS = false;
# DNS = "";
};
dhcpPrefixDelegationConfig = {
UplinkInterface = wan;
SubnetId = 1;
Announce = true;
};
}; };
}; };

View file

@ -8,14 +8,19 @@
networking = { networking = {
dhcpcd.enable = false; dhcpcd.enable = false;
useDHCP = false;
useNetworkd = true;
networkmanager = { networkmanager = {
enable = true; enable = true;
unmanaged = [ unmanaged = [
"bridge" "type:bridge"
"ethernet" "type:ethernet"
"loopback" "type:loopback"
"wireguard" # "type:wireguard"
]; ];
}; };
}; };
# NOTE: Debugging.
# systemd.services."systemd-networkd".environment.SYSTEMD_LOG_LEVEL = "debug";
} }