summaryrefslogtreecommitdiff
path: root/templates/interfaces/pseudo-ethernet
diff options
context:
space:
mode:
authorKim Hagen <khagen@multi-development.com>2015-02-05 15:47:47 +0100
committerKim Hagen <khagen@multi-development.com>2015-02-05 15:47:47 +0100
commitd77880937b43a323a53a23c5306e88d3cfc214cb (patch)
tree03dee5023b4ad497bba581b86958047b63b6a58f /templates/interfaces/pseudo-ethernet
parent6ab6520391b685319f8a644aa70a03ae5902309c (diff)
downloadvyatta-cfg-system-d77880937b43a323a53a23c5306e88d3cfc214cb.tar.gz
vyatta-cfg-system-d77880937b43a323a53a23c5306e88d3cfc214cb.zip
Bug #352 - QinQ - changing the ethertype value of vif-s
Diffstat (limited to 'templates/interfaces/pseudo-ethernet')
-rw-r--r--templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.def11
-rw-r--r--templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/ethertype/node.def16
2 files changed, 21 insertions, 6 deletions
diff --git a/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.def b/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.def
index 0b867411..c4bc9577 100644
--- a/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.def
+++ b/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.def
@@ -5,9 +5,8 @@ help: QinQ TAG-S 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: ip link add link $VAR(../@) name "$VAR(../@).$VAR(@)" type vlan proto 802.1ad 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 proto 802.1ad id $VAR(@)
+delete: ETHERTYPE=`echo "$VAR(ethertype/@)"`
+ if [ $ETHERTYPE == "0x88A8" ]; then ETHTYPE=802.1ad; fi
+ if [ $ETHERTYPE == "0x8100" ]; then ETHTYPE=802.1Q; fi
+ [ -d /sys/class/net/$VAR(../@).$VAR(@) ] || exit 0
+ ip link delete dev "$VAR(../@).$VAR(@)" type vlan proto $ETHTYPE id $VAR(@)
diff --git a/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/ethertype/node.def b/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/ethertype/node.def
new file mode 100644
index 00000000..54ff166c
--- /dev/null
+++ b/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/ethertype/node.def
@@ -0,0 +1,16 @@
+type: txt
+help: Set Ethertype
+syntax:expression: $VAR(@) in "0x88A8", "0x8100";"Must be (0x88A8 0x8100)\n"
+default: "0x88A8"
+
+comp_help: possible completions:
+ 0x88A8 802.1AD
+ 0x8100 802.1Q
+
+update: ETHERTYPE=`echo "$VAR(@)"`
+ if [ $ETHERTYPE == "0x88A8" ]; then ETHTYPE=802.1ad; fi
+ if [ $ETHERTYPE == "0x8100" ]; then ETHTYPE=802.1Q; fi
+ ip link delete dev "$VAR(../../@).$VAR(../@)" type vlan proto $ETHTYPE id $VAR(../@) > /dev/null 2>&1
+ ip link add link $VAR(../../@) name "$VAR(../../@).$VAR(../@)" type vlan proto $ETHTYPE id $VAR(../@) || exit 1
+ ip link set "$VAR(../../@).$VAR(../@)" up
+ /opt/vyatta/sbin/vyatta-link-detect "$VAR(../../@).$VAR(../@)" on