Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty (but defined) bridges.*.interfaces = [ ] doesn't trigger restart of network-setup service on config switch #98311

Open
jficz opened this issue Sep 20, 2020 · 3 comments

Comments

@jficz
Copy link
Contributor

jficz commented Sep 20, 2020

Describe the bug
When a bridge is declared (in this case for container networking purposes) like this:

  networking = {                                                                
    interfaces.${brName} = {                                                    
      virtual = true;                                                           
      ipv4.addresses = [ {                                                      
        address      = hostIP;                                                  
        prefixLength = 24;                                                      
      } ];                                                                                                                                                                                     
    };                                                                          
                                                                                
    bridges.${brName}.interfaces = [ ];
(...)

it does not get created and set-up on nixos-rebuild switch. According to #50208 this is because the interfaces list is empty.

This breaks declarative containers and possibly other use cases where bridge creation is static (i.e. declarative) but config is done on-the-fly. One has to manually restart the network-setup service, the bridge-netdev service and, in case of containers, all the containers' services.

It also basically kills all the containers connected to the bridge.

To Reproduce
Steps to reproduce the behavior:

  1. Declare a bridge as above
  2. nixos-rebuild switch

Expected behavior
The declared bridge should be up with proper IP, etc. The containers connected to the bridge should be up and connected.

Notify maintainers

Metadata

 - system: `"x86_64-linux"`
 - host os: `Linux 5.8.9, NixOS, 21.03pre243690.441a7da8080 (Okapi)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.3.7`
 - channels(root): `"nixos-21.03pre243690.441a7da8080, nixos-hardware"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:
- containers
# a list of nixos modules affected by the problem
module:
@stale
Copy link

stale bot commented Mar 20, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Mar 20, 2021
@vs49688
Copy link
Contributor

vs49688 commented Nov 6, 2021

Still an issue, just hit this on 21.05.4014.96ded94eb0a.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Nov 6, 2021
@misuzu
Copy link
Contributor

misuzu commented Aug 24, 2023

Still reproducible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants