Commit eaeacf18 authored by Jouke Witteveen's avatar Jouke Witteveen
Browse files

Support additional options for `ip link add`

This adds the LinkOptions= variable for use with connection types that
add interfaces (bond, bridge, dummy, macvlan, vlan). This variable is
not portable in the event of moving away from iproute2, so common
options should still get their own variables.
parent e4554f2b
......@@ -320,6 +320,10 @@ is understood for connections of the `bond' type:
The bonding policy. See the kernel documentation on bonding for
details.
'LinkOptions='::
Additional options to be passed to *ip link*. Run
*ip link add type bond help* to see the available options.
OPTIONS FOR `bridge' CONNECTIONS
--------------------------------
......@@ -331,6 +335,10 @@ connections of the `bridge' type:
Skip \(R)STP and immediately activate all bridge members. This can
be useful when DHCP is used on the bridge.
'LinkOptions='::
Additional options to be passed to *ip link*. Run
*ip link add type bridge help* to see the available options.
OPTIONS FOR `dummy' CONNECTIONS
-------------------------------
......
......@@ -17,7 +17,7 @@ is_interface() {
# $4...: additional arguments
interface_add() {
local type="$1" name="$2" link="$3"
do_debug ip link add ${link:+link "$link"} name "$name" type "$type" "${@:4}" || return
do_debug ip link add ${link:+link "$link"} name "$name" type "$type" "${@:4}" $LinkOptions || return
if [[ -x "$PROFILE_DIR/interfaces/$name" ]]; then
source "$PROFILE_DIR/interfaces/$name"
fi
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment