summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-05-21 09:40:36 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-05-21 09:40:36 -0700
commit21cbbc1a25e672f9656cb8364bd01feefcbf855e (patch)
tree7c03631ff35078275d6d4835084906d8406464a6 /templates
parent19c5f79e9e9cde0dc9a207b8dabb8e3000a8578f (diff)
downloadvyatta-cfg-21cbbc1a25e672f9656cb8364bd01feefcbf855e.tar.gz
vyatta-cfg-21cbbc1a25e672f9656cb8364bd01feefcbf855e.zip
Allow creating vlan on disabled device
Other half of fix for Bug 4369
Diffstat (limited to 'templates')
-rw-r--r--templates/interfaces/ethernet/node.tag/disable/node.def7
-rw-r--r--templates/interfaces/ethernet/node.tag/vif/node.def15
2 files changed, 5 insertions, 17 deletions
diff --git a/templates/interfaces/ethernet/node.tag/disable/node.def b/templates/interfaces/ethernet/node.tag/disable/node.def
index 3d3ffef..ad03336 100644
--- a/templates/interfaces/ethernet/node.tag/disable/node.def
+++ b/templates/interfaces/ethernet/node.tag/disable/node.def
@@ -1,10 +1,5 @@
help: Set interface disabled
-create: vif=`/opt/vyatta/sbin/vyatta-interfaces.pl --vif=$VAR(../@) --show=all`
- if [ ! -z "$vif" ]; then
- echo "Can not disable interface " $VAR(../@) " with vif:" $vif
- exit 1
- fi
- /etc/netplug/linkdown.d/dhclient $VAR(../@)
+create: /etc/netplug/linkdown.d/dhclient $VAR(../@)
if ! sudo ip link set $VAR(../@) down 2>/dev/null; then
echo "Error disabling dev $VAR(../@)"
/etc/netplug/linkup.d/dhclient $VAR(../@)
diff --git a/templates/interfaces/ethernet/node.tag/vif/node.def b/templates/interfaces/ethernet/node.tag/vif/node.def
index bca6307..18582e2 100644
--- a/templates/interfaces/ethernet/node.tag/vif/node.def
+++ b/templates/interfaces/ethernet/node.tag/vif/node.def
@@ -2,19 +2,12 @@ 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: 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
+create: if ! sudo ip link add link $VAR(../@) name "$VAR(../@).$VAR(@)" type vlan id $VAR(@)
+ then echo "Error creating VLAN device $VAR(../@).$VAR(@)"
+ exit 1
+ fi
sudo ip link set "$VAR(../@).$VAR(@)" up
/opt/vyatta/sbin/vyatta-link-detect "$VAR(../@).$VAR(@)" on
delete: sudo ip link delete dev "$VAR(../@).$VAR(@)" type vlan id $VAR(@)
comp_help: possible completions:
<0-4094> Set VLAN ID
-
-
-
-