diff options
author | Franz Pletz <fpletz@fnordicwalking.de> | 2017-09-24 16:54:48 +0200 |
---|---|---|
committer | Franz Pletz <fpletz@fnordicwalking.de> | 2017-09-25 14:06:38 +0200 |
commit | 263185aa6860f5a420171d02bfa05d7ba716fc32 (patch) | |
tree | ff2f87f93773d7a46408f5c8363a661c9040ec3d /nixos/modules/tasks/network-interfaces-scripted.nix | |
parent | 13a110e69655d78930999ecb6b0a03a8991ab302 (diff) |
nixos/network-interfaces: ensure slave interfaces are up
Fixes #28620.
Diffstat (limited to 'nixos/modules/tasks/network-interfaces-scripted.nix')
-rw-r--r-- | nixos/modules/tasks/network-interfaces-scripted.nix | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/nixos/modules/tasks/network-interfaces-scripted.nix b/nixos/modules/tasks/network-interfaces-scripted.nix index b432ef38d410..3512296dff4a 100644 --- a/nixos/modules/tasks/network-interfaces-scripted.nix +++ b/nixos/modules/tasks/network-interfaces-scripted.nix @@ -9,6 +9,12 @@ let interfaces = attrValues cfg.interfaces; hasVirtuals = any (i: i.virtual) interfaces; + slaves = concatMap (i: i.interfaces) (attrValues cfg.bonds) + ++ concatMap (i: i.interfaces) (attrValues cfg.bridges) + ++ concatMap (i: i.interfaces) (attrValues cfg.vswitches) + ++ concatMap (i: [i.interface]) (attrValues cfg.macvlans) + ++ concatMap (i: [i.interface]) (attrValues cfg.vlans); + # We must escape interfaces due to the systemd interpretation subsystemDevice = interface: "sys-subsystem-net-devices-${escapeSystemdPath interface}.device"; @@ -469,5 +475,8 @@ in config = mkMerge [ bondWarnings (mkIf (!cfg.useNetworkd) normalConfig) + { # Ensure slave interfaces are brought up + networking.interfaces = genAttrs slaves (i: {}); + } ]; } |