diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-03-11 08:23:23 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-03-11 08:23:23 -0700 |
commit | ba68ac21c7a6d186ce753ac8ea0b7bf350b440d7 (patch) | |
tree | f99d967a6fa838ae97b10279809e95ad96fe71eb | |
parent | 84fb12226eaf723a833031e17dccc7a8980efeab (diff) | |
parent | 1af622ab0332f583c842cad1dd9ff9f9c5dcc42d (diff) | |
download | vyatta-cfg-ba68ac21c7a6d186ce753ac8ea0b7bf350b440d7.tar.gz vyatta-cfg-ba68ac21c7a6d186ce753ac8ea0b7bf350b440d7.zip |
Merge branch 'jenner' of 192.168.100.1:git/vyatta-cfg into jenner
-rw-r--r-- | templates/interfaces/ethernet/node.tag/vif/node.def | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/templates/interfaces/ethernet/node.tag/vif/node.def b/templates/interfaces/ethernet/node.tag/vif/node.def index e496a7c..e8554fa 100644 --- a/templates/interfaces/ethernet/node.tag/vif/node.def +++ b/templates/interfaces/ethernet/node.tag/vif/node.def @@ -2,8 +2,14 @@ tag: type: u32 help: Set Virtual Local Area Network (VLAN) ID syntax:expression: $VAR(@) >= 0 && $VAR(@) <= 4094; "VLAN ID must be between 0 and 4094" -create: sudo ip link add link $VAR(../@) name "$VAR(../@).$VAR(@)" type vlan id $VAR(@) - sudo ip link set "$VAR(../@).$VAR(@)" up +create: read flags < /sys/class/net/$VAR(../@)/flags + if [ $(( flags & 1 )) -eq 0 ] + then + echo "Can not create VLAN on disabled interface: " $VAR(../@) + exit 1 + fi + sudo ip link add link $VAR(../@) name "$VAR(../@).$VAR(@)" type vlan id $VAR(@) || exit 1 + sudo ip link set "$VAR(../@).$VAR(@)" up /opt/vyatta/sbin/vyatta-link-detect "$VAR(../@).$VAR(@)" on delete: sudo ip link delete "$VAR(../@).$VAR(@)" type vlan id $VAR(@) comp_help: possible completions: |