Skip to content

Container private networking broken with hostBridge enabled #52417

@tadfisher

Description

@tadfisher

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions