nixos: Attempt to get LLDP working

This commit is contained in:
Jack O'Sullivan 2022-05-18 22:52:42 +01:00
parent 89928a8fee
commit 0a5a554ab3
6 changed files with 44 additions and 19 deletions

View File

@ -12,6 +12,7 @@ in
NIX_USER_CONF_FILES = toString (pkgs.writeText "nix.conf" NIX_USER_CONF_FILES = toString (pkgs.writeText "nix.conf"
'' ''
experimental-features = nix-command flakes ca-derivations experimental-features = nix-command flakes ca-derivations
http-connections = 4
''); '');
INSTALLER_SSH_OPTS = "-i .keys/deploy.key"; INSTALLER_SSH_OPTS = "-i .keys/deploy.key";

6
flake.lock generated
View File

@ -180,11 +180,11 @@
}, },
"nixpkgs-mine": { "nixpkgs-mine": {
"locked": { "locked": {
"lastModified": 1651945192, "lastModified": 1652907688,
"narHash": "sha256-3pnzK9RpuWzqnqd1U7zt/z3gvn/UNY41CJuS6Ow/Vwo=", "narHash": "sha256-esMEnvt45KUlT27Qqouwe5Yp5kCmMq1HBmp65zpwBF4=",
"owner": "devplayer0", "owner": "devplayer0",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "95bce541ae41d144b8edb6c47b3b7987295b006f", "rev": "0231cfd37dd08514d4d49f2b5b0fa6451dacb6f4",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -91,7 +91,12 @@ rec {
gateway = gateway =
(optional (a.ipv4.gateway != null) a.ipv4.gateway) ++ (optional (a.ipv4.gateway != null) a.ipv4.gateway) ++
(optional (a.ipv6.gateway != null) a.ipv6.gateway); (optional (a.ipv6.gateway != null) a.ipv6.gateway);
networkConfig.IPv6AcceptRA = a.ipv6.gateway == null; networkConfig = {
IPv6AcceptRA = a.ipv6.gateway == null;
# NOTE: LLDP emission / reception is ignored on bridge interfaces
LLDP = true;
EmitLLDP = "customer-bridge";
};
}; };
deploy-rs = deploy-rs =

View File

@ -62,7 +62,22 @@
Name = "base"; Name = "base";
Kind = "bridge"; Kind = "bridge";
}; };
networks."80-base" = networkdAssignment "base" assignments.internal; networks = {
"80-base" = networkdAssignment "base" assignments.internal;
"80-vm-tap" = {
matchConfig = {
# Don't think we have control over the name of the TAP from qemu-bridge-helper (or how to easily pick
# which interface is which)
Name = "tap*";
Driver = "tun";
};
networkConfig = {
KeepMaster = true;
LLDP = true;
EmitLLDP = "customer-bridge";
};
};
};
}; };
services."vm@estuary" = { services."vm@estuary" = {

View File

@ -12,6 +12,7 @@ in
services = { services = {
getty.autologinUser = mkDefault uname; getty.autologinUser = mkDefault uname;
kmscon.autologinUser = mkDefault uname; kmscon.autologinUser = mkDefault uname;
resolved.llmnr = mkDefault "false";
}; };
my.user.homeConfig = { my.user.homeConfig = {

View File

@ -16,7 +16,7 @@
configuration = { lib, pkgs, modulesPath, config, systems, assignments, ... }: configuration = { lib, pkgs, modulesPath, config, systems, assignments, ... }:
let let
inherit (lib) mkIf mkMerge; inherit (lib) mkIf mkMerge mkForce;
inherit (lib.my) networkdAssignment; inherit (lib.my) networkdAssignment;
in in
{ {
@ -70,19 +70,22 @@
matchConfig.Name = "wan"; matchConfig.Name = "wan";
DHCP = "ipv4"; DHCP = "ipv4";
}; };
"80-base" = (networkdAssignment "base" assignments.internal) // { "80-base" = mkMerge [
networkConfig = { (networkdAssignment "base" assignments.internal)
IPv6AcceptRA = false; {
IPv6SendRA = true; networkConfig = {
IPMasquerade = "both"; IPv6AcceptRA = mkForce false;
}; IPv6SendRA = true;
ipv6SendRAConfig.DNS = [ assignments.internal.ipv6.address ]; IPMasquerade = "both";
ipv6Prefixes = [ };
{ ipv6SendRAConfig.DNS = [ assignments.internal.ipv6.address ];
ipv6PrefixConfig.Prefix = "2a0e:97c0:4d1:0::/64"; ipv6Prefixes = [
} {
]; ipv6PrefixConfig.Prefix = "2a0e:97c0:4d1:0::/64";
}; }
];
}
];
}; };
}; };