From 939c6be54e65a2ad2b954f400287e70b95d44e0c Mon Sep 17 00:00:00 2001 From: Youfu Zhang <1315097+zhangyoufu@users.noreply.github.com> Date: Thu, 2 Aug 2018 18:10:10 +0800 Subject: [PATCH 1/3] fix vlan interface bring up on boot when the parent interface of a vlan interface is not up (yet), ip link cannot bring the vlan interface up the vlan interface will be automatically brought up when the parent interface is up later fix NixOS/nixpkgs#28620 --- nixos/modules/tasks/network-interfaces-scripted.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/tasks/network-interfaces-scripted.nix b/nixos/modules/tasks/network-interfaces-scripted.nix index f3f6a19318a..be425166758 100644 --- a/nixos/modules/tasks/network-interfaces-scripted.nix +++ b/nixos/modules/tasks/network-interfaces-scripted.nix @@ -473,7 +473,7 @@ let # Remove Dead Interfaces ip link show "${n}" >/dev/null 2>&1 && ip link delete "${n}" ip link add link "${v.interface}" name "${n}" type vlan id "${toString v.id}" - ip link set "${n}" up + ip link set "${n}" up || true ''; postStop = '' ip link delete "${n}" || true From ae65ddc8de520a0ddf38171cd7b287018ed6c58a Mon Sep 17 00:00:00 2001 From: Youfu Zhang <1315097+zhangyoufu@users.noreply.github.com> Date: Fri, 10 Aug 2018 11:52:16 +0800 Subject: [PATCH 2/3] add comment for issue #28620 --- nixos/modules/tasks/network-interfaces-scripted.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nixos/modules/tasks/network-interfaces-scripted.nix b/nixos/modules/tasks/network-interfaces-scripted.nix index be425166758..d5bbd6dadab 100644 --- a/nixos/modules/tasks/network-interfaces-scripted.nix +++ b/nixos/modules/tasks/network-interfaces-scripted.nix @@ -473,6 +473,9 @@ let # Remove Dead Interfaces ip link show "${n}" >/dev/null 2>&1 && ip link delete "${n}" ip link add link "${v.interface}" name "${n}" type vlan id "${toString v.id}" + # Try to bring up vlan interface + # Note: When master interface is down, we cannot bring vlan interfaces up (#28620) + # Vlan interfaces will be automatically bring up when master is up ip link set "${n}" up || true ''; postStop = '' From 762cea6a5a87e05360849bd43874f37309ed95cf Mon Sep 17 00:00:00 2001 From: Franz Pletz Date: Mon, 13 Aug 2018 20:38:32 +0000 Subject: [PATCH 3/3] fix comment --- nixos/modules/tasks/network-interfaces-scripted.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/nixos/modules/tasks/network-interfaces-scripted.nix b/nixos/modules/tasks/network-interfaces-scripted.nix index d5bbd6dadab..af61c95da0a 100644 --- a/nixos/modules/tasks/network-interfaces-scripted.nix +++ b/nixos/modules/tasks/network-interfaces-scripted.nix @@ -473,9 +473,11 @@ let # Remove Dead Interfaces ip link show "${n}" >/dev/null 2>&1 && ip link delete "${n}" ip link add link "${v.interface}" name "${n}" type vlan id "${toString v.id}" - # Try to bring up vlan interface - # Note: When master interface is down, we cannot bring vlan interfaces up (#28620) - # Vlan interfaces will be automatically bring up when master is up + + # We try to bring up the logical VLAN interface. If the master + # interface the logical interface is dependent upon is not up yet we will + # fail to immediately bring up the logical interface. The resulting logical + # interface will brought up later when the master interface is up. ip link set "${n}" up || true ''; postStop = ''