blob: 63394e44d06b527fff6edc9051ce819a987c7214 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
tag:
priority: 320
type: u32
help: Virtual Local Area Network (VLAN) ID
syntax:expression: $VAR(@) >= 0 && $VAR(@) <= 4094; "VLAN ID must be between 0 and 4094"
val_help: u32:0-4094; VLAN ID
create: read -a SLAVES </sys/class/net/$VAR(../@)/bonding/slaves
if [ ${#SLAVES[*]} -eq 0 ]; then
echo "Must configure slave devices for bond interface $VAR(../@) before adding vif"
exit 1
fi
ip link add link $VAR(../@) name "$VAR(../@).$VAR(@)" type vlan id $VAR(@) || exit 1
ip link set "$VAR(../@).$VAR(@)" up
/opt/vyatta/sbin/vyatta-link-detect "$VAR(../@).$VAR(@)" on
delete: [ -d /sys/class/net/$VAR(../@).$VAR(@) ] || exit 0
ip link delete dev "$VAR(../@).$VAR(@)" type vlan id $VAR(@)
|