summaryrefslogtreecommitdiff
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
parent8f7d6c5c8de3ee4b6487cf4aeded4919076cac48 (diff)
downloadvyatta-cfg-system-ef9c91609f6bae0923cad221dbd7b8f9636aed12.tar.gz
vyatta-cfg-system-ef9c91609f6bae0923cad221dbd7b8f9636aed12.zip
support "remote" attribute of VXLAN tunnel
-rw-r--r--templates/interfaces/vxlan/node.def17
-rw-r--r--templates/interfaces/vxlan/node.tag/group/node.def4
-rw-r--r--templates/interfaces/vxlan/node.tag/remote/node.def9
3 files changed, 25 insertions, 5 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
diff --git a/templates/interfaces/vxlan/node.tag/group/node.def b/templates/interfaces/vxlan/node.tag/group/node.def
index 717babd7..a3bae7e3 100644
--- a/templates/interfaces/vxlan/node.tag/group/node.def
+++ b/templates/interfaces/vxlan/node.tag/group/node.def
@@ -1,6 +1,6 @@
type: ipv4
-help: Multicast group address for this VXLAN interface [REQUIRED]
-val_help: ipv4; Multicast group address for this VXLAN [REQUIRED]
+help: Multicast group address for this VXLAN interface
+val_help: ipv4; Multicast group address for this VXLAN
update:
if [ ! -e /tmp/vxlan-$VAR(../@)-create ]; then
diff --git a/templates/interfaces/vxlan/node.tag/remote/node.def b/templates/interfaces/vxlan/node.tag/remote/node.def
new file mode 100644
index 00000000..4048b5fc
--- /dev/null
+++ b/templates/interfaces/vxlan/node.tag/remote/node.def
@@ -0,0 +1,9 @@
+type: ipv4
+help: Remote address of VXLAN tunnel
+val_help: ipv4; Remote address of this VXLAN tunnel
+
+update:
+ if [ ! -e /tmp/vxlan-$VAR(../@)-create ]; then
+ echo "Chainging remote requires delete/create this vxlan interface"
+ exit 1
+ fi