From 6805262a9b973d794404d9314b4669bfbcaa6225 Mon Sep 17 00:00:00 2001 From: Maximilian Wilhelm Date: Fri, 4 Sep 2020 00:48:44 +0200 Subject: [PATCH] link executor: Add support for interface aliases. Signed-off-by: Maximilian Wilhelm --- doc/interfaces.scd | 3 +++ executor-scripts/linux/link | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/doc/interfaces.scd b/doc/interfaces.scd index 9701647..17bc5aa 100644 --- a/doc/interfaces.scd +++ b/doc/interfaces.scd @@ -70,6 +70,9 @@ the system will only respond to certain keywords by default: Denotes the link-type of the interface. When set to _dummy_, the interface is created as a virtual dummy interfaces. +*alias* _alias_ + Sets the given alias on the interface. + *requires* _interfaces_... Designates one or more required interfaces that must be brought up before configuration of the parent interface. diff --git a/executor-scripts/linux/link b/executor-scripts/linux/link index 08e6c6f..9921840 100755 --- a/executor-scripts/linux/link +++ b/executor-scripts/linux/link @@ -70,6 +70,11 @@ up|down) fi ${MOCK} ip link set $PHASE dev $IFACE $IF_LINK_OPTIONS + + # Set alias is configured + if [ "${IF_ALIAS}" ]; then + ${MOCK} ip link set alias "${IF_ALIAS}" dev "${IFACE}" + fi ;; post-down) if [ "${IF_LINK_TYPE}" = "dummy" ]; then