Compare commits

...

4 commits

5 changed files with 83 additions and 58 deletions

View file

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

View file

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

View file

@ -1,21 +1,19 @@
{ ... }: {
systemd.network = {
networks = {
"10-lan" = {
matchConfig.Name = "enp4s0";
linkConfig.RequiredForOnline = "routable";
networkConfig = {
DHCP = "yes";
DNS = "10.0.0.1";
IPv6AcceptRA = true;
};
address = [
"10.0.0.3/24"
];
routes = [
{ routeConfig.Gateway = "10.0.0.1"; }
];
systemd.network.networks = {
"10-lan" = {
matchConfig.Name = "enp4s0";
linkConfig.RequiredForOnline = "routable";
networkConfig = {
DHCP = false;
DNS = "10.0.0.1";
# IPv6AcceptRA = true;
};
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.
services.openssh.openFirewall = false;
# NOTE: Debugging.
systemd.services."systemd-networkd".environment.SYSTEMD_LOG_LEVEL = "debug";
# Wan configuration.
systemd.network = {
networks = {
@ -29,38 +26,49 @@ in {
matchConfig.Name = wan;
linkConfig.RequiredForOnline = "carrier";
dhcpV4Config = {
UseDNS = false;
UseRoutes = true;
ClientIdentifier = "mac";
UseDNS = false;
UseRoutes = true;
};
dhcpV6Config = {
UseDNS = false;
DUIDRawData = "00:03:00:01:a8:a1:59:47:fd:a2";
DUIDType = "vendor";
UseDNS = false;
WithoutRA = "solicit";
# PrefixDelegationHint = "::/56";
};
networkConfig = {
DHCP = "yes";
DNS = "1.1.1.1";
IPv6AcceptRA = true;
DNS = "1.1.1.1";
IPv6AcceptRA = false;
IPv6SendRA = false;
DHCPPrefixDelegation = true;
};
dhcpPrefixDelegationConfig = {
UplinkInterface = ":self";
SubnetId = 0;
Announce = false;
};
};
"20-enp6s0f0" = {
matchConfig.Name = "enp6s0f0";
networkConfig.Bridge = lan;
linkConfig.RequiredForOnline = "enslaved";
matchConfig.Name = "enp6s0f0";
networkConfig.Bridge = lan;
};
"20-enp6s0f1" = {
matchConfig.Name = "enp6s0f1";
networkConfig.Bridge = lan;
linkConfig.RequiredForOnline = "enslaved";
matchConfig.Name = "enp6s0f1";
networkConfig.Bridge = lan;
};
"20-enp7s0f0" = {
matchConfig.Name = "enp7s0f0";
networkConfig.Bridge = lan;
linkConfig.RequiredForOnline = "enslaved";
matchConfig.Name = "enp7s0f0";
networkConfig.Bridge = lan;
};
"20-enp7s0f1" = {
matchConfig.Name = "enp7s0f1";
networkConfig.Bridge = lan;
linkConfig.RequiredForOnline = "enslaved";
matchConfig.Name = "enp7s0f1";
networkConfig.Bridge = lan;
};
"30-${lan}" = {
matchConfig.Name = lan;
@ -71,16 +79,30 @@ in {
];
routes = [
# Wifi 5G clients.
{ routeConfig = {
Gateway = wifi;
{
Destination = "192.168.1.0/24";
}; }
Gateway = wifi;
}
# Wifi 2G clients.
{ routeConfig = {
Gateway = wifi;
{
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 = {
dhcpcd.enable = false;
useDHCP = false;
useNetworkd = true;
networkmanager = {
enable = true;
unmanaged = [
"bridge"
"ethernet"
"loopback"
"wireguard"
"type:bridge"
"type:ethernet"
"type:loopback"
# "type:wireguard"
];
};
};
# NOTE: Debugging.
# systemd.services."systemd-networkd".environment.SYSTEMD_LOG_LEVEL = "debug";
}