Files
nix-config/common/network/default.nix
T
zuckerberg 87082709e0
Check Flake / check-flake (push) Successful in 2h44m20s
Keep dhcpcd from running on container/virtual interfaces
2026-05-31 09:29:38 -07:00

39 lines
923 B
Nix

{ config, lib, ... }:
with lib;
let
cfg = config.networking;
in
{
imports = [
./pia-vpn
./tailscale.nix
./sandbox.nix
];
options.networking.ip_forward = mkEnableOption "Enable ip forwarding";
config = mkMerge [
(mkIf cfg.ip_forward {
boot.kernel.sysctl."net.ipv4.ip_forward" = 1;
boot.kernel.sysctl."net.ipv6.conf.all.forwarding" = 1;
})
# Keep dhcpcd away from container/virtual interfaces. dhcpcd runs as a single
# daemon over every interface not on its deny list, and the nixpkgs default
# omits these. When containers create/tear down podman0/veth*, dhcpcd reacts
# to the link events with a full reconfigure and can drop the primary
# interface's DHCP default route, leaving the host unreachable.
{
networking.dhcpcd.denyInterfaces = [
"podman*"
"veth*"
"cni*"
"docker*"
"br-*"
];
}
];
}