tag: priority: 460 type: txt help: Virtual eXtensible LAN interface val_help: ; 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(@)" begin: [ -d /sys/module/vxlan ] || sudo modprobe vxlan create: if [ -e /sys/class/net/$VAR(@) ]; then echo "VXLAN interface \"$VAR(@)\" already exists." exit 1 fi VXLAN_VNI="id $VAR(./vni/@)" VXLAN_GROUP="group $VAR(./group/@)" VXLAN_TTL="ttl 16" if [ ! $VAR(./link/) == "" ]; then VXLAN_DEV="dev $VAR(./link/@)" fi ip link add name $VAR(@) type vxlan \ $VXLAN_VNI $VXLAN_GROUP $VXLAN_TTL $VXLAN_DEV ip link set $VAR(@) up touch /tmp/vxlan-$VAR(@)-create delete: if [ ! -e /sys/class/net/$VAR(@) ]; then echo "VXLAN interface \"$VAR(@)\" does not exist." else ip link del dev $VAR(@) fi end: if [ -e /tmp/vxlan-$VAR(@)-create ]; then rm /tmp/vxlan-$VAR(@)-create fi