link executor: Add support for dummy interfaces.

closes #49

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
This commit is contained in:
Maximilian Wilhelm 2020-08-26 23:02:48 +02:00
parent 36fe61d8e7
commit e51ce613e6
2 changed files with 10 additions and 0 deletions

View file

@ -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 is for backwards compatibility and should not be used in new
deployments. 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_... *requires* _interfaces_...
Designates one or more required interfaces that must be Designates one or more required interfaces that must be
brought up before configuration of the parent interface. brought up before configuration of the parent interface.
@ -165,3 +169,4 @@ iface eth0
# AUTHORS # AUTHORS
Ariadne Conill <ariadne@dereferenced.org> Ariadne Conill <ariadne@dereferenced.org>
Maximilian Wilhelm <max@sdn.clinic>

View file

@ -32,6 +32,11 @@ is_vlan() {
} }
case "$PHASE" in case "$PHASE" in
pre-up)
if [ "${IF_LINK_TYPE}" = "dummy" ]; then
ip link add "${IFACE}" type dummy
fi
;;
up|down) up|down)
if is_vlan; then if is_vlan; then
ADD_DEL="add" ADD_DEL="add"