1
0
Fork 0
mirror of https://github.com/mdlayher/homelab.git synced 2024-12-14 11:47:32 +00:00

nixos/routnerr-4: Metronet static IPv4

This commit is contained in:
Matt Layher 2023-08-15 14:18:37 -04:00
parent b995bae2d4
commit d18e60064c

View file

@ -43,8 +43,8 @@ let
# DHCPServer on NixOS does not support Boot options yet. # DHCPServer on NixOS does not support Boot options yet.
extraConfig = '' extraConfig = ''
[DHCPServer] [DHCPServer]
DefaultLeaseTimeSec = 86400; DefaultLeaseTimeSec = 86400
MaxLeaseTimeSec = 86400; MaxLeaseTimeSec = 86400
PoolOffset = 50 PoolOffset = 50
EmitDNS = true EmitDNS = true
DNS = _server_address DNS = _server_address
@ -145,34 +145,17 @@ in {
# Wired WAN: Metronet 10GbE. # Wired WAN: Metronet 10GbE.
links."11-wan1" = ethLink "wan1" "f4:90:ea:00:c7:91"; links."11-wan1" = ethLink "wan1" "f4:90:ea:00:c7:91";
networks."11-wan1" = { networks."11-wan1" = {
enable = false;
matchConfig.Name = "wan1"; matchConfig.Name = "wan1";
networkConfig.DHCP = "yes"; networkConfig.Address = "216.82.20.71/26";
# Never accept ISP DNS or search domains for any DHCP/RA family.
dhcpV4Config = {
UseDNS = false;
UseDomains = false;
# Don't release IPv4 address on restart/reboots to avoid churn. routes = [{
SendRelease = false; routeConfig = {
Gateway = "216.82.20.65";
# Prioritize Metronet IPv4. # Prioritize Metronet IPv4.
RouteMetric = 100; Metric = 100;
};
# Experiment. }];
RequestBroadcast = true;
};
dhcpV6Config = {
# TODO: ???.
PrefixDelegationHint = "::/56";
UseDNS = false;
};
ipv6AcceptRAConfig = {
UseDNS = false;
UseDomains = false;
};
}; };
# Physical management LAN. For physical LANs, we have to make sure to match # Physical management LAN. For physical LANs, we have to make sure to match
@ -201,8 +184,8 @@ in {
# DHCPServer on NixOS does not support Boot options yet. # DHCPServer on NixOS does not support Boot options yet.
extraConfig = '' extraConfig = ''
[DHCPServer] [DHCPServer]
DefaultLeaseTimeSec = 86400; DefaultLeaseTimeSec = 86400
MaxLeaseTimeSec = 86400; MaxLeaseTimeSec = 86400
PoolOffset = 50 PoolOffset = 50
EmitDNS = true EmitDNS = true
DNS = _server_address DNS = _server_address
@ -264,7 +247,8 @@ in {
interfaceName = "ts0"; interfaceName = "ts0";
useRoutingFeatures = "server"; useRoutingFeatures = "server";
}; };
systemd.services.tailscaled.after = [ "network-online.target" "systemd-resolved.service" ]; systemd.services.tailscaled.after =
[ "network-online.target" "systemd-resolved.service" ];
# Enable WireGuard Prometheus exporter and set up peer key/name mappings. # Enable WireGuard Prometheus exporter and set up peer key/name mappings.
# TODO: nixify the configuration. # TODO: nixify the configuration.