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"
''
experimental-features = nix-command flakes ca-derivations
http-connections = 4
'');
INSTALLER_SSH_OPTS = "-i .keys/deploy.key";

6
flake.lock generated
View File

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

View File

@ -91,7 +91,12 @@ rec {
gateway =
(optional (a.ipv4.gateway != null) a.ipv4.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 =

View File

@ -62,7 +62,22 @@
Name = "base";
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" = {

View File

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

View File

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