mirror of
https://git.sr.ht/~rouven/nixos-config
synced 2024-11-15 05:13:10 +01:00
droppend bond and configured wireguard
This commit is contained in:
parent
974b62495e
commit
427e0319f7
|
@ -35,71 +35,68 @@
|
||||||
systemd.network = {
|
systemd.network = {
|
||||||
enable = true;
|
enable = true;
|
||||||
wait-online.anyInterface = true;
|
wait-online.anyInterface = true;
|
||||||
netdevs."20-bond0" = {
|
networks."10-loopback" = {
|
||||||
netdevConfig = {
|
matchConfig.Name = "lo";
|
||||||
Name = "bond0";
|
};
|
||||||
Kind = "bond";
|
networks."10-wired" = {
|
||||||
|
matchConfig.Name = "enp0s31f6";
|
||||||
|
networkConfig = {
|
||||||
|
DHCP = "yes";
|
||||||
};
|
};
|
||||||
bondConfig = {
|
dhcpV4Config = {
|
||||||
Mode = "active-backup";
|
RouteMetric = 10;
|
||||||
PrimaryReselectPolicy = "always";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
networks = {
|
networks."10-wireless" = {
|
||||||
"20-ethernet-bond0" = {
|
matchConfig.Name = "wlp9s0";
|
||||||
matchConfig.Name = "enp0s31f6";
|
networkConfig = {
|
||||||
networkConfig = {
|
DHCP = "yes";
|
||||||
Bond = "bond0";
|
IgnoreCarrierLoss = "3s";
|
||||||
PrimarySlave = true;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
"20-wireless-bond0" = {
|
dhcpV4Config = {
|
||||||
matchConfig.Name = "wlp9s0";
|
RouteMetric = 20;
|
||||||
networkConfig = {
|
|
||||||
Bond = "bond0";
|
|
||||||
#IgnoreCarrierLoss = "3s";
|
|
||||||
DHCP = "yes";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
"20-bond0" = {
|
|
||||||
matchConfig.Name = "bond0";
|
|
||||||
networkConfig = {
|
|
||||||
#DHCP = "yes";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# some wireguard interfaces
|
# some wireguard interfaces
|
||||||
#netdevs."30-dorm" = {
|
netdevs."30-dorm" = {
|
||||||
#netdevConfig = {
|
netdevConfig = {
|
||||||
#Kind = "wireguard";
|
Kind = "wireguard";
|
||||||
#Name = "dorm";
|
Name = "dorm";
|
||||||
#Description = "WireGuard to my Dorm Infra";
|
Description = "WireGuard to my Dorm Infra";
|
||||||
#};
|
};
|
||||||
#wireguardConfig = {
|
wireguardConfig = {
|
||||||
#PrivateKeyFile = config.sops.secrets."wireguard/dorm/private".path;
|
PrivateKeyFile = config.sops.secrets."wireguard/dorm/private".path;
|
||||||
#ListenPort = 51820;
|
ListenPort = 51820;
|
||||||
#};
|
};
|
||||||
#wireguardPeers = [
|
wireguardPeers = [
|
||||||
#{
|
{
|
||||||
#wireguardPeerConfig = {
|
wireguardPeerConfig = {
|
||||||
#PublicKey = "vUmworuJFHjB4KUdkucQ+nzqO2ysARLomq4UuK1n430=";
|
PublicKey = "vUmworuJFHjB4KUdkucQ+nzqO2ysARLomq4UuK1n430=";
|
||||||
#PresharedKeyFile = config.sops.secrets."wireguard/dorm/preshared".path;
|
PresharedKeyFile = config.sops.secrets."wireguard/dorm/preshared".path;
|
||||||
#AllowedIPs = [ "10.10.10.0/24" ];
|
Endpoint = "dorm.vpn.rfive.de:51820";
|
||||||
##Endpoint = "dorm.vpn.rfive.de:51820";
|
AllowedIPs = "10.10.10.0/24, 192.168.10.0/24"; # seems to be broken, has no effect on routes
|
||||||
#Endpoint = "141.30.227.6:51820";
|
};
|
||||||
#};
|
}
|
||||||
#}
|
];
|
||||||
#];
|
};
|
||||||
#};
|
networks."30-dorm" = {
|
||||||
#networks."30-dorm" = {
|
matchConfig.Name = "dorm";
|
||||||
#matchConfig.Name = "dorm";
|
networkConfig = {
|
||||||
#networkConfig = {
|
Address = "10.10.10.3/24";
|
||||||
#Address = "10.10.10.3/32";
|
DNS = "10.10.10.1";
|
||||||
#};
|
DNSDefaultRoute = true;
|
||||||
#routes = [
|
};
|
||||||
#{ routeConfig = { Gateway = "10.10.10.1"; Destination = "10.10.10.0/24"; }; }
|
linkConfig = {
|
||||||
#];
|
ActivationPolicy = "manual"; #manual activation cause sometimes the endpoint can't be resolved
|
||||||
#};
|
};
|
||||||
|
routes = [
|
||||||
|
# Somehow systemd-networkd always creates a route to 10.10.10.0/24 with metric 0 and regardless how I set it,
|
||||||
|
# my settings are ignored and set to 0. Route below would do it right, as soon as I find out how I can deacivate
|
||||||
|
# the metric 0 one, this will be uncommented
|
||||||
|
#{ routeConfig = { Gateway = "0.0.0.0"; Destination = "10.10.10.0/24"; Metric = 50; }; }
|
||||||
|
{ routeConfig = { Gateway = "0.0.0.0"; Destination = "192.168.10.0/24"; Metric = 50; }; }
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue