Issue description
Since #49392 was merged, containers configured with privateNetworking and hostBridge but not hostAddress or localAddress fail to create the veth pair.
It should be pretty obvious by reading through that PR what the cause is; since hostBridge obviates both hostAddress and localAddress, we still need to pass --network-bridge= and allow the container to bind to an address via DHCP, even when neither hostAddress nor localAddress are configured.
Steps to reproduce
Minimal configuration:
containers.brtest = {
privateNetwork = true;
hostBridge = "br0";
config = { config, pkgs, ... }: {
networking.interfaces."eth0".useDHCP = true;
};
};
Technical details
- system:
"x86_64-linux"
- host os:
Linux 4.19.9, NixOS, 19.03pre162671.44b02b52ea6 (Koi)
- multi-user?:
yes
- sandbox:
yes
- version:
nix-env (Nix) 2.1.3
- channels(root):
"nixos-19.03pre162671.44b02b52ea6"
- channels(tad):
""
- nixpkgs:
/nix/var/nix/profiles/per-user/root/channels/nixos
Issue description
Since #49392 was merged, containers configured with
privateNetworkingandhostBridgebut nothostAddressorlocalAddressfail to create the veth pair.It should be pretty obvious by reading through that PR what the cause is; since
hostBridgeobviates bothhostAddressandlocalAddress, we still need to pass--network-bridge=and allow the container to bind to an address via DHCP, even when neitherhostAddressnorlocalAddressare configured.Steps to reproduce
Minimal configuration:
Technical details
"x86_64-linux"Linux 4.19.9, NixOS, 19.03pre162671.44b02b52ea6 (Koi)yesyesnix-env (Nix) 2.1.3"nixos-19.03pre162671.44b02b52ea6"""/nix/var/nix/profiles/per-user/root/channels/nixos