diff options
author | Ryo Nakamura <upa@haeena.net> | 2014-12-19 19:27:55 +0900 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2017-09-14 13:40:33 +0200 |
commit | 7471cd6cf0c5db7b1c185116d2c37a16401c5981 (patch) | |
tree | a67be11b41dbfbc5d233b23e3f26bfaf4928258f /templates/interfaces | |
parent | 124232650ad469241b35f3d5cf63df2d4eab1700 (diff) | |
download | vyatta-cfg-system-7471cd6cf0c5db7b1c185116d2c37a16401c5981.tar.gz vyatta-cfg-system-7471cd6cf0c5db7b1c185116d2c37a16401c5981.zip |
support "remote" attribute of VXLAN tunnel
Diffstat (limited to 'templates/interfaces')
-rw-r--r-- | templates/interfaces/vxlan/node.def | 17 | ||||
-rw-r--r-- | templates/interfaces/vxlan/node.tag/group/node.def | 4 | ||||
-rw-r--r-- | templates/interfaces/vxlan/node.tag/remote/node.def | 9 |
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 |