From e51ce613e6eb716361d317fa54bc18b00951341a Mon Sep 17 00:00:00 2001 From: Maximilian Wilhelm Date: Wed, 26 Aug 2020 23:02:48 +0200 Subject: [PATCH] link executor: Add support for dummy interfaces. closes #49 Signed-off-by: Maximilian Wilhelm --- doc/interfaces.scd | 5 +++++ executor-scripts/linux/link | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/doc/interfaces.scd b/doc/interfaces.scd index 262a7a3..9701647 100644 --- a/doc/interfaces.scd +++ b/doc/interfaces.scd @@ -66,6 +66,10 @@ the system will only respond to certain keywords by default: is for backwards compatibility and should not be used in new deployments. +*link-type* _link-type_ + Denotes the link-type of the interface. When set to _dummy_, + the interface is created as a virtual dummy interfaces. + *requires* _interfaces_... Designates one or more required interfaces that must be brought up before configuration of the parent interface. @@ -165,3 +169,4 @@ iface eth0 # AUTHORS Ariadne Conill +Maximilian Wilhelm diff --git a/executor-scripts/linux/link b/executor-scripts/linux/link index 7fbad75..2de4f4c 100755 --- a/executor-scripts/linux/link +++ b/executor-scripts/linux/link @@ -32,6 +32,11 @@ is_vlan() { } case "$PHASE" in +pre-up) + if [ "${IF_LINK_TYPE}" = "dummy" ]; then + ip link add "${IFACE}" type dummy + fi + ;; up|down) if is_vlan; then ADD_DEL="add"