use systemd-networkd
This commit is contained in:
parent
8d191f63d7
commit
7ef9ee727b
16
common.nix
16
common.nix
|
@ -62,11 +62,23 @@ in
|
||||||
# allow all firmware
|
# allow all firmware
|
||||||
hardware.enableAllFirmware = true;
|
hardware.enableAllFirmware = true;
|
||||||
|
|
||||||
# networking just with the dhcp client
|
# use systemd-networkd
|
||||||
networking.useDHCP = true;
|
networking.useDHCP = false;
|
||||||
|
systemd.network.enable = true;
|
||||||
|
systemd.network.networks."10-wan" = {
|
||||||
|
networkConfig = {
|
||||||
|
# start a DHCP Client for IPv4 Addressing/Routing
|
||||||
|
DHCP = "ipv4";
|
||||||
|
# accept Router Advertisements for Stateless IPv6 Autoconfiguraton (SLAAC)
|
||||||
|
IPv6AcceptRA = true;
|
||||||
|
};
|
||||||
|
# make routing on this interface a dependency for network-online.target
|
||||||
|
linkConfig.RequiredForOnline = "routable";
|
||||||
|
};
|
||||||
|
|
||||||
# ensure firewall is up, allow ssh and http in
|
# ensure firewall is up, allow ssh and http in
|
||||||
networking.firewall.enable = true;
|
networking.firewall.enable = true;
|
||||||
|
networking.firewall.allowedTCPPorts = [ 22 ];
|
||||||
networking.firewall.logRefusedConnections = false;
|
networking.firewall.logRefusedConnections = false;
|
||||||
|
|
||||||
# OpenSSH daemon config
|
# OpenSSH daemon config
|
||||||
|
|
|
@ -16,4 +16,7 @@
|
||||||
|
|
||||||
# host name
|
# host name
|
||||||
networking.hostName = "mini";
|
networking.hostName = "mini";
|
||||||
|
|
||||||
|
# main network interface
|
||||||
|
systemd.network.networks."10-wan".matchConfig.Name = "eno1";
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,4 +16,7 @@
|
||||||
|
|
||||||
# host name
|
# host name
|
||||||
networking.hostName = "neko";
|
networking.hostName = "neko";
|
||||||
|
|
||||||
|
# main network interface
|
||||||
|
systemd.network.networks."10-wan".matchConfig.Name = "enp9s0";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue