summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2014-12-19 22:01:10 +0600
committerDaniil Baturin <daniil@baturin.org>2014-12-19 22:01:10 +0600
commited8fd8137a396d7e5e402f61bb0c445517398904 (patch)
tree2df7bff62d7ddf555a3f52c375f570c69bece110 /templates
parent8f7d6c5c8de3ee4b6487cf4aeded4919076cac48 (diff)
parentef9c91609f6bae0923cad221dbd7b8f9636aed12 (diff)
downloadvyatta-cfg-system-ed8fd8137a396d7e5e402f61bb0c445517398904.tar.gz
vyatta-cfg-system-ed8fd8137a396d7e5e402f61bb0c445517398904.zip
Merge pull request #37 from upa/lithium-vxlan-remote
Bug #416: adding support for "remote" attribute of VXLAN tunnel
Diffstat (limited to 'templates')
-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