summaryrefslogtreecommitdiff
path: root/templates/interfaces/vxlan/node.def
diff options
context:
space:
mode:
authorRyo Nakamura <upa@haeena.net>2014-12-19 19:27:55 +0900
committerRyo Nakamura <upa@haeena.net>2014-12-19 19:53:40 +0900
commitef9c91609f6bae0923cad221dbd7b8f9636aed12 (patch)
tree2df7bff62d7ddf555a3f52c375f570c69bece110 /templates/interfaces/vxlan/node.def
parent8f7d6c5c8de3ee4b6487cf4aeded4919076cac48 (diff)
downloadvyatta-cfg-system-ef9c91609f6bae0923cad221dbd7b8f9636aed12.tar.gz
vyatta-cfg-system-ef9c91609f6bae0923cad221dbd7b8f9636aed12.zip
support "remote" attribute of VXLAN tunnel
Diffstat (limited to 'templates/interfaces/vxlan/node.def')
-rw-r--r--templates/interfaces/vxlan/node.def17
1 files changed, 14 insertions, 3 deletions
diff --git a/templates/interfaces/vxlan/node.def b/templates/interfaces/vxlan/node.def
index 780ef8d8..150fe3ec 100644
--- a/templates/interfaces/vxlan/node.def
+++ b/templates/interfaces/vxlan/node.def
@@ -5,8 +5,6 @@ help: Virtual eXtensible LAN interface
val_help: <vxlanN>; VXLAN interface name
syntax:expression: pattern $VAR(@) "vxlan[0-9]+$"
-commit:expression: $VAR(./group/) != ""; \
- "Must configure vxlan group for $VAR(@)"
commit:expression: $VAR(./vni/) != ""; \
"Must configure vxlan vni for $VAR(@)"
@@ -20,14 +18,27 @@ create:
exit 1
fi
+ VXLAN_GROUP=""
VXLAN_VNI="id $VAR(./vni/@)"
- VXLAN_GROUP="group $VAR(./group/@)"
VXLAN_TTL="ttl 16"
if [ ! $VAR(./link/) == "" ]; then
VXLAN_DEV="dev $VAR(./link/@)"
fi
+ if [ ! $VAR(./group/) == "" ]; then
+ VXLAN_GROUP="group $VAR(./group/@)"
+ fi
+
+ if [ ! $VAR(./remote/) == "" ]; then
+ VXLAN_GROUP="remote $VAR(./remote/@)"
+ fi
+
+ if [ -z "$VXLAN_GROUP" ]; then
+ echo "group or remote must be configured."
+ exit 1
+ fi
+
ip link add name $VAR(@) type vxlan \
$VXLAN_VNI $VXLAN_GROUP $VXLAN_TTL $VXLAN_DEV
ip link set $VAR(@) up