Skip to content

Commit

Permalink
containers: deny networkmanager from managing the ve-* and vb-* NICs
Browse files Browse the repository at this point in the history
Without this, when you've enabled networkmanager and start a
nixos-container the container will briefly have its specified IP
address but then networkmanager starts managing it causing the IP
address to be dropped.
  • Loading branch information
basvandijk authored and rycee committed Dec 12, 2017
1 parent 875eaf0 commit 5572de7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions nixos/modules/virtualisation/containers.nix
Expand Up @@ -726,6 +726,11 @@ in

networking.dhcpcd.denyInterfaces = [ "ve-*" "vb-*" ];

services.udev.extraRules = optionalString config.networking.networkmanager.enable ''
# Don't manage interfaces created by nixos-container.
ENV{INTERFACE}=="v[e,b]-*", ENV{NM_UNMANAGED}="1"
'';

environment.systemPackages = [ pkgs.nixos-container ];
});
}

0 comments on commit 5572de7

Please sign in to comment.