Skip to content

scripted networking doesn't start macvlans #91751

@davidak

Description

@davidak

Describe the bug

When i add a macvlan to the configuration and nixos-rebuild switch, it is not startet. I have to reboot.

[root@test:~]# nano /etc/nixos/configuration.nix 

[root@test:~]# nixos-rebuild switch
building Nix...
building the system configuration...
these derivations will be built:
  /nix/store/0shnl27k1xjrh4p6v17a30a7k98m87d4-unit-script-macvlan1-netdev-start.drv
  /nix/store/1hv9lazjb9qp678y7py8vm1mxwxlk3ca-unit-script-macvlan1-netdev-post-stop.drv
  /nix/store/d1vjajv01qawi5rgvspbbknwzisrpjkx-dhcpcd.conf.drv
  /nix/store/hjn9hrd7kmngffvvg0alkr7cbn37hf3v-unit-dhcpcd.service.drv
  /nix/store/wpykg3sbvpf07p436m0azbx4kk6a3vpf-unit-macvlan1-netdev.service.drv
  /nix/store/prnxy386k2q7jx6j81akcirggr6i35pf-system-units.drv
  /nix/store/v0rhij6rz1rimjbjn8b5yi7hrw28rgnd-etc.drv
  /nix/store/qhjqmrh8lwsnvx2sg6iz5cmk1ll0fdqc-nixos-system-test-19.09.2260.3b9b10e49be.drv
building '/nix/store/d1vjajv01qawi5rgvspbbknwzisrpjkx-dhcpcd.conf.drv'...
building '/nix/store/1hv9lazjb9qp678y7py8vm1mxwxlk3ca-unit-script-macvlan1-netdev-post-stop.drv'...
building '/nix/store/0shnl27k1xjrh4p6v17a30a7k98m87d4-unit-script-macvlan1-netdev-start.drv'...
building '/nix/store/hjn9hrd7kmngffvvg0alkr7cbn37hf3v-unit-dhcpcd.service.drv'...
building '/nix/store/wpykg3sbvpf07p436m0azbx4kk6a3vpf-unit-macvlan1-netdev.service.drv'...
building '/nix/store/prnxy386k2q7jx6j81akcirggr6i35pf-system-units.drv'...
building '/nix/store/v0rhij6rz1rimjbjn8b5yi7hrw28rgnd-etc.drv'...
building '/nix/store/qhjqmrh8lwsnvx2sg6iz5cmk1ll0fdqc-nixos-system-test-19.09.2260.3b9b10e49be.drv'...
activating the configuration...
setting up /etc...
reloading user units for root...
setting up tmpfiles
restarting the following units: dhcpcd.service

[root@test:~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp4s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 34:97:f6:00:2f:57 brd ff:ff:ff:ff:ff:ff
    inet 10.0.10.215/8 brd 10.255.255.255 scope global dynamic noprefixroute enp4s0
       valid_lft 3596sec preferred_lft 3146sec
    inet6 fe80::3697:f6ff:fe00:2f57/64 scope link 
       valid_lft forever preferred_lft forever
3: enp5s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 34:97:f6:00:2f:58 brd ff:ff:ff:ff:ff:ff

To Reproduce
Steps to reproduce the behavior:

  1. add macvlan
macvlans = {
  macvlan1 = { interface = "enp4s0"; mode = "bridge"; };
};
  1. rebuild
  2. see ip a

Expected behavior

rebuild should activate new services like macvlan1-netdev.service

Notify maintainers
@wkennington

Metadata

  • system: "x86_64-linux"
  • host os: Linux 4.19.109, NixOS, 19.09.2260.3b9b10e49be (Loris)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.3.3
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module:

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bugSomething is broken2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md6.topic: nixosIssues or PRs affecting NixOS modules, or package usability issues specific to NixOS

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions