summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarren 'Tadgy' Austin <darren@afterdark.org.uk>2019-11-13 03:15:40 +0000
committerRobby Workman <rworkman@slackware.com>2019-11-13 00:22:00 -0600
commit7ac0561ab349bb33a1b6bb6c31fb73bbe5ca3dbd (patch)
tree07a0b60a07d68eaba3afd73bb0d5f707b8c3b9dc
parent9e341fbb562a4686c26f3e97b1b82b3c4ca987f2 (diff)
downloadslacknetsetup-7ac0561ab349bb33a1b6bb6c31fb73bbe5ca3dbd.tar.xz
Create and document a new VLANOPTS variable.
This variable can be used to set custom options to configure the VLAN interface. It does not need to be used in 'normal' operation with a VLAN.
-rw-r--r--rc.inet16
-rw-r--r--rc.inet1.conf6
2 files changed, 12 insertions, 0 deletions
diff --git a/rc.inet1 b/rc.inet1
index c19571f..66e90a8 100644
--- a/rc.inet1
+++ b/rc.inet1
@@ -271,6 +271,12 @@ if_up() {
((IF_UP == 1)) && /sbin/ip link set dev ${iface} down
return
fi
+ while read -r -d \| VLANOPT; do
+ if [ -n "$VLANOPT" ]; then
+ debug_log "/sbin/ip link set dev ${1} type vlan $VLANOPT"
+ /sbin/ip link set dev ${1} type vlan $VLANOPT
+ fi
+ done <<<"${VLANOPTS[$i]}|" # The | on the end is required.
fi
# Set hardware address:
if [ -n "${HWADDR[$i]}" ]; then
diff --git a/rc.inet1.conf b/rc.inet1.conf
index e48f5c1..f4d54b1 100644
--- a/rc.inet1.conf
+++ b/rc.inet1.conf
@@ -98,7 +98,13 @@ DEBUG_ETH_UP="no"
# Example of how to configure a VLAN interface.
# The VLAN ID is taken from the full interface name, which is comprised of the
# underlying interface name, a period (.) and then the VLAN ID.
+# VLANOPTS is a pipe (|) delimited list of VLAN module specific settings to be
+# applied to the interface. See the ip-link(8) man page (search for "VLAN Type
+# Support") for details of the options available. This option is not required
+# for a standard VLAN to be configured.
+#
# IFNAME[0]="eth0.10"
+# VLANOPTS[0]=""
# IPADDR[0]="192.168.10.1"
# NETMASK[0]="24"
# IPALIASES[0]=""