dolomite/network: switch to networkd

This commit is contained in:
xinyangli 2024-09-23 20:17:57 +08:00
parent bba16ea4da
commit 018044aa7d
Signed by: xin
SSH key fingerprint: SHA256:UU5pRTl7NiLFJbWJZa+snLylZSXIz5rgHmwjzv8v4oE
3 changed files with 15 additions and 35 deletions

View file

@ -42,9 +42,19 @@ in
boot.loader.grub.enable = true; boot.loader.grub.enable = true;
boot.loader.grub.device = "/dev/sda"; boot.loader.grub.device = "/dev/sda";
networking.useDHCP = false; networking.useNetworkd = true;
networking.interfaces.ens18.useDHCP = true; systemd.network.networks."10-wan" = {
networking.interfaces.ens19.useDHCP = true; matchConfig.MACAddress = "ens18";
networkConfig.DHCP = "ipv4";
dhcpV4Config = {
UseDNS = false;
};
};
systemd.network.networks."20-lan" = {
matchConfig.MACAddress = "ens19";
networkConfig.DHCP = "ipv4";
};
services.resolved.enable = true;
services.sing-box.settings.dns.strategy = "ipv4_only"; services.sing-box.settings.dns.strategy = "ipv4_only";
}; };

View file

@ -101,29 +101,6 @@ in
{ {
enable = true; enable = true;
settings = { settings = {
dns = {
servers = [
{
tag = "warp";
address = "1.1.1.1";
detour = "wg-out";
}
{
tag = "directdns";
address = "h3://8.8.8.8/dns-query";
}
];
rules = [
{
outbound = "wg-out";
server = "warp";
}
{
outbound = "direct";
server = "directdns";
}
];
};
inbounds = inbounds =
[ [
{ {
@ -182,17 +159,9 @@ in
type = "direct"; type = "direct";
tag = "direct"; tag = "direct";
} }
{
type = "dns";
tag = "dns-out";
}
]; ];
route = { route = {
rules = [ rules = [
{
outbound = "dns-out";
protocol = "dns";
}
{ {
inbound = "sg0"; inbound = "sg0";
outbound = "direct"; outbound = "direct";

View file

@ -103,7 +103,8 @@ in
environment.systemPackages = [ pkgs.cryptsetup ]; environment.systemPackages = [ pkgs.cryptsetup ];
# EC2 has its own NTP server provided by the hypervisor # EC2 has its own NTP server provided by the hypervisor
networking.timeServers = [ "169.254.169.123" ]; services.timesyncd.enable = true;
services.timesyncd.servers = [ "169.254.169.123" ];
# udisks has become too bloated to have in a headless system # udisks has become too bloated to have in a headless system
# (e.g. it depends on GTK). # (e.g. it depends on GTK).