diff options
author | Christian Poessinger <christian@poessinger.com> | 2019-09-06 13:01:43 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2019-09-06 13:01:43 +0200 |
commit | 10c19415f9c70e28bebacd683dad5da3da7d0817 (patch) | |
tree | b832572aec2abe30abfdcabc8ef78588a1575d67 | |
parent | 6340eaac16702ceae07d6e400c777bf1467312ba (diff) | |
download | vyatta-cfg-system-10c19415f9c70e28bebacd683dad5da3da7d0817.tar.gz vyatta-cfg-system-10c19415f9c70e28bebacd683dad5da3da7d0817.zip |
vxlan: T1636: initial rewrite with XML and Python
11 files changed, 0 insertions, 172 deletions
diff --git a/templates/interfaces/vxlan/node.def b/templates/interfaces/vxlan/node.def deleted file mode 100644 index bb9d1b89..00000000 --- a/templates/interfaces/vxlan/node.def +++ /dev/null @@ -1,68 +0,0 @@ -tag: -priority: 460 -type: txt -help: Virtual eXtensible LAN interface -val_help: <vxlanN>; VXLAN interface name -syntax:expression: pattern $VAR(@) "vxlan[0-9]+$" - -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_GROUP="" - VXLAN_VNI="id $VAR(./vni/@)" - VXLAN_TTL="ttl 16" - VXLAN_PORT="dstport 0" - - if [ ! $VAR(./link/) == "" ]; then - VXLAN_DEV="dev $VAR(./link/@)" - fi - - if [ ! $VAR(./group/) == "" ]; then - VXLAN_GROUP="group $VAR(./group/@)" - if [ -z "$VXLAN_DEV" ]; then - echo "For multicast VXLAN, link (network interface) must be configured" - exit 1 - fi - 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 - - if [ ! $VAR(./remote-port/) == "" ]; then - VXLAN_PORT="dstport $VAR(./remote-port/@)" - fi - - sudo ip link add name $VAR(@) type vxlan \ - $VXLAN_VNI $VXLAN_GROUP $VXLAN_TTL $VXLAN_DEV $VXLAN_PORT - sudo 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 - sudo ip link del dev $VAR(@) - fi - - -end: - if [ -e /tmp/vxlan-$VAR(@)-create ]; then - rm /tmp/vxlan-$VAR(@)-create - fi diff --git a/templates/interfaces/vxlan/node.tag/address/node.def b/templates/interfaces/vxlan/node.tag/address/node.def deleted file mode 100644 index 3cf32ef7..00000000 --- a/templates/interfaces/vxlan/node.tag/address/node.def +++ /dev/null @@ -1,18 +0,0 @@ -multi: -type: txt -help: IP address - -syntax:expression: exec "/opt/vyatta/sbin/valid_address $VAR(@)" - -commit:expression: exec "/opt/vyatta/sbin/vyatta-interfaces.pl --valid-addr-commit $VAR(@@) --dev $VAR(../@)" - -create: sudo /opt/vyatta/sbin/vyatta-address add $VAR(../@) $VAR(@) - -delete: sudo /opt/vyatta/sbin/vyatta-address delete $VAR(../@) $VAR(@) - -allowed: echo "dhcp dhcpv6 <>" - -val_help: ipv4net; IP address and prefix length -val_help: ipv6net; IPv6 address and prefix length -val_help: dhcp; Dynamic Host Configuration Protocol -val_help: dhcpv6; Dynamic Host Configuration Protocol for IPv6 diff --git a/templates/interfaces/vxlan/node.tag/description/node.def b/templates/interfaces/vxlan/node.tag/description/node.def deleted file mode 100644 index 7d88db80..00000000 --- a/templates/interfaces/vxlan/node.tag/description/node.def +++ /dev/null @@ -1,8 +0,0 @@ -type: txt -help: Description - -syntax:expression: pattern $VAR(@) "^.{1,256}$" \ - ; "interface description is too long (limit 256 characters)" - -update: sudo sh -c "echo \"$VAR(@)\" >/sys/class/net/$VAR(../@)/ifalias" -delete: sudo sh -c "echo '' >/sys/class/net/$VAR(../@)/ifalias" diff --git a/templates/interfaces/vxlan/node.tag/group/node.def b/templates/interfaces/vxlan/node.tag/group/node.def deleted file mode 100644 index a3bae7e3..00000000 --- a/templates/interfaces/vxlan/node.tag/group/node.def +++ /dev/null @@ -1,9 +0,0 @@ -type: ipv4 -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 - echo "Chainging group requires delete/create this vxlan interface" - exit 1 - fi diff --git a/templates/interfaces/vxlan/node.tag/ip/arp-cache-timeout/node.def b/templates/interfaces/vxlan/node.tag/ip/arp-cache-timeout/node.def deleted file mode 100644 index 4441914c..00000000 --- a/templates/interfaces/vxlan/node.tag/ip/arp-cache-timeout/node.def +++ /dev/null @@ -1,9 +0,0 @@ -help: ARP cache entry timeout in seconds - -type: u32 - -create:expression: "sudo sh -c \"echo $((1000*$VAR(@))) > /proc/sys/net/ipv4/neigh/$VAR(../../@)/base_reachable_time_ms\" " - -update:expression: "sudo sh -c \"echo $((1000*$VAR(@))) > /proc/sys/net/ipv4/neigh/$VAR(../../@)/base_reachable_time_ms\" " - -delete:expression: "sudo sh -c \"echo 30000 > /proc/sys/net/ipv4/neigh/$VAR(../../@)/base_reachable_time_ms\" " diff --git a/templates/interfaces/vxlan/node.tag/ip/enable-proxy-arp/node.def b/templates/interfaces/vxlan/node.tag/ip/enable-proxy-arp/node.def deleted file mode 100644 index ae7ba09a..00000000 --- a/templates/interfaces/vxlan/node.tag/ip/enable-proxy-arp/node.def +++ /dev/null @@ -1,3 +0,0 @@ -help: Enable proxy-arp on this interface -create:expression: "sudo sh -c \"echo 1 > /proc/sys/net/ipv4/conf/$VAR(../../@)/proxy_arp\" " -delete:expression: "sudo sh -c \"echo 0 > /proc/sys/net/ipv4/conf/$VAR(../../@)/proxy_arp\" " diff --git a/templates/interfaces/vxlan/node.tag/link/node.def b/templates/interfaces/vxlan/node.tag/link/node.def deleted file mode 100644 index d21c7d98..00000000 --- a/templates/interfaces/vxlan/node.tag/link/node.def +++ /dev/null @@ -1,10 +0,0 @@ -type: txt -help: Underlay device name of this VXLAN interface -allowed: ${vyatta_sbindir}/vyatta-interfaces.pl --show all && echo default -val_help:<interface>; Interface to be used as underlay of VXLAN interface - -update: - if [ ! -e /tmp/vxlan-$VAR(../@)-create ]; then - echo "Chainging dev requires delete/create this vxlan interface" - exit 1 - fi diff --git a/templates/interfaces/vxlan/node.tag/mtu/node.def b/templates/interfaces/vxlan/node.tag/mtu/node.def deleted file mode 100644 index 9c213a91..00000000 --- a/templates/interfaces/vxlan/node.tag/mtu/node.def +++ /dev/null @@ -1,17 +0,0 @@ -type: u32 -priority: 461 -help: Maximum Transmission Unit (MTU) -syntax:expression: $VAR(@) >= 1450 && $VAR(@) <= 9000; "Must be between 1450-9000" -val_help: u32:1450-9000; Maximum Transmission Unit (MTU) - -update: - if [ -d /sys/class/net/$VAR(../@) ] ; then - if [ "$VAR(@)" -lt "1500" ]; then - echo "WARNING: RFC7348 recommends VXLAN tunnels preserve a 1500 byte MTU." - fi - sudo ip link set $VAR(../@) mtu $VAR(@) - fi -delete: - if [ -d /sys/class/net/$VAR(../@) ] ; then - sudo ip link set $VAR(../@) mtu 1500 - fi diff --git a/templates/interfaces/vxlan/node.tag/remote-port/node.def b/templates/interfaces/vxlan/node.tag/remote-port/node.def deleted file mode 100644 index c1b4f672..00000000 --- a/templates/interfaces/vxlan/node.tag/remote-port/node.def +++ /dev/null @@ -1,11 +0,0 @@ -type: u32 -help: Remote port for this VXLAN tunnel -val_help: u32:1-65535; Numeric IP port -syntax:expression: $VAR(@) > 0 && $VAR(@) < 65536; - "Port must be between 1 and 65535" - -update: - if [ ! -e /tmp/vxlan-$VAR(../@)-create ]; then - echo "Changing remote port requires delete/create this vxlan interface" - exit 1 - fi diff --git a/templates/interfaces/vxlan/node.tag/remote/node.def b/templates/interfaces/vxlan/node.tag/remote/node.def deleted file mode 100644 index 5e789c48..00000000 --- a/templates/interfaces/vxlan/node.tag/remote/node.def +++ /dev/null @@ -1,9 +0,0 @@ -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 "Changing remote requires delete/create this vxlan interface" - exit 1 - fi diff --git a/templates/interfaces/vxlan/node.tag/vni/node.def b/templates/interfaces/vxlan/node.tag/vni/node.def deleted file mode 100644 index cc54b4b8..00000000 --- a/templates/interfaces/vxlan/node.tag/vni/node.def +++ /dev/null @@ -1,10 +0,0 @@ -type: u32 -help: Virtual network identifier [REQUIRED] -syntax:expression: $VAR(@) >= 0 && $VAR(@) <= 16777216; "Must be between 0-16777216" -val_help: u32: 0-16777214; Virtual network identifier of this VXLAN interface [REQUIRED] - -update: - if [ ! -e /tmp/vxlan-$VAR(../@)-create ]; then - echo "Chainging vni requires delete/create this vxlan interface" - exit 1 - fi |