summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-02-05 22:56:01 +0100
committerChristian Poessinger <christian@poessinger.com>2021-02-05 22:56:01 +0100
commit7640413d9dcb66d8a78148edca150fadaef1f60d (patch)
tree420ce7e6bdec0cbc9786371be881980eccd94f00 /templates
parent3265bf37a79b5231ce738948decb44e63b0647d7 (diff)
downloadvyatta-cfg-quagga-7640413d9dcb66d8a78148edca150fadaef1f60d.tar.gz
vyatta-cfg-quagga-7640413d9dcb66d8a78148edca150fadaef1f60d.zip
T2450: migrate vrf and static routes to vyos-1x
Diffstat (limited to 'templates')
-rw-r--r--templates/protocols/node.def1
-rw-r--r--templates/protocols/static/interface-route/node.def7
-rw-r--r--templates/protocols/static/interface-route/node.tag/next-hop-interface/node.def32
-rw-r--r--templates/protocols/static/interface-route/node.tag/next-hop-interface/node.tag/disable/node.def1
-rw-r--r--templates/protocols/static/interface-route/node.tag/next-hop-interface/node.tag/distance/node.def4
-rw-r--r--templates/protocols/static/interface-route/node.tag/next-hop-interface/node.tag/next-hop-vrf/node.def20
-rw-r--r--templates/protocols/static/interface-route6/node.def7
-rw-r--r--templates/protocols/static/interface-route6/node.tag/next-hop-interface/node.def30
-rw-r--r--templates/protocols/static/interface-route6/node.tag/next-hop-interface/node.tag/disable/node.def1
-rw-r--r--templates/protocols/static/interface-route6/node.tag/next-hop-interface/node.tag/distance/node.def4
-rw-r--r--templates/protocols/static/node.def9
-rw-r--r--templates/protocols/static/route-map/node.def9
-rw-r--r--templates/protocols/static/route/node.def8
-rw-r--r--templates/protocols/static/route/node.tag/blackhole/distance/node.def4
-rw-r--r--templates/protocols/static/route/node.tag/blackhole/node.def24
-rw-r--r--templates/protocols/static/route/node.tag/blackhole/tag/node.def4
-rw-r--r--templates/protocols/static/route/node.tag/dhcp-interface/node.def27
-rw-r--r--templates/protocols/static/route/node.tag/next-hop/node.def43
-rw-r--r--templates/protocols/static/route/node.tag/next-hop/node.tag/disable/node.def1
-rw-r--r--templates/protocols/static/route/node.tag/next-hop/node.tag/distance/node.def4
-rw-r--r--templates/protocols/static/route/node.tag/next-hop/node.tag/next-hop-interface/node.def16
-rw-r--r--templates/protocols/static/route/node.tag/next-hop/node.tag/next-hop-vrf/node.def20
-rw-r--r--templates/protocols/static/route6/node.def7
-rw-r--r--templates/protocols/static/route6/node.tag/blackhole/distance/node.def4
-rw-r--r--templates/protocols/static/route6/node.tag/blackhole/node.def15
-rw-r--r--templates/protocols/static/route6/node.tag/next-hop/node.def49
-rw-r--r--templates/protocols/static/route6/node.tag/next-hop/node.tag/disable/node.def1
-rw-r--r--templates/protocols/static/route6/node.tag/next-hop/node.tag/distance/node.def4
-rw-r--r--templates/protocols/static/route6/node.tag/next-hop/node.tag/interface/node.def6
-rw-r--r--templates/protocols/static/route6/node.tag/next-hop/node.tag/next-hop-vrf/node.def6
-rw-r--r--templates/protocols/static/table/node.def5
-rw-r--r--templates/protocols/static/table/node.tag/interface-route/node.def7
-rw-r--r--templates/protocols/static/table/node.tag/interface-route/node.tag/next-hop-interface/node.def34
-rw-r--r--templates/protocols/static/table/node.tag/interface-route/node.tag/next-hop-interface/node.tag/disable/node.def1
-rw-r--r--templates/protocols/static/table/node.tag/interface-route/node.tag/next-hop-interface/node.tag/distance/node.def4
-rw-r--r--templates/protocols/static/table/node.tag/interface-route6/node.def7
-rw-r--r--templates/protocols/static/table/node.tag/interface-route6/node.tag/next-hop-interface/node.def34
-rw-r--r--templates/protocols/static/table/node.tag/interface-route6/node.tag/next-hop-interface/node.tag/disable/node.def1
-rw-r--r--templates/protocols/static/table/node.tag/interface-route6/node.tag/next-hop-interface/node.tag/distance/node.def4
-rw-r--r--templates/protocols/static/table/node.tag/route/node.def9
-rw-r--r--templates/protocols/static/table/node.tag/route/node.tag/blackhole/distance/node.def4
-rw-r--r--templates/protocols/static/table/node.tag/route/node.tag/blackhole/node.def22
-rw-r--r--templates/protocols/static/table/node.tag/route/node.tag/dhcp-interface/node.def57
-rw-r--r--templates/protocols/static/table/node.tag/route/node.tag/next-hop/node.def48
-rw-r--r--templates/protocols/static/table/node.tag/route/node.tag/next-hop/node.tag/disable/node.def1
-rw-r--r--templates/protocols/static/table/node.tag/route/node.tag/next-hop/node.tag/distance/node.def4
-rw-r--r--templates/protocols/static/table/node.tag/route/node.tag/next-hop/node.tag/next-hop-interface/node.def16
-rw-r--r--templates/protocols/static/table/node.tag/route6/node.def7
-rw-r--r--templates/protocols/static/table/node.tag/route6/node.tag/blackhole/distance/node.def4
-rw-r--r--templates/protocols/static/table/node.tag/route6/node.tag/blackhole/node.def21
-rw-r--r--templates/protocols/static/table/node.tag/route6/node.tag/next-hop/node.def41
-rw-r--r--templates/protocols/static/table/node.tag/route6/node.tag/next-hop/node.tag/disable/node.def1
-rw-r--r--templates/protocols/static/table/node.tag/route6/node.tag/next-hop/node.tag/distance/node.def4
-rw-r--r--templates/protocols/vrf/node.def5
-rw-r--r--templates/protocols/vrf/node.tag/static/interface-route/node.def7
-rw-r--r--templates/protocols/vrf/node.tag/static/interface-route/node.tag/next-hop-interface/node.def35
-rw-r--r--templates/protocols/vrf/node.tag/static/interface-route/node.tag/next-hop-interface/node.tag/disable/node.def1
-rw-r--r--templates/protocols/vrf/node.tag/static/interface-route/node.tag/next-hop-interface/node.tag/distance/node.def4
-rw-r--r--templates/protocols/vrf/node.tag/static/interface-route/node.tag/next-hop-interface/node.tag/next-hop-vrf/node.def22
-rw-r--r--templates/protocols/vrf/node.tag/static/interface-route6/node.def7
-rw-r--r--templates/protocols/vrf/node.tag/static/interface-route6/node.tag/next-hop-interface/node.def37
-rw-r--r--templates/protocols/vrf/node.tag/static/interface-route6/node.tag/next-hop-interface/node.tag/disable/node.def1
-rw-r--r--templates/protocols/vrf/node.tag/static/interface-route6/node.tag/next-hop-interface/node.tag/distance/node.def4
-rw-r--r--templates/protocols/vrf/node.tag/static/interface-route6/node.tag/next-hop-interface/node.tag/next-hop-vrf/node.def7
-rw-r--r--templates/protocols/vrf/node.tag/static/node.def9
-rw-r--r--templates/protocols/vrf/node.tag/static/route/node.def8
-rw-r--r--templates/protocols/vrf/node.tag/static/route/node.tag/blackhole/distance/node.def4
-rw-r--r--templates/protocols/vrf/node.tag/static/route/node.tag/blackhole/node.def18
-rw-r--r--templates/protocols/vrf/node.tag/static/route/node.tag/dhcp-interface/node.def30
-rw-r--r--templates/protocols/vrf/node.tag/static/route/node.tag/next-hop/node.def50
-rw-r--r--templates/protocols/vrf/node.tag/static/route/node.tag/next-hop/node.tag/disable/node.def1
-rw-r--r--templates/protocols/vrf/node.tag/static/route/node.tag/next-hop/node.tag/distance/node.def4
-rw-r--r--templates/protocols/vrf/node.tag/static/route/node.tag/next-hop/node.tag/next-hop-interface/node.def17
-rw-r--r--templates/protocols/vrf/node.tag/static/route/node.tag/next-hop/node.tag/next-hop-vrf/node.def21
-rw-r--r--templates/protocols/vrf/node.tag/static/route6/node.def8
-rw-r--r--templates/protocols/vrf/node.tag/static/route6/node.tag/blackhole/distance/node.def4
-rw-r--r--templates/protocols/vrf/node.tag/static/route6/node.tag/blackhole/node.def16
-rw-r--r--templates/protocols/vrf/node.tag/static/route6/node.tag/next-hop/node.def56
-rw-r--r--templates/protocols/vrf/node.tag/static/route6/node.tag/next-hop/node.tag/disable/node.def1
-rw-r--r--templates/protocols/vrf/node.tag/static/route6/node.tag/next-hop/node.tag/distance/node.def4
-rw-r--r--templates/protocols/vrf/node.tag/static/route6/node.tag/next-hop/node.tag/interface/node.def6
-rw-r--r--templates/protocols/vrf/node.tag/static/route6/node.tag/next-hop/node.tag/next-hop-vrf/node.def7
82 files changed, 0 insertions, 1098 deletions
diff --git a/templates/protocols/node.def b/templates/protocols/node.def
deleted file mode 100644
index 2f7eead5..00000000
--- a/templates/protocols/node.def
+++ /dev/null
@@ -1 +0,0 @@
-help: Routing protocol parameters
diff --git a/templates/protocols/static/interface-route/node.def b/templates/protocols/static/interface-route/node.def
deleted file mode 100644
index 2b9d75ad..00000000
--- a/templates/protocols/static/interface-route/node.def
+++ /dev/null
@@ -1,7 +0,0 @@
-tag:
-type: ipv4net
-help: Interface based static route
-syntax:expression: exec "ipaddrcheck --verbose --is-ipv4-net $VAR(@)"
-
-commit:expression: $VAR(./next-hop-interface/) != "" ; \
- "Must add a next-hop-interface for route $VAR(@)"
diff --git a/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.def b/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.def
deleted file mode 100644
index f8bc9270..00000000
--- a/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.def
+++ /dev/null
@@ -1,32 +0,0 @@
-tag:
-type: txt
-help: Next-hop interface [REQUIRED]
-# show all current interface
-# but syntax accepts any interface since it may exist later (ppp etc)
-allowed: ${vyatta_sbindir}/vyatta-interfaces.pl --show all
-
-
-end:
- if [[ -z "$VAR(./disable)" ]]
- then
- if [[ ${COMMIT_ACTION} = 'DELETE' ]]
- then
- if ! ${vyatta_sbindir}/vyatta-next-hop-check $VAR(../@) ipv4 interface; then
- exit 1;
- fi
- vtysh -c "configure terminal" \
- -c "no ip route $VAR(../@) $VAR(@)"
- else
- if [[ -n "$VAR(./distance/@)" ]]; then
- DIST="$VAR(./distance/@)"
- fi
- if [[ -n "$VAR(./next-hop-vrf/@)" ]]; then
- NEXTHOP_VRF="nexthop-vrf $VAR(./next-hop-vrf/@)"
- fi
- vtysh -c "configure terminal" \
- -c "ip route $VAR(../@) $VAR(@) $NEXTHOP_VRF $DIST";
- fi
- else
- vtysh -c "configure terminal" \
- -c "no ip route $VAR(../@) $VAR(@)"
- fi
diff --git a/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.tag/disable/node.def b/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.tag/disable/node.def
deleted file mode 100644
index 92f2ba51..00000000
--- a/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.tag/disable/node.def
+++ /dev/null
@@ -1 +0,0 @@
-help: Disable IPv4 interface static route
diff --git a/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.tag/distance/node.def b/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.tag/distance/node.def
deleted file mode 100644
index 61abcc65..00000000
--- a/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.tag/distance/node.def
+++ /dev/null
@@ -1,4 +0,0 @@
-type: u32
-help: Distance value for this route
-syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 255; "Must be between (1-255)"
-val_help: u32:1-255; Distance for this route
diff --git a/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.tag/next-hop-vrf/node.def b/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.tag/next-hop-vrf/node.def
deleted file mode 100644
index c4fee0e0..00000000
--- a/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.tag/next-hop-vrf/node.def
+++ /dev/null
@@ -1,20 +0,0 @@
-type: txt
-help: VRF to leak route
-allowed: local -a params
- eval "params=($(cli-shell-api listNodes vrf name))"
- echo -n "${params[@]}"
-val_help: <vrf> ; Name of VRF to leak to
-end:
- if [[ ${COMMIT_ACTION} = 'DELETE' ]]
- then
- if ! ${vyatta_sbindir}/vyatta-next-hop-check $VAR(../@) ipv4 address; then
- exit 1;
- fi
- if ${vyatta_sbindir}/vyatta-gateway-static_route-check.pl \
- "$VAR(../../@)" "$VAR(../@)"
- then
- VRF_NAME=$VAR(../../../../@)
- vtysh -c "configure terminal" \
- -c "no ip route $VAR(../../@) $VAR(../@) nexthop-vrf $VAR(@)"
- fi
- fi
diff --git a/templates/protocols/static/interface-route6/node.def b/templates/protocols/static/interface-route6/node.def
deleted file mode 100644
index e823dbd6..00000000
--- a/templates/protocols/static/interface-route6/node.def
+++ /dev/null
@@ -1,7 +0,0 @@
-tag:
-type: ipv6net
-help: Interface based IPv6 static route
-syntax:expression: exec "ipaddrcheck --verbose --is-ipv6-net $VAR(@)"
-
-commit:expression: $VAR(./next-hop-interface/) != "" ; \
- "Must add a next-hop-interface for route $VAR(@)"
diff --git a/templates/protocols/static/interface-route6/node.tag/next-hop-interface/node.def b/templates/protocols/static/interface-route6/node.tag/next-hop-interface/node.def
deleted file mode 100644
index 279329d6..00000000
--- a/templates/protocols/static/interface-route6/node.tag/next-hop-interface/node.def
+++ /dev/null
@@ -1,30 +0,0 @@
-tag:
-type: txt
-help: Next-hop interface [REQUIRED]
-# show all current interface
-# but syntax accepts any interface since it may exist later (ppp etc)
-allowed: ${vyatta_sbindir}/vyatta-interfaces.pl --show all
-
-end:
- if [[ -z "$VAR(./disable)" ]]
- then
- if [[ ${COMMIT_ACTION} = 'DELETE' ]]
- then
- if ! ${vyatta_sbindir}/vyatta-next-hop-check $VAR(../@) ipv6 interface; then
- exit 1;
- fi
-
- vtysh -c "configure terminal" \
- -c "no ipv6 route $VAR(../@) $VAR(@)"
- else
- if [[ -n "$VAR(./distance/@)" ]]
- then
- DIST="$VAR(./distance/@)"
- fi
- vtysh -c "configure terminal" \
- -c "ipv6 route $VAR(../@) $VAR(@) $DIST";
- fi
- else
- vtysh -c "configure terminal" \
- -c "no ipv6 route $VAR(../@) $VAR(@)"
- fi
diff --git a/templates/protocols/static/interface-route6/node.tag/next-hop-interface/node.tag/disable/node.def b/templates/protocols/static/interface-route6/node.tag/next-hop-interface/node.tag/disable/node.def
deleted file mode 100644
index bc4b57e6..00000000
--- a/templates/protocols/static/interface-route6/node.tag/next-hop-interface/node.tag/disable/node.def
+++ /dev/null
@@ -1 +0,0 @@
-help: Disable IPv6 interface static route
diff --git a/templates/protocols/static/interface-route6/node.tag/next-hop-interface/node.tag/distance/node.def b/templates/protocols/static/interface-route6/node.tag/next-hop-interface/node.tag/distance/node.def
deleted file mode 100644
index 61abcc65..00000000
--- a/templates/protocols/static/interface-route6/node.tag/next-hop-interface/node.tag/distance/node.def
+++ /dev/null
@@ -1,4 +0,0 @@
-type: u32
-help: Distance value for this route
-syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 255; "Must be between (1-255)"
-val_help: u32:1-255; Distance for this route
diff --git a/templates/protocols/static/node.def b/templates/protocols/static/node.def
deleted file mode 100644
index 0cbd6d1b..00000000
--- a/templates/protocols/static/node.def
+++ /dev/null
@@ -1,9 +0,0 @@
-priority: 480
-help: Static route parameters
-end:
- if [ "$COMMIT_ACTION" != "DELETE" ]; then
- vtysh -d zebra -c 'sh run' > /opt/vyatta/etc/quagga/zebra.conf
- else
- rm -f /opt/vyatta/etc/quagga/zebra.conf
- fi
-
diff --git a/templates/protocols/static/route-map/node.def b/templates/protocols/static/route-map/node.def
deleted file mode 100644
index e8120298..00000000
--- a/templates/protocols/static/route-map/node.def
+++ /dev/null
@@ -1,9 +0,0 @@
-priority: 481
-type: txt
-help: Filter routes installed in local route map
-allowed: local -a params
- params=$( /opt/vyatta/sbin/vyatta-policy.pl --list-policy route-map )
- echo -n ${params[@]##*/}
-commit:expression: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --exists \"policy route-map $VAR(@)\" ";"route-map $VAR(@) doesn't exist"
-create:expression: "vtysh -c \"configure terminal\" -c \"ip protocol static route-map $VAR(@)\" "
-delete:expression: "vtysh -c \"configure terminal\" -c \"no ip protocol static\" "
diff --git a/templates/protocols/static/route/node.def b/templates/protocols/static/route/node.def
deleted file mode 100644
index 0d17bb4b..00000000
--- a/templates/protocols/static/route/node.def
+++ /dev/null
@@ -1,8 +0,0 @@
-tag:
-priority: 482
-type: ipv4net
-help: Static route
-syntax:expression: exec "ipaddrcheck --verbose --is-ipv4-net $VAR(@)"
-
-commit:expression: $VAR(./next-hop/) != "" || $VAR(./blackhole/) != "" || $VAR(./dhcp-interface/) != ""; \
- "Must add either a next-hop or blackhole or dhcp-interface for route $VAR(@)"
diff --git a/templates/protocols/static/route/node.tag/blackhole/distance/node.def b/templates/protocols/static/route/node.tag/blackhole/distance/node.def
deleted file mode 100644
index 61abcc65..00000000
--- a/templates/protocols/static/route/node.tag/blackhole/distance/node.def
+++ /dev/null
@@ -1,4 +0,0 @@
-type: u32
-help: Distance value for this route
-syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 255; "Must be between (1-255)"
-val_help: u32:1-255; Distance for this route
diff --git a/templates/protocols/static/route/node.tag/blackhole/node.def b/templates/protocols/static/route/node.tag/blackhole/node.def
deleted file mode 100644
index b513e27b..00000000
--- a/templates/protocols/static/route/node.tag/blackhole/node.def
+++ /dev/null
@@ -1,24 +0,0 @@
-help: Silently discard pkts when matched
-
-end: if [ ${COMMIT_ACTION} = 'DELETE' ]; then
- if ! ${vyatta_sbindir}/vyatta-next-hop-check $VAR(../@) ipv4 address; then
- exit 1;
- fi
-
- vtysh -c "configure terminal" \
- -c "no ip route $VAR(../@) Null0";
- else
- if [ -n "$VAR(./distance/@)" ]; then
- DIST="$VAR(./distance/@)";
- fi
- if [ -n "$VAR(./tag/@)" ]; then
- TAG="$VAR(./tag/@)";
- fi;
- if [[ -z $TAG ]]; then
- vtysh -c "configure terminal" \
- -c "ip route $VAR(../@) Null0 $DIST";
- else
- vtysh -c "configure terminal" \
- -c "ip route $VAR(../@) Null0 tag $TAG $DIST";
- fi;
- fi;
diff --git a/templates/protocols/static/route/node.tag/blackhole/tag/node.def b/templates/protocols/static/route/node.tag/blackhole/tag/node.def
deleted file mode 100644
index 778952ea..00000000
--- a/templates/protocols/static/route/node.tag/blackhole/tag/node.def
+++ /dev/null
@@ -1,4 +0,0 @@
-type: u32
-help: Tag value for this route
-syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 4294967295; "Must be between (1-4294967295)"
-val_help: u32:1-4294967295; Tag for this route
diff --git a/templates/protocols/static/route/node.tag/dhcp-interface/node.def b/templates/protocols/static/route/node.tag/dhcp-interface/node.def
deleted file mode 100644
index 7820800b..00000000
--- a/templates/protocols/static/route/node.tag/dhcp-interface/node.def
+++ /dev/null
@@ -1,27 +0,0 @@
-type: txt
-help: DHCP interface that supplies the next-hop IP address for this static route
-allowed:
- local -a array ;
- array=( /var/lib/dhcp/en* /var/lib/dhcp/eth* /var/lib/dhcp/br* /var/lib/dhcp/bond* ) ;
- echo -n ${array[@]##*/}
-create:
- sudo /opt/vyatta/sbin/vyatta-update-static-route.pl --interface=$VAR(@) --route=$VAR(../@) --table=main --option=create
- RIP=$(/opt/vyatta/sbin/vyatta-dhcp-helper.pl --interface=$VAR(@) --want=router)
- if [ "$RIP" != "127.0.0.1" ]; then
- vtysh -c "configure terminal" \
- -c "ip route $VAR(../@) $RIP"
- fi
-update:
- sudo /opt/vyatta/sbin/vyatta-update-static-route.pl --interface=$VAR(@) --route=$VAR(../@) --table=main --option=create
- RIP=$(/opt/vyatta/sbin/vyatta-dhcp-helper.pl --interface=$VAR(@) --want=router)
- if [ "$RIP" != "127.0.0.1" ]; then
- vtysh -c "configure terminal" \
- -c "ip route $VAR(../@) $RIP"
- fi
-delete:
- sudo /opt/vyatta/sbin/vyatta-update-static-route.pl --interface=$VAR(@) --route=$VAR(../@) --table=main --option=delete
- RIP=$(/opt/vyatta/sbin/vyatta-dhcp-helper.pl --interface=$VAR(@) --want=router)
- if [ "$RIP" != "127.0.0.1" ]; then
- vtysh -c "configure terminal" \
- -c "no ip route $VAR(../@) $RIP"
- fi
diff --git a/templates/protocols/static/route/node.tag/next-hop/node.def b/templates/protocols/static/route/node.tag/next-hop/node.def
deleted file mode 100644
index 0574781d..00000000
--- a/templates/protocols/static/route/node.tag/next-hop/node.def
+++ /dev/null
@@ -1,43 +0,0 @@
-tag:
-type: ipv4
-help: Next-hop router
-end:
- if [[ -z "$VAR(./disable)" ]]
- then
- ### remove the old entry from frr first on an update
- if [ ${COMMIT_ACTION} = 'ACTIVE' ]
- then
- OLD_IF=`cli-shell-api returnEffectiveValue protocols static route $VAR(../@) next-hop $VAR(@) next-hop-interface`
- vtysh -c "configure terminal" \
- -c "no ip route $VAR(../@) $VAR(@) $OLD_IF $VAR(./distance/@)";
- fi
- if [[ ${COMMIT_ACTION} = 'DELETE' ]]
- then
- if ! ${vyatta_sbindir}/vyatta-next-hop-check $VAR(../@) ipv4 address; then
- exit 1;
- fi
- if ${vyatta_sbindir}/vyatta-gateway-static_route-check.pl \
- "$VAR(../@)" "$VAR(@)"
- then
- vtysh -c "configure terminal" \
- -c "no ip route $VAR(../@) $VAR(@)"
- fi
- else
- if [ -n "$VAR(./next-hop-vrf/@)" ]; then
- NEXTHOP_VRF="nexthop-vrf $VAR(./next-hop-vrf/@)"
- fi
- vtysh -c "configure terminal" \
- -c "ip route $VAR(../@) $VAR(@) $VAR(./next-hop-interface/@) $NEXTHOP_VRF $VAR(./distance/@)";
- fi
- else
- if ${vyatta_sbindir}/vyatta-gateway-static_route-check.pl \
- "$VAR(../@)" "$VAR(@)"
- then
- vtysh -c "configure terminal" \
- -c "no ip route $VAR(../@) $VAR(@)"
- fi
- fi
- if [[ "$VAR(../@)" = "0.0.0.0/0" ]]
- then
- ${vyatta_sbindir}/vyatta-gateway-static_route-check.pl warn
- fi
diff --git a/templates/protocols/static/route/node.tag/next-hop/node.tag/disable/node.def b/templates/protocols/static/route/node.tag/next-hop/node.tag/disable/node.def
deleted file mode 100644
index de3afda4..00000000
--- a/templates/protocols/static/route/node.tag/next-hop/node.tag/disable/node.def
+++ /dev/null
@@ -1 +0,0 @@
-help: Disable IPv4 next-hop static route
diff --git a/templates/protocols/static/route/node.tag/next-hop/node.tag/distance/node.def b/templates/protocols/static/route/node.tag/next-hop/node.tag/distance/node.def
deleted file mode 100644
index 61abcc65..00000000
--- a/templates/protocols/static/route/node.tag/next-hop/node.tag/distance/node.def
+++ /dev/null
@@ -1,4 +0,0 @@
-type: u32
-help: Distance value for this route
-syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 255; "Must be between (1-255)"
-val_help: u32:1-255; Distance for this route
diff --git a/templates/protocols/static/route/node.tag/next-hop/node.tag/next-hop-interface/node.def b/templates/protocols/static/route/node.tag/next-hop/node.tag/next-hop-interface/node.def
deleted file mode 100644
index e9d41146..00000000
--- a/templates/protocols/static/route/node.tag/next-hop/node.tag/next-hop-interface/node.def
+++ /dev/null
@@ -1,16 +0,0 @@
-type: txt
-help: IPv4 gateway interface name
-allowed: sh -c "${vyos_completion_dir}/list_interfaces.py"
-end:
- if [[ ${COMMIT_ACTION} = 'DELETE' ]]
- then
- if ! ${vyatta_sbindir}/vyatta-next-hop-check $VAR(../@) ipv4 address; then
- exit 1;
- fi
- if ${vyatta_sbindir}/vyatta-gateway-static_route-check.pl \
- "$VAR(../../@)" "$VAR(../@)"
- then
- vtysh -c "configure terminal" \
- -c "no ip route $VAR(../../@) $VAR(../@) $VAR(@)"
- fi
- fi
diff --git a/templates/protocols/static/route/node.tag/next-hop/node.tag/next-hop-vrf/node.def b/templates/protocols/static/route/node.tag/next-hop/node.tag/next-hop-vrf/node.def
deleted file mode 100644
index 414da0cb..00000000
--- a/templates/protocols/static/route/node.tag/next-hop/node.tag/next-hop-vrf/node.def
+++ /dev/null
@@ -1,20 +0,0 @@
-type: txt
-help: VRF to leak route
-allowed: local -a params
- eval "params=($(cli-shell-api listNodes vrf name))"
- echo -n "${params[@]}"
-val_help: <vrf> ; Name of VRF to leak to
-end:
- VRF_NAME=$VAR(../../../../@)
- if [[ ${COMMIT_ACTION} = 'DELETE' ]]
- then
- if ! ${vyatta_sbindir}/vyatta-next-hop-check $VAR(../@) ipv4 address; then
- exit 1;
- fi
- if ${vyatta_sbindir}/vyatta-gateway-static_route-check.pl \
- "$VAR(../../@)" "$VAR(../@)"
- then
- vtysh -c "configure terminal" \
- -c "no ip route $VAR(../../@) $VAR(../@) nexthop-vrf $VAR(@)"
- fi
- fi
diff --git a/templates/protocols/static/route6/node.def b/templates/protocols/static/route6/node.def
deleted file mode 100644
index 597578a4..00000000
--- a/templates/protocols/static/route6/node.def
+++ /dev/null
@@ -1,7 +0,0 @@
-tag:
-type: ipv6net
-help: Static IPv6 route
-syntax:expression: exec "ipaddrcheck --verbose --is-ipv6-net $VAR(@)"
-
-commit:expression: $VAR(./next-hop/) != "" || $VAR(./blackhole/) != ""; \
- "Must add either a next-hop or blackhole for route $VAR(@)"
diff --git a/templates/protocols/static/route6/node.tag/blackhole/distance/node.def b/templates/protocols/static/route6/node.tag/blackhole/distance/node.def
deleted file mode 100644
index 61abcc65..00000000
--- a/templates/protocols/static/route6/node.tag/blackhole/distance/node.def
+++ /dev/null
@@ -1,4 +0,0 @@
-type: u32
-help: Distance value for this route
-syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 255; "Must be between (1-255)"
-val_help: u32:1-255; Distance for this route
diff --git a/templates/protocols/static/route6/node.tag/blackhole/node.def b/templates/protocols/static/route6/node.tag/blackhole/node.def
deleted file mode 100644
index 87a259d1..00000000
--- a/templates/protocols/static/route6/node.tag/blackhole/node.def
+++ /dev/null
@@ -1,15 +0,0 @@
-help: Silently discard pkts when matched
-end: if [ ${COMMIT_ACTION} = 'DELETE' ]; then
- if ! ${vyatta_sbindir}/vyatta-next-hop-check $VAR(../@) ipv6 address; then
- exit 1;
- fi
-
- vtysh -c "configure terminal" \
- -c "no ipv6 route $VAR(../@) Null0";
- else
- if [ -n "$VAR(./distance/@)" ]; then
- DIST="$VAR(./distance/@)";
- fi;
- vtysh -c "configure terminal" \
- -c "ipv6 route $VAR(../@) Null0 $DIST";
- fi;
diff --git a/templates/protocols/static/route6/node.tag/next-hop/node.def b/templates/protocols/static/route6/node.tag/next-hop/node.def
deleted file mode 100644
index 35a98a9f..00000000
--- a/templates/protocols/static/route6/node.tag/next-hop/node.def
+++ /dev/null
@@ -1,49 +0,0 @@
-tag:
-type: ipv6
-help: Next-hop IPv6 router [REQUIRED]
-end:
- if [[ -z "$VAR(./disable)" ]]
- then
- if [[ ${COMMIT_ACTION} = 'DELETE' ]]
- then
- if ! ${vyatta_sbindir}/vyatta-next-hop-check $VAR(../@) ipv6 address; then
- exit 1;
- fi
- if ${vyatta_sbindir}/vyatta-gateway-static_route-check.pl \
- "$VAR(../@)" "$VAR(@)"
- then
- quagga_conf=`vtysh -c "show running-config" | \
- grep "^ipv6 route $VAR(../@) $VAR(@)"`
- ifname=`echo $quagga_conf | awk '{print $5}'`
-
- vtysh -c "configure terminal" \
- -c "no ipv6 route $VAR(../@) $VAR(@) $ifname"
- fi
- else
- if [[ -n "$VAR(./distance/@)" ]]; then
- DIST="$VAR(./distance/@)"
- fi
-
- if [[ -n "$VAR(./interface/@)" ]]; then
- INTERFACE="$VAR(./interface/@)"
- fi
-
- if [[ -n "$VAR(./next-hop-vrf/@)" ]]; then
- if [ -z "$VAR(./interface/@)" ]; then
- echo "VRF route-leaking requires a next-hop interface to be set in the destination VRF"
- exit 1
- fi
- NEXTHOP_VRF="nexthop-vrf $VAR(./next-hop-vrf/@)"
- fi
-
- vtysh -c "configure terminal" \
- -c "ipv6 route $VAR(../@) $VAR(@) $INTERFACE $NEXTHOP_VRF $DIST";
- fi
- else
- if ${vyatta_sbindir}/vyatta-gateway-static_route-check.pl \
- "$VAR(../@)" "$VAR(@)"
- then
- vtysh -c "configure terminal" \
- -c "no ipv6 route $VAR(../@) $VAR(@)"
- fi
- fi
diff --git a/templates/protocols/static/route6/node.tag/next-hop/node.tag/disable/node.def b/templates/protocols/static/route6/node.tag/next-hop/node.tag/disable/node.def
deleted file mode 100644
index a71e3c24..00000000
--- a/templates/protocols/static/route6/node.tag/next-hop/node.tag/disable/node.def
+++ /dev/null
@@ -1 +0,0 @@
-help: Disable IPv6 next-hop static route
diff --git a/templates/protocols/static/route6/node.tag/next-hop/node.tag/distance/node.def b/templates/protocols/static/route6/node.tag/next-hop/node.tag/distance/node.def
deleted file mode 100644
index 61abcc65..00000000
--- a/templates/protocols/static/route6/node.tag/next-hop/node.tag/distance/node.def
+++ /dev/null
@@ -1,4 +0,0 @@
-type: u32
-help: Distance value for this route
-syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 255; "Must be between (1-255)"
-val_help: u32:1-255; Distance for this route
diff --git a/templates/protocols/static/route6/node.tag/next-hop/node.tag/interface/node.def b/templates/protocols/static/route6/node.tag/next-hop/node.tag/interface/node.def
deleted file mode 100644
index c8479a63..00000000
--- a/templates/protocols/static/route6/node.tag/next-hop/node.tag/interface/node.def
+++ /dev/null
@@ -1,6 +0,0 @@
-type: txt
-help: IPv6 gateway interface name
-# show all current interface
-# but syntax accepts any interface since it may exist later (ppp etc)
-allowed: ${vyatta_sbindir}/vyatta-interfaces.pl --show all
-
diff --git a/templates/protocols/static/route6/node.tag/next-hop/node.tag/next-hop-vrf/node.def b/templates/protocols/static/route6/node.tag/next-hop/node.tag/next-hop-vrf/node.def
deleted file mode 100644
index 45d1a5c1..00000000
--- a/templates/protocols/static/route6/node.tag/next-hop/node.tag/next-hop-vrf/node.def
+++ /dev/null
@@ -1,6 +0,0 @@
-type: txt
-help: VRF to leak route
-allowed: local -a params
- eval "params=($(cli-shell-api listNodes vrf name))"
- echo -n "${params[@]}"
-val_help: <vrf> ; Name of VRF to leak to
diff --git a/templates/protocols/static/table/node.def b/templates/protocols/static/table/node.def
deleted file mode 100644
index 86ec8a44..00000000
--- a/templates/protocols/static/table/node.def
+++ /dev/null
@@ -1,5 +0,0 @@
-tag:
-type: u32
-help: Policy route table number
-syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 200; "Must be between (1-200)"
-val_help: u32:1-200; Policy route table number
diff --git a/templates/protocols/static/table/node.tag/interface-route/node.def b/templates/protocols/static/table/node.tag/interface-route/node.def
deleted file mode 100644
index 2b9d75ad..00000000
--- a/templates/protocols/static/table/node.tag/interface-route/node.def
+++ /dev/null
@@ -1,7 +0,0 @@
-tag:
-type: ipv4net
-help: Interface based static route
-syntax:expression: exec "ipaddrcheck --verbose --is-ipv4-net $VAR(@)"
-
-commit:expression: $VAR(./next-hop-interface/) != "" ; \
- "Must add a next-hop-interface for route $VAR(@)"
diff --git a/templates/protocols/static/table/node.tag/interface-route/node.tag/next-hop-interface/node.def b/templates/protocols/static/table/node.tag/interface-route/node.tag/next-hop-interface/node.def
deleted file mode 100644
index 255e572d..00000000
--- a/templates/protocols/static/table/node.tag/interface-route/node.tag/next-hop-interface/node.def
+++ /dev/null
@@ -1,34 +0,0 @@
-tag:
-type: txt
-help: Next-hop interface [REQUIRED]
-# show all current interface
-# but syntax accepts any interface since it may exist later (ppp etc)
-allowed: ${vyatta_sbindir}/vyatta-interfaces.pl --show all
-
-
-end:
- if [[ -n "$VAR(../../../table/@)" ]]
- then
- table="table $VAR(../../../table/@)"
- fi
- if [[ -z "$VAR(./disable)" ]]
- then
- if [[ ${COMMIT_ACTION} = 'DELETE' ]]
- then
- if ! ${vyatta_sbindir}/vyatta-next-hop-check $VAR(../@) ipv4 interface; then
- exit 1;
- fi
- vtysh -c "configure terminal" \
- -c "no ip route $VAR(../@) $VAR(@) $table"
- else
- if [[ -n "$VAR(./distance/@)" ]]
- then
- dist="$VAR(./distance/@)"
- fi
- vtysh -c "configure terminal" \
- -c "ip route $VAR(../@) $VAR(@) $table $dist";
- fi
- else
- vtysh -c "configure terminal" \
- -c "no ip route $VAR(../@) $VAR(@) $table"
- fi
diff --git a/templates/protocols/static/table/node.tag/interface-route/node.tag/next-hop-interface/node.tag/disable/node.def b/templates/protocols/static/table/node.tag/interface-route/node.tag/next-hop-interface/node.tag/disable/node.def
deleted file mode 100644
index 92f2ba51..00000000
--- a/templates/protocols/static/table/node.tag/interface-route/node.tag/next-hop-interface/node.tag/disable/node.def
+++ /dev/null
@@ -1 +0,0 @@
-help: Disable IPv4 interface static route
diff --git a/templates/protocols/static/table/node.tag/interface-route/node.tag/next-hop-interface/node.tag/distance/node.def b/templates/protocols/static/table/node.tag/interface-route/node.tag/next-hop-interface/node.tag/distance/node.def
deleted file mode 100644
index 61abcc65..00000000
--- a/templates/protocols/static/table/node.tag/interface-route/node.tag/next-hop-interface/node.tag/distance/node.def
+++ /dev/null
@@ -1,4 +0,0 @@
-type: u32
-help: Distance value for this route
-syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 255; "Must be between (1-255)"
-val_help: u32:1-255; Distance for this route
diff --git a/templates/protocols/static/table/node.tag/interface-route6/node.def b/templates/protocols/static/table/node.tag/interface-route6/node.def
deleted file mode 100644
index e823dbd6..00000000
--- a/templates/protocols/static/table/node.tag/interface-route6/node.def
+++ /dev/null
@@ -1,7 +0,0 @@
-tag:
-type: ipv6net
-help: Interface based IPv6 static route
-syntax:expression: exec "ipaddrcheck --verbose --is-ipv6-net $VAR(@)"
-
-commit:expression: $VAR(./next-hop-interface/) != "" ; \
- "Must add a next-hop-interface for route $VAR(@)"
diff --git a/templates/protocols/static/table/node.tag/interface-route6/node.tag/next-hop-interface/node.def b/templates/protocols/static/table/node.tag/interface-route6/node.tag/next-hop-interface/node.def
deleted file mode 100644
index 60e75f78..00000000
--- a/templates/protocols/static/table/node.tag/interface-route6/node.tag/next-hop-interface/node.def
+++ /dev/null
@@ -1,34 +0,0 @@
-tag:
-type: txt
-help: Next-hop interface [REQUIRED]
-# show all current interface
-# but syntax accepts any interface since it may exist later (ppp etc)
-allowed: ${vyatta_sbindir}/vyatta-interfaces.pl --show all
-
-end:
- if [[ -n "$VAR(../../../table/@)" ]]
- then
- table="table $VAR(../../../table/@)"
- fi
- if [[ -z "$VAR(./disable)" ]]
- then
- if [[ ${COMMIT_ACTION} = 'DELETE' ]]
- then
- if ! ${vyatta_sbindir}/vyatta-next-hop-check $VAR(../@) ipv6 interface; then
- exit 1;
- fi
-
- vtysh -c "configure terminal" \
- -c "no ipv6 route $VAR(../@) $VAR(@) $table"
- else
- if [[ -n "$VAR(./distance/@)" ]]
- then
- dist="$VAR(./distance/@)"
- fi
- vtysh -c "configure terminal" \
- -c "ipv6 route $VAR(../@) $VAR(@) $table $dist";
- fi
- else
- vtysh -c "configure terminal" \
- -c "no ipv6 route $VAR(../@) $VAR(@) $table"
- fi
diff --git a/templates/protocols/static/table/node.tag/interface-route6/node.tag/next-hop-interface/node.tag/disable/node.def b/templates/protocols/static/table/node.tag/interface-route6/node.tag/next-hop-interface/node.tag/disable/node.def
deleted file mode 100644
index bc4b57e6..00000000
--- a/templates/protocols/static/table/node.tag/interface-route6/node.tag/next-hop-interface/node.tag/disable/node.def
+++ /dev/null
@@ -1 +0,0 @@
-help: Disable IPv6 interface static route
diff --git a/templates/protocols/static/table/node.tag/interface-route6/node.tag/next-hop-interface/node.tag/distance/node.def b/templates/protocols/static/table/node.tag/interface-route6/node.tag/next-hop-interface/node.tag/distance/node.def
deleted file mode 100644
index 61abcc65..00000000
--- a/templates/protocols/static/table/node.tag/interface-route6/node.tag/next-hop-interface/node.tag/distance/node.def
+++ /dev/null
@@ -1,4 +0,0 @@
-type: u32
-help: Distance value for this route
-syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 255; "Must be between (1-255)"
-val_help: u32:1-255; Distance for this route
diff --git a/templates/protocols/static/table/node.tag/route/node.def b/templates/protocols/static/table/node.tag/route/node.def
deleted file mode 100644
index 85e75fe7..00000000
--- a/templates/protocols/static/table/node.tag/route/node.def
+++ /dev/null
@@ -1,9 +0,0 @@
-tag:
-type: ipv4net
-help: Static route
-syntax:expression: exec "ipaddrcheck --verbose --is-ipv4-net $VAR(@)"
-
-commit:expression: $VAR(./next-hop/) != "" || $VAR(./blackhole/) != "" || $VAR(./dhcp-interface/) != ""; \
- "Must add either a next-hop or blackhole or dhcp-interface for route $VAR(@)"
-commit:expression: $VAR(./next-hop/) == "" || $VAR(./dhcp-interface/) == ""; \
- "Must configure only one of next-hop or dhcp-interface for route $VAR(@)"
diff --git a/templates/protocols/static/table/node.tag/route/node.tag/blackhole/distance/node.def b/templates/protocols/static/table/node.tag/route/node.tag/blackhole/distance/node.def
deleted file mode 100644
index 61abcc65..00000000
--- a/templates/protocols/static/table/node.tag/route/node.tag/blackhole/distance/node.def
+++ /dev/null
@@ -1,4 +0,0 @@
-type: u32
-help: Distance value for this route
-syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 255; "Must be between (1-255)"
-val_help: u32:1-255; Distance for this route
diff --git a/templates/protocols/static/table/node.tag/route/node.tag/blackhole/node.def b/templates/protocols/static/table/node.tag/route/node.tag/blackhole/node.def
deleted file mode 100644
index 727909e8..00000000
--- a/templates/protocols/static/table/node.tag/route/node.tag/blackhole/node.def
+++ /dev/null
@@ -1,22 +0,0 @@
-help: Silently discard pkts when matched
-
-end:
- if [[ -n "$VAR(../../../table/@)" ]]
- then
- table="table $VAR(../../../table/@)"
- fi
- if [ ${COMMIT_ACTION} = 'DELETE' ]; then
- if ! ${vyatta_sbindir}/vyatta-next-hop-check $VAR(../@) ipv4 address; then
- exit 1;
- fi
-
- vtysh -c "configure terminal" \
- -c "no ip route $VAR(../@) Null0 $table";
- else
- if [ -n "$VAR(./distance/@)" ]; then
- dist="$VAR(./distance/@)";
- fi;
-
- vtysh -c "configure terminal" \
- -c "ip route $VAR(../@) Null0 $table $dist";
- fi;
diff --git a/templates/protocols/static/table/node.tag/route/node.tag/dhcp-interface/node.def b/templates/protocols/static/table/node.tag/route/node.tag/dhcp-interface/node.def
deleted file mode 100644
index 3f0afdb1..00000000
--- a/templates/protocols/static/table/node.tag/route/node.tag/dhcp-interface/node.def
+++ /dev/null
@@ -1,57 +0,0 @@
-type: txt
-help: DHCP interface that supplies the next-hop IP address for this static route
-allowed:
- local -a array ;
- array=( /var/lib/dhcp/en* /var/lib/dhcp/eth* /var/lib/dhcp/br* /var/lib/dhcp/bond* ) ;
- echo -n ${array[@]##*/}
-create:
- ifc="$VAR(@)"
- route="$VAR(../@)"
- table="$VAR(../../@)"
- sudo /opt/vyatta/sbin/vyatta-update-static-route.pl --interface=$ifc --route=$route --table=$table --option=create
- RIP=$(/opt/vyatta/sbin/vyatta-dhcp-helper.pl --interface=$ifc --want=router)
- if [ "$RIP" != "127.0.0.1" ]; then
- vtysh -c "configure terminal" \
- -c "ip route $route $RIP table $table"
- fi
- if [ "$route" == "0.0.0.0/0" ]; then
- LIP=$(/opt/vyatta/sbin/vyatta-dhcp-helper.pl --interface=$ifc --want=local)
- if [ "$LIP" != "127.0.0.1" ]; then
- MARK=$(dc 0x7fffffff $table + p)
- sudo /sbin/iptables -t mangle -I OUTPUT -s $LIP/32 -j MARK --set-mark $MARK
- fi
- fi
-update:
- ifc="$VAR(@)"
- route="$VAR(../@)"
- table="$VAR(../../@)"
- sudo /opt/vyatta/sbin/vyatta-update-static-route.pl --interface=$ifc --route=$route --table=$table --option=create
- RIP=$(/opt/vyatta/sbin/vyatta-dhcp-helper.pl --interface=$ifc --want=router)
- if [ "$RIP" != "127.0.0.1" ]; then
- vtysh -c "configure terminal" \
- -c "ip route $route $RIP table $table"
- fi
- if [ "$route" == "0.0.0.0/0" ]; then
- LIP=$(/opt/vyatta/sbin/vyatta-dhcp-helper.pl --interface=$ifc --want=local)
- if [ "$LIP" != "127.0.0.1" ]; then
- MARK=$(dc 0x7fffffff $table + p)
- sudo /sbin/iptables -t mangle -I OUTPUT -s $LIP/32 -j MARK --set-mark $MARK
- fi
- fi
-delete:
- ifc="$VAR(@)"
- route="$VAR(../@)"
- table="$VAR(../../@)"
- sudo /opt/vyatta/sbin/vyatta-update-static-route.pl --interface=$ifc --route=$route --table=$table --option=delete
- RIP=$(/opt/vyatta/sbin/vyatta-dhcp-helper.pl --interface=$ifc --want=router)
- if [ "$RIP" != "127.0.0.1" ]; then
- vtysh -c "configure terminal" \
- -c "no ip route $route $RIP table $table"
- fi
- if [ "$route" == "0.0.0.0/0" ]; then
- LIP=$(/opt/vyatta/sbin/vyatta-dhcp-helper.pl --interface=$ifc --want=local)
- if [ "$LIP" != "127.0.0.1" ]; then
- MARK=$(dc 0x7fffffff $table + p)
- sudo /sbin/iptables -t mangle -D OUTPUT -s $LIP/32 -j MARK --set-mark $MARK
- fi
- fi
diff --git a/templates/protocols/static/table/node.tag/route/node.tag/next-hop/node.def b/templates/protocols/static/table/node.tag/route/node.tag/next-hop/node.def
deleted file mode 100644
index eb99af50..00000000
--- a/templates/protocols/static/table/node.tag/route/node.tag/next-hop/node.def
+++ /dev/null
@@ -1,48 +0,0 @@
-tag:
-type: ipv4
-help: Next-hop router
-end:
- if [[ -n "$VAR(../../../table/@)" ]]
- then
- table="table $VAR(../../../table/@)"
- fi
- if [[ -z "$VAR(./disable)" ]]
- then
- ### remove the old entry from frr first on an update
- if [ ${COMMIT_ACTION} = 'ACTIVE' ]
- then
- OLD_IF=`cli-shell-api returnEffectiveValue protocols static $table route $VAR(../@) next-hop $VAR(@) next-hop-interface`
- vtysh -c "configure terminal" \
- -c "no ip route $VAR(../@) $VAR(@) $OLD_IF $VAR(./distance/@) $table";
- fi
-
- if [[ ${COMMIT_ACTION} = 'DELETE' ]]
- then
- if ! ${vyatta_sbindir}/vyatta-next-hop-check $VAR(../@) ipv4 address; then
- exit 1;
- fi
- if ${vyatta_sbindir}/vyatta-gateway-static_route-check.pl \
- "$VAR(../@)" "$VAR(@)"
- then
- DIST=`cli-shell-api returnEffectiveValue protocols static $table route $VAR(../@) next-hop $VAR(@) distance`
- NHIF=`cli-shell-api returnEffectiveValue protocols static $table route $VAR(../@) next-hop $VAR(@) next-hop-interface`
- vtysh -c "configure terminal" \
- -c "no ip route $VAR(../@) $VAR(@) $NHIF $DIST $table";
- fi
- else
- if [[ -n "$VAR(./distance/@)" ]]
- then
- dist="$VAR(./distance/@)"
- fi
- vtysh -c "configure terminal" \
- -c "ip route $VAR(../@) $VAR(@) $VAR(./next-hop-interface/@) $table $dist";
- fi
- else
- if ${vyatta_sbindir}/vyatta-gateway-static_route-check.pl \
- "$VAR(../@)" "$VAR(@)"
- then
- vtysh -c "configure terminal" \
- -c "no ip route $VAR(../@) $VAR(@) $table"
- fi
- fi
-
diff --git a/templates/protocols/static/table/node.tag/route/node.tag/next-hop/node.tag/disable/node.def b/templates/protocols/static/table/node.tag/route/node.tag/next-hop/node.tag/disable/node.def
deleted file mode 100644
index de3afda4..00000000
--- a/templates/protocols/static/table/node.tag/route/node.tag/next-hop/node.tag/disable/node.def
+++ /dev/null
@@ -1 +0,0 @@
-help: Disable IPv4 next-hop static route
diff --git a/templates/protocols/static/table/node.tag/route/node.tag/next-hop/node.tag/distance/node.def b/templates/protocols/static/table/node.tag/route/node.tag/next-hop/node.tag/distance/node.def
deleted file mode 100644
index 61abcc65..00000000
--- a/templates/protocols/static/table/node.tag/route/node.tag/next-hop/node.tag/distance/node.def
+++ /dev/null
@@ -1,4 +0,0 @@
-type: u32
-help: Distance value for this route
-syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 255; "Must be between (1-255)"
-val_help: u32:1-255; Distance for this route
diff --git a/templates/protocols/static/table/node.tag/route/node.tag/next-hop/node.tag/next-hop-interface/node.def b/templates/protocols/static/table/node.tag/route/node.tag/next-hop/node.tag/next-hop-interface/node.def
deleted file mode 100644
index 17979d4b..00000000
--- a/templates/protocols/static/table/node.tag/route/node.tag/next-hop/node.tag/next-hop-interface/node.def
+++ /dev/null
@@ -1,16 +0,0 @@
-type: txt
-help: network interface
-allowed: sh -c "${vyos_completion_dir}/list_interfaces.py"
-end:
- if [[ ${COMMIT_ACTION} = 'DELETE' ]]
- then
- if ! ${vyatta_sbindir}/vyatta-next-hop-check $VAR(../@) ipv4 address; then
- exit 1;
- fi
- if ${vyatta_sbindir}/vyatta-gateway-static_route-check.pl \
- "$VAR(../../@)" "$VAR(../@)"
- then
- vtysh -c "configure terminal" \
- -c "no ip route $VAR(../../@) $VAR(../@) $VAR(@)"
- fi
- fi
diff --git a/templates/protocols/static/table/node.tag/route6/node.def b/templates/protocols/static/table/node.tag/route6/node.def
deleted file mode 100644
index 597578a4..00000000
--- a/templates/protocols/static/table/node.tag/route6/node.def
+++ /dev/null
@@ -1,7 +0,0 @@
-tag:
-type: ipv6net
-help: Static IPv6 route
-syntax:expression: exec "ipaddrcheck --verbose --is-ipv6-net $VAR(@)"
-
-commit:expression: $VAR(./next-hop/) != "" || $VAR(./blackhole/) != ""; \
- "Must add either a next-hop or blackhole for route $VAR(@)"
diff --git a/templates/protocols/static/table/node.tag/route6/node.tag/blackhole/distance/node.def b/templates/protocols/static/table/node.tag/route6/node.tag/blackhole/distance/node.def
deleted file mode 100644
index 61abcc65..00000000
--- a/templates/protocols/static/table/node.tag/route6/node.tag/blackhole/distance/node.def
+++ /dev/null
@@ -1,4 +0,0 @@
-type: u32
-help: Distance value for this route
-syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 255; "Must be between (1-255)"
-val_help: u32:1-255; Distance for this route
diff --git a/templates/protocols/static/table/node.tag/route6/node.tag/blackhole/node.def b/templates/protocols/static/table/node.tag/route6/node.tag/blackhole/node.def
deleted file mode 100644
index 2ecd16fc..00000000
--- a/templates/protocols/static/table/node.tag/route6/node.tag/blackhole/node.def
+++ /dev/null
@@ -1,21 +0,0 @@
-help: Silently discard pkts when matched
-
-end:
- if [[ -n "$VAR(../../../table/@)" ]]
- then
- table="table $VAR(../../../table/@)"
- fi
- if [ ${COMMIT_ACTION} = 'DELETE' ]; then
- if ! ${vyatta_sbindir}/vyatta-next-hop-check $VAR(../@) ipv6 address; then
- exit 1;
- fi
-
- vtysh -c "configure terminal" \
- -c "no ipv6 route $VAR(../@) Null0 $table";
- else
- if [ -n "$VAR(./distance/@)" ]; then
- dist="$VAR(./distance/@)";
- fi;
- vtysh -c "configure terminal" \
- -c "ipv6 route $VAR(../@) Null0 $table $dist";
- fi;
diff --git a/templates/protocols/static/table/node.tag/route6/node.tag/next-hop/node.def b/templates/protocols/static/table/node.tag/route6/node.tag/next-hop/node.def
deleted file mode 100644
index 20514d0f..00000000
--- a/templates/protocols/static/table/node.tag/route6/node.tag/next-hop/node.def
+++ /dev/null
@@ -1,41 +0,0 @@
-tag:
-
-type: ipv6
-
-help: Next-hop IPv6 router [REQUIRED]
-
-end:
- if [[ -n "$VAR(../../../table/@)" ]]
- then
- table="table $VAR(../../../table/@)"
- fi
- if [[ -z "$VAR(./disable)" ]]
- then
- if [[ ${COMMIT_ACTION} = 'DELETE' ]]
- then
- if ! ${vyatta_sbindir}/vyatta-next-hop-check $VAR(../@) ipv6 address; then
- exit 1;
- fi
- if ${vyatta_sbindir}/vyatta-gateway-static_route-check.pl \
- "$VAR(../@)" "$VAR(@)"
- then
- vtysh -c "configure terminal" \
- -c "no ipv6 route $VAR(../@) $VAR(@) $table"
- fi
- else
- if [[ -n "$VAR(./distance/@)" ]]
- then
- DIST="$VAR(./distance/@)"
- fi
-
- vtysh -c "configure terminal" \
- -c "ipv6 route $VAR(../@) $VAR(@) $table $DIST";
- fi
- else
- if ${vyatta_sbindir}/vyatta-gateway-static_route-check.pl \
- "$VAR(../@)" "$VAR(@)"
- then
- vtysh -c "configure terminal" \
- -c "no ipv6 route $VAR(../@) $VAR(@) $table"
- fi
- fi
diff --git a/templates/protocols/static/table/node.tag/route6/node.tag/next-hop/node.tag/disable/node.def b/templates/protocols/static/table/node.tag/route6/node.tag/next-hop/node.tag/disable/node.def
deleted file mode 100644
index a71e3c24..00000000
--- a/templates/protocols/static/table/node.tag/route6/node.tag/next-hop/node.tag/disable/node.def
+++ /dev/null
@@ -1 +0,0 @@
-help: Disable IPv6 next-hop static route
diff --git a/templates/protocols/static/table/node.tag/route6/node.tag/next-hop/node.tag/distance/node.def b/templates/protocols/static/table/node.tag/route6/node.tag/next-hop/node.tag/distance/node.def
deleted file mode 100644
index 61abcc65..00000000
--- a/templates/protocols/static/table/node.tag/route6/node.tag/next-hop/node.tag/distance/node.def
+++ /dev/null
@@ -1,4 +0,0 @@
-type: u32
-help: Distance value for this route
-syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 255; "Must be between (1-255)"
-val_help: u32:1-255; Distance for this route
diff --git a/templates/protocols/vrf/node.def b/templates/protocols/vrf/node.def
deleted file mode 100644
index d8da3d39..00000000
--- a/templates/protocols/vrf/node.def
+++ /dev/null
@@ -1,5 +0,0 @@
-tag:
-type: txt
-help: VRF routing protocol parameters
-allowed: cli-shell-api listNodes vrf name
-val_help: <vrf> ; Name of VRF to add route for
diff --git a/templates/protocols/vrf/node.tag/static/interface-route/node.def b/templates/protocols/vrf/node.tag/static/interface-route/node.def
deleted file mode 100644
index 2b9d75ad..00000000
--- a/templates/protocols/vrf/node.tag/static/interface-route/node.def
+++ /dev/null
@@ -1,7 +0,0 @@
-tag:
-type: ipv4net
-help: Interface based static route
-syntax:expression: exec "ipaddrcheck --verbose --is-ipv4-net $VAR(@)"
-
-commit:expression: $VAR(./next-hop-interface/) != "" ; \
- "Must add a next-hop-interface for route $VAR(@)"
diff --git a/templates/protocols/vrf/node.tag/static/interface-route/node.tag/next-hop-interface/node.def b/templates/protocols/vrf/node.tag/static/interface-route/node.tag/next-hop-interface/node.def
deleted file mode 100644
index 5a2b304b..00000000
--- a/templates/protocols/vrf/node.tag/static/interface-route/node.tag/next-hop-interface/node.def
+++ /dev/null
@@ -1,35 +0,0 @@
-tag:
-type: txt
-help: Next-hop interface [REQUIRED]
-# show all current interface
-# but syntax accepts any interface since it may exist later (ppp etc)
-allowed: ${vyatta_sbindir}/vyatta-interfaces.pl --show all
-
-
-end:
- VRF_NAME=$VAR(../../../@)
- if [[ -z "$VAR(./disable)" ]]
- then
- if [[ ${COMMIT_ACTION} = 'DELETE' ]]
- then
- if ! ${vyatta_sbindir}/vyatta-next-hop-check $VAR(../@) ipv4 interface; then
- exit 1;
- fi
- vtysh -c "configure terminal" \
- -c "no ip route $VAR(../@) $VAR(@) vrf $VRF_NAME"
- else
- if [[ -n "$VAR(./distance/@)" ]]; then
- DIST="$VAR(./distance/@)"
- fi
- if [[ -n "$VAR(./next-hop-vrf/@)" ]]; then
- NEXTHOP_VRF="nexthop-vrf $VAR(./next-hop-vrf/@)"
- fi
- vtysh -c "configure terminal" \
- -c "vrf $VRF_NAME" \
- -c "ip route $VAR(../@) $VAR(@) $NEXTHOP_VRF $DIST";
- fi
- else
- vtysh -c "configure terminal" \
- -c "vrf $VRF_NAME" \
- -c "no ip route $VAR(../@) $VAR(@)"
- fi
diff --git a/templates/protocols/vrf/node.tag/static/interface-route/node.tag/next-hop-interface/node.tag/disable/node.def b/templates/protocols/vrf/node.tag/static/interface-route/node.tag/next-hop-interface/node.tag/disable/node.def
deleted file mode 100644
index 92f2ba51..00000000
--- a/templates/protocols/vrf/node.tag/static/interface-route/node.tag/next-hop-interface/node.tag/disable/node.def
+++ /dev/null
@@ -1 +0,0 @@
-help: Disable IPv4 interface static route
diff --git a/templates/protocols/vrf/node.tag/static/interface-route/node.tag/next-hop-interface/node.tag/distance/node.def b/templates/protocols/vrf/node.tag/static/interface-route/node.tag/next-hop-interface/node.tag/distance/node.def
deleted file mode 100644
index 61abcc65..00000000
--- a/templates/protocols/vrf/node.tag/static/interface-route/node.tag/next-hop-interface/node.tag/distance/node.def
+++ /dev/null
@@ -1,4 +0,0 @@
-type: u32
-help: Distance value for this route
-syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 255; "Must be between (1-255)"
-val_help: u32:1-255; Distance for this route
diff --git a/templates/protocols/vrf/node.tag/static/interface-route/node.tag/next-hop-interface/node.tag/next-hop-vrf/node.def b/templates/protocols/vrf/node.tag/static/interface-route/node.tag/next-hop-interface/node.tag/next-hop-vrf/node.def
deleted file mode 100644
index ee872997..00000000
--- a/templates/protocols/vrf/node.tag/static/interface-route/node.tag/next-hop-interface/node.tag/next-hop-vrf/node.def
+++ /dev/null
@@ -1,22 +0,0 @@
-type: txt
-help: VRF to leak route
-allowed: local -a params
- params=('default')
- eval "params+=($(cli-shell-api listNodes vrf name))"
- echo -n "${params[@]}"
-val_help: <vrf> ; Name of VRF to leak to
-end:
- if [[ ${COMMIT_ACTION} = 'DELETE' ]]
- then
- if ! ${vyatta_sbindir}/vyatta-next-hop-check $VAR(../@) ipv4 address; then
- exit 1;
- fi
- if ${vyatta_sbindir}/vyatta-gateway-static_route-check.pl \
- "$VAR(../../@)" "$VAR(../@)"
- then
- VRF_NAME=$VAR(../../../../@)
- vtysh -c "configure terminal" \
- -c "vrf $VRF_NAME" \
- -c "no ip route $VAR(../../@) $VAR(../@) nexthop-vrf $VAR(@)"
- fi
- fi
diff --git a/templates/protocols/vrf/node.tag/static/interface-route6/node.def b/templates/protocols/vrf/node.tag/static/interface-route6/node.def
deleted file mode 100644
index e823dbd6..00000000
--- a/templates/protocols/vrf/node.tag/static/interface-route6/node.def
+++ /dev/null
@@ -1,7 +0,0 @@
-tag:
-type: ipv6net
-help: Interface based IPv6 static route
-syntax:expression: exec "ipaddrcheck --verbose --is-ipv6-net $VAR(@)"
-
-commit:expression: $VAR(./next-hop-interface/) != "" ; \
- "Must add a next-hop-interface for route $VAR(@)"
diff --git a/templates/protocols/vrf/node.tag/static/interface-route6/node.tag/next-hop-interface/node.def b/templates/protocols/vrf/node.tag/static/interface-route6/node.tag/next-hop-interface/node.def
deleted file mode 100644
index 52f198b1..00000000
--- a/templates/protocols/vrf/node.tag/static/interface-route6/node.tag/next-hop-interface/node.def
+++ /dev/null
@@ -1,37 +0,0 @@
-tag:
-type: txt
-help: Next-hop interface [REQUIRED]
-# show all current interface
-# but syntax accepts any interface since it may exist later (ppp etc)
-allowed: ${vyatta_sbindir}/vyatta-interfaces.pl --show all
-
-end:
- if [[ -z "$VAR(./disable)" ]]
- then
- VRF_NAME=$VAR(../../../@)
- if [[ ${COMMIT_ACTION} = 'DELETE' ]]
- then
- if ! ${vyatta_sbindir}/vyatta-next-hop-check $VAR(../@) ipv6 interface; then
- exit 1;
- fi
-
- vtysh -c "configure terminal" \
- -c "vrf $VRF_NAME" \
- -c "no ipv6 route $VAR(../@) $VAR(@)"
- else
- if [[ -n "$VAR(./distance/@)" ]]; then
- DIST="$VAR(./distance/@)"
- fi
- if [[ -n "$VAR(./next-hop-vrf/@)" ]]; then
- NEXTHOP_VRF="nexthop-vrf $VAR(./next-hop-vrf/@)"
- fi
-
- vtysh -c "configure terminal" \
- -c "vrf $VRF_NAME" \
- -c "ipv6 route $VAR(../@) $VAR(@) $NEXTHOP_VRF $DIST";
- fi
- else
- vtysh -c "configure terminal" \
- -c "vrf $VRF_NAME" \
- -c "no ipv6 route $VAR(../@) $VAR(@)"
- fi
diff --git a/templates/protocols/vrf/node.tag/static/interface-route6/node.tag/next-hop-interface/node.tag/disable/node.def b/templates/protocols/vrf/node.tag/static/interface-route6/node.tag/next-hop-interface/node.tag/disable/node.def
deleted file mode 100644
index bc4b57e6..00000000
--- a/templates/protocols/vrf/node.tag/static/interface-route6/node.tag/next-hop-interface/node.tag/disable/node.def
+++ /dev/null
@@ -1 +0,0 @@
-help: Disable IPv6 interface static route
diff --git a/templates/protocols/vrf/node.tag/static/interface-route6/node.tag/next-hop-interface/node.tag/distance/node.def b/templates/protocols/vrf/node.tag/static/interface-route6/node.tag/next-hop-interface/node.tag/distance/node.def
deleted file mode 100644
index 61abcc65..00000000
--- a/templates/protocols/vrf/node.tag/static/interface-route6/node.tag/next-hop-interface/node.tag/distance/node.def
+++ /dev/null
@@ -1,4 +0,0 @@
-type: u32
-help: Distance value for this route
-syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 255; "Must be between (1-255)"
-val_help: u32:1-255; Distance for this route
diff --git a/templates/protocols/vrf/node.tag/static/interface-route6/node.tag/next-hop-interface/node.tag/next-hop-vrf/node.def b/templates/protocols/vrf/node.tag/static/interface-route6/node.tag/next-hop-interface/node.tag/next-hop-vrf/node.def
deleted file mode 100644
index 7eee837e..00000000
--- a/templates/protocols/vrf/node.tag/static/interface-route6/node.tag/next-hop-interface/node.tag/next-hop-vrf/node.def
+++ /dev/null
@@ -1,7 +0,0 @@
-type: txt
-help: VRF to leak route
-allowed: local -a params
- params=('default')
- eval "params+=($(cli-shell-api listNodes vrf name))"
- echo -n "${params[@]}"
-val_help: <vrf> ; Name of VRF to leak to
diff --git a/templates/protocols/vrf/node.tag/static/node.def b/templates/protocols/vrf/node.tag/static/node.def
deleted file mode 100644
index 3926f26d..00000000
--- a/templates/protocols/vrf/node.tag/static/node.def
+++ /dev/null
@@ -1,9 +0,0 @@
-priority: 481
-help: Static route parameters
-end:
- if [ "$COMMIT_ACTION" != "DELETE" ]; then
- vtysh -d zebra -c 'sh run' > /opt/vyatta/etc/quagga/zebra.conf
- else
- rm -f /opt/vyatta/etc/quagga/zebra.conf
- fi
-
diff --git a/templates/protocols/vrf/node.tag/static/route/node.def b/templates/protocols/vrf/node.tag/static/route/node.def
deleted file mode 100644
index 43c77c71..00000000
--- a/templates/protocols/vrf/node.tag/static/route/node.def
+++ /dev/null
@@ -1,8 +0,0 @@
-tag:
-priority: 482
-type: ipv4net
-help: VRF static IPv4 route
-syntax:expression: exec "ipaddrcheck --verbose --is-ipv4-net $VAR(@)"
-
-commit:expression: $VAR(./next-hop/) != "" || $VAR(./blackhole/) != "" || $VAR(./dhcp-interface/) != ""; \
- "Must add either a next-hop or blackhole or dhcp-interface for route $VAR(@)"
diff --git a/templates/protocols/vrf/node.tag/static/route/node.tag/blackhole/distance/node.def b/templates/protocols/vrf/node.tag/static/route/node.tag/blackhole/distance/node.def
deleted file mode 100644
index 61abcc65..00000000
--- a/templates/protocols/vrf/node.tag/static/route/node.tag/blackhole/distance/node.def
+++ /dev/null
@@ -1,4 +0,0 @@
-type: u32
-help: Distance value for this route
-syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 255; "Must be between (1-255)"
-val_help: u32:1-255; Distance for this route
diff --git a/templates/protocols/vrf/node.tag/static/route/node.tag/blackhole/node.def b/templates/protocols/vrf/node.tag/static/route/node.tag/blackhole/node.def
deleted file mode 100644
index 0e7d56d7..00000000
--- a/templates/protocols/vrf/node.tag/static/route/node.tag/blackhole/node.def
+++ /dev/null
@@ -1,18 +0,0 @@
-help: Silently discard pkts when matched
-
-end:
- VRF_NAME=$VAR(../../../@)
- if [ ${COMMIT_ACTION} = 'DELETE' ]; then
- if ! ${vyatta_sbindir}/vyatta-next-hop-check $VAR(../@) ipv4 address; then
- exit 1;
- fi
-
- vtysh -c "configure terminal" \
- -c "no ip route $VAR(../@) Null0 vrf $VRF_NAME";
- else
- if [ -n "$VAR(./distance/@)" ]; then
- DIST="$VAR(./distance/@)";
- fi;
- vtysh -c "configure terminal" \
- -c "ip route $VAR(../@) Null0 vrf $VRF_NAME $DIST";
- fi;
diff --git a/templates/protocols/vrf/node.tag/static/route/node.tag/dhcp-interface/node.def b/templates/protocols/vrf/node.tag/static/route/node.tag/dhcp-interface/node.def
deleted file mode 100644
index aa9b0956..00000000
--- a/templates/protocols/vrf/node.tag/static/route/node.tag/dhcp-interface/node.def
+++ /dev/null
@@ -1,30 +0,0 @@
-type: txt
-help: DHCP interface that supplies the next-hop IP address for this static route
-allowed:
- local -a array ;
- array=( /var/lib/dhcp/en* /var/lib/dhcp/eth* /var/lib/dhcp/br* /var/lib/dhcp/bond* ) ;
- echo -n ${array[@]##*/}
-create:
- sudo /opt/vyatta/sbin/vyatta-update-static-route.pl --interface=$VAR(@) --route=$VAR(../@) --table=main --option=create
- VRF_NAME=$VAR(../../../@)
- RIP=$(/opt/vyatta/sbin/vyatta-dhcp-helper.pl --interface=$VAR(@) --want=router)
- if [ "$RIP" != "127.0.0.1" ]; then
- vtysh -c "configure terminal" \
- -c "ip route $VAR(../@) $RIP vrf $VRF_NAME"
- fi
-update:
- VRF_NAME=$VAR(../../../@)
- sudo /opt/vyatta/sbin/vyatta-update-static-route.pl --interface=$VAR(@) --route=$VAR(../@) --table=main --option=create
- RIP=$(/opt/vyatta/sbin/vyatta-dhcp-helper.pl --interface=$VAR(@) --want=router)
- if [ "$RIP" != "127.0.0.1" ]; then
- vtysh -c "configure terminal" \
- -c "ip route $VAR(../@) $RIP vrf $VRF_NAME"
- fi
-delete:
- VRF_NAME=$VAR(../../../@)
- sudo /opt/vyatta/sbin/vyatta-update-static-route.pl --interface=$VAR(@) --route=$VAR(../@) --table=main --option=delete
- RIP=$(/opt/vyatta/sbin/vyatta-dhcp-helper.pl --interface=$VAR(@) --want=router)
- if [ "$RIP" != "127.0.0.1" ]; then
- vtysh -c "configure terminal" \
- -c "no ip route $VAR(../@) $RIP vrf $VRF_NAME"
- fi
diff --git a/templates/protocols/vrf/node.tag/static/route/node.tag/next-hop/node.def b/templates/protocols/vrf/node.tag/static/route/node.tag/next-hop/node.def
deleted file mode 100644
index 67842168..00000000
--- a/templates/protocols/vrf/node.tag/static/route/node.tag/next-hop/node.def
+++ /dev/null
@@ -1,50 +0,0 @@
-tag:
-type: ipv4
-help: Next-hop router
-end:
- VRF_NAME=$VAR(../../../@)
- if [[ -z "$VAR(./disable)" ]]; then
- ### remove the old entry from frr first on an update
- if [ ${COMMIT_ACTION} = 'ACTIVE' ]
- then
- OLD_IF=`cli-shell-api returnEffectiveValue protocols vrf $VRF_NAME static route $VAR(../@) next-hop $VAR(@) next-hop-interface`
- vtysh -c "configure terminal" \
- -c "no ip route $VAR(../@) $VAR(@) $OLD_IF vrf $VRF_NAME $VAR(./distance/@)";
- fi
- if [[ ${COMMIT_ACTION} = 'DELETE' ]]
- then
- if ! ${vyatta_sbindir}/vyatta-next-hop-check $VAR(../@) ipv4 address; then
- exit 1;
- fi
- if ${vyatta_sbindir}/vyatta-gateway-static_route-check.pl \
- "$VAR(../@)" "$VAR(@)"
- then
- vtysh -c "configure terminal" \
- -c "no ip route $VAR(../@) $VAR(@) vrf $VRF_NAME"
- fi
- else
- if [[ -n "$VAR(./distance/@)" ]]; then
- DIST="$VAR(./distance/@)"
- fi
- if [[ -n "$VAR(./next-hop-interface/@)" ]]; then
- NEXTHOP_INT="$VAR(./next-hop-interface/@)"
- fi
- if [[ -n "$VAR(./next-hop-vrf/@)" ]]; then
- NEXTHOP_VRF="nexthop-vrf $VAR(./next-hop-vrf/@)"
- fi
- vtysh -c "configure terminal" \
- -c "vrf $VRF_NAME" \
- -c "ip route $VAR(../@) $VAR(@) $NEXTHOP_INT $NEXTHOP_VRF $DIST";
- fi
- else
- if ${vyatta_sbindir}/vyatta-gateway-static_route-check.pl \
- "$VAR(../@)" "$VAR(@)"
- then
- vtysh -c "configure terminal" \
- -c "no ip route $VAR(../@) $VAR(@) vrf $VRF_NAME"
- fi
- fi
- if [[ "$VAR(../@)" = "0.0.0.0/0" ]]
- then
- ${vyatta_sbindir}/vyatta-gateway-static_route-check.pl warn
- fi
diff --git a/templates/protocols/vrf/node.tag/static/route/node.tag/next-hop/node.tag/disable/node.def b/templates/protocols/vrf/node.tag/static/route/node.tag/next-hop/node.tag/disable/node.def
deleted file mode 100644
index de3afda4..00000000
--- a/templates/protocols/vrf/node.tag/static/route/node.tag/next-hop/node.tag/disable/node.def
+++ /dev/null
@@ -1 +0,0 @@
-help: Disable IPv4 next-hop static route
diff --git a/templates/protocols/vrf/node.tag/static/route/node.tag/next-hop/node.tag/distance/node.def b/templates/protocols/vrf/node.tag/static/route/node.tag/next-hop/node.tag/distance/node.def
deleted file mode 100644
index 61abcc65..00000000
--- a/templates/protocols/vrf/node.tag/static/route/node.tag/next-hop/node.tag/distance/node.def
+++ /dev/null
@@ -1,4 +0,0 @@
-type: u32
-help: Distance value for this route
-syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 255; "Must be between (1-255)"
-val_help: u32:1-255; Distance for this route
diff --git a/templates/protocols/vrf/node.tag/static/route/node.tag/next-hop/node.tag/next-hop-interface/node.def b/templates/protocols/vrf/node.tag/static/route/node.tag/next-hop/node.tag/next-hop-interface/node.def
deleted file mode 100644
index c2bbd4ca..00000000
--- a/templates/protocols/vrf/node.tag/static/route/node.tag/next-hop/node.tag/next-hop-interface/node.def
+++ /dev/null
@@ -1,17 +0,0 @@
-type: txt
-help: IPv4 gateway interface name
-allowed: sh -c "${vyos_completion_dir}/list_interfaces.py"
-end:
- VRF_NAME=$VAR(../../../../@)
- if [[ ${COMMIT_ACTION} = 'DELETE' ]]
- then
- if ! ${vyatta_sbindir}/vyatta-next-hop-check $VAR(../@) ipv4 address; then
- exit 1;
- fi
- if ${vyatta_sbindir}/vyatta-gateway-static_route-check.pl \
- "$VAR(../../@)" "$VAR(../@)"
- then
- vtysh -c "configure terminal" \
- -c "no ip route $VAR(../../@) $VAR(../@) $VAR(@) vrf $VRF_NAME"
- fi
- fi
diff --git a/templates/protocols/vrf/node.tag/static/route/node.tag/next-hop/node.tag/next-hop-vrf/node.def b/templates/protocols/vrf/node.tag/static/route/node.tag/next-hop/node.tag/next-hop-vrf/node.def
deleted file mode 100644
index ad3e92a9..00000000
--- a/templates/protocols/vrf/node.tag/static/route/node.tag/next-hop/node.tag/next-hop-vrf/node.def
+++ /dev/null
@@ -1,21 +0,0 @@
-type: txt
-help: VRF to leak route
-allowed: local -a params
- params=('default')
- eval "params+=($(cli-shell-api listNodes vrf name))"
- echo -n "${params[@]}"
-val_help: <vrf> ; Name of VRF to leak to
-end:
- VRF_NAME=$VAR(../../../../@)
- if [[ ${COMMIT_ACTION} = 'DELETE' ]]
- then
- if ! ${vyatta_sbindir}/vyatta-next-hop-check $VAR(../@) ipv4 address; then
- exit 1;
- fi
- if ${vyatta_sbindir}/vyatta-gateway-static_route-check.pl \
- "$VAR(../../@)" "$VAR(../@)"
- then
- vtysh -c "configure terminal" \
- -c "no ip route $VAR(../../@) $VAR(../@) vrf $VRF_NAME nexthop-vrf $VAR(@)"
- fi
- fi
diff --git a/templates/protocols/vrf/node.tag/static/route6/node.def b/templates/protocols/vrf/node.tag/static/route6/node.def
deleted file mode 100644
index 984b6dbe..00000000
--- a/templates/protocols/vrf/node.tag/static/route6/node.def
+++ /dev/null
@@ -1,8 +0,0 @@
-tag:
-priority: 482
-type: ipv6net
-help: VRF static IPv6 route
-syntax:expression: exec "ipaddrcheck --verbose --is-ipv6-net $VAR(@)"
-
-commit:expression: $VAR(./next-hop/) != "" || $VAR(./blackhole/) != ""; \
- "Must add either a next-hop or blackhole for route $VAR(@)"
diff --git a/templates/protocols/vrf/node.tag/static/route6/node.tag/blackhole/distance/node.def b/templates/protocols/vrf/node.tag/static/route6/node.tag/blackhole/distance/node.def
deleted file mode 100644
index 61abcc65..00000000
--- a/templates/protocols/vrf/node.tag/static/route6/node.tag/blackhole/distance/node.def
+++ /dev/null
@@ -1,4 +0,0 @@
-type: u32
-help: Distance value for this route
-syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 255; "Must be between (1-255)"
-val_help: u32:1-255; Distance for this route
diff --git a/templates/protocols/vrf/node.tag/static/route6/node.tag/blackhole/node.def b/templates/protocols/vrf/node.tag/static/route6/node.tag/blackhole/node.def
deleted file mode 100644
index e3f1c967..00000000
--- a/templates/protocols/vrf/node.tag/static/route6/node.tag/blackhole/node.def
+++ /dev/null
@@ -1,16 +0,0 @@
-help: Silently discard pkts when matched
-end: VRF_NAME=$VAR(../../../@)
- if [ ${COMMIT_ACTION} = 'DELETE' ]; then
- if ! ${vyatta_sbindir}/vyatta-next-hop-check $VAR(../@) ipv6 address; then
- exit 1;
- fi
-
- vtysh -c "configure terminal" \
- -c "no ipv6 route $VAR(../@) Null0 vrf $VRF_NAME";
- else
- if [ -n "$VAR(./distance/@)" ]; then
- DIST="$VAR(./distance/@)";
- fi;
- vtysh -c "configure terminal" \
- -c "ipv6 route $VAR(../@) Null0 vrf $VRF_NAME $DIST";
- fi;
diff --git a/templates/protocols/vrf/node.tag/static/route6/node.tag/next-hop/node.def b/templates/protocols/vrf/node.tag/static/route6/node.tag/next-hop/node.def
deleted file mode 100644
index 3fb5b798..00000000
--- a/templates/protocols/vrf/node.tag/static/route6/node.tag/next-hop/node.def
+++ /dev/null
@@ -1,56 +0,0 @@
-tag:
-type: ipv6
-help: Next-hop IPv6 router [REQUIRED]
-end:
- VRF_NAME=$VAR(../../../@)
- if [[ -z "$VAR(./disable)" ]]
- then
- if [[ ${COMMIT_ACTION} = 'DELETE' ]]
- then
- if ! ${vyatta_sbindir}/vyatta-next-hop-check $VAR(../@) ipv6 address; then
- exit 1;
- fi
- if ${vyatta_sbindir}/vyatta-gateway-static_route-check.pl \
- "$VAR(../@)" "$VAR(@)"
- then
- # https://phabricator.vyos.net/T2338#60690
- # FRR does not support deleting a route with upper case hex letters for IPv6 addresses
- network=$(echo $VAR(../@) | tr [A-F] [a-f])
- nexthop=$(echo $VAR(@) | tr [A-F] [a-f])
- quagga_conf=$(vtysh -c "show running-config" | \
- sed -n "/vrf ${VRF_NAME}/,/!/p" | \
- grep "^ ipv6 route $network $nexthop")
-
- vtysh -c "configure terminal" \
- -c "vrf ${VRF_NAME}" \
- -c "no ${quagga_conf}"
-
- fi
- else
- if [[ -n "$VAR(./distance/@)" ]]; then
- DIST="$VAR(./distance/@)"
- fi
-
- if [[ -n "$VAR(./interface/@)" ]]; then
- INTERFACE="$VAR(./interface/@)"
- fi
-
- if [[ -n "$VAR(./next-hop-vrf/@)" ]]; then
- if [ -z "$VAR(./interface/@)" ]; then
- echo "VRF route-leaking requires a next-hop interface to be set in the destination VRF"
- exit 1
- fi
- NEXTHOP_VRF="nexthop-vrf $VAR(./next-hop-vrf/@)"
- fi
-
- vtysh -c "configure terminal" \
- -c "ipv6 route $VAR(../@) $VAR(@) $INTERFACE vrf $VRF_NAME $NEXTHOP_VRF $DIST";
- fi
- else
- if ${vyatta_sbindir}/vyatta-gateway-static_route-check.pl \
- "$VAR(../@)" "$VAR(@)"
- then
- vtysh -c "configure terminal" \
- -c "no ipv6 route $VAR(../@) $VAR(@) vrf $VRF_NAME"
- fi
- fi
diff --git a/templates/protocols/vrf/node.tag/static/route6/node.tag/next-hop/node.tag/disable/node.def b/templates/protocols/vrf/node.tag/static/route6/node.tag/next-hop/node.tag/disable/node.def
deleted file mode 100644
index a71e3c24..00000000
--- a/templates/protocols/vrf/node.tag/static/route6/node.tag/next-hop/node.tag/disable/node.def
+++ /dev/null
@@ -1 +0,0 @@
-help: Disable IPv6 next-hop static route
diff --git a/templates/protocols/vrf/node.tag/static/route6/node.tag/next-hop/node.tag/distance/node.def b/templates/protocols/vrf/node.tag/static/route6/node.tag/next-hop/node.tag/distance/node.def
deleted file mode 100644
index 61abcc65..00000000
--- a/templates/protocols/vrf/node.tag/static/route6/node.tag/next-hop/node.tag/distance/node.def
+++ /dev/null
@@ -1,4 +0,0 @@
-type: u32
-help: Distance value for this route
-syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 255; "Must be between (1-255)"
-val_help: u32:1-255; Distance for this route
diff --git a/templates/protocols/vrf/node.tag/static/route6/node.tag/next-hop/node.tag/interface/node.def b/templates/protocols/vrf/node.tag/static/route6/node.tag/next-hop/node.tag/interface/node.def
deleted file mode 100644
index c8479a63..00000000
--- a/templates/protocols/vrf/node.tag/static/route6/node.tag/next-hop/node.tag/interface/node.def
+++ /dev/null
@@ -1,6 +0,0 @@
-type: txt
-help: IPv6 gateway interface name
-# show all current interface
-# but syntax accepts any interface since it may exist later (ppp etc)
-allowed: ${vyatta_sbindir}/vyatta-interfaces.pl --show all
-
diff --git a/templates/protocols/vrf/node.tag/static/route6/node.tag/next-hop/node.tag/next-hop-vrf/node.def b/templates/protocols/vrf/node.tag/static/route6/node.tag/next-hop/node.tag/next-hop-vrf/node.def
deleted file mode 100644
index 7eee837e..00000000
--- a/templates/protocols/vrf/node.tag/static/route6/node.tag/next-hop/node.tag/next-hop-vrf/node.def
+++ /dev/null
@@ -1,7 +0,0 @@
-type: txt
-help: VRF to leak route
-allowed: local -a params
- params=('default')
- eval "params+=($(cli-shell-api listNodes vrf name))"
- echo -n "${params[@]}"
-val_help: <vrf> ; Name of VRF to leak to