summaryrefslogtreecommitdiff
path: root/templates/protocols/static
diff options
context:
space:
mode:
Diffstat (limited to 'templates/protocols/static')
-rw-r--r--templates/protocols/static/interface-route/node.def2
-rw-r--r--templates/protocols/static/interface-route/node.tag/next-hop-interface/node.def4
-rw-r--r--templates/protocols/static/interface-route6/node.def4
-rw-r--r--templates/protocols/static/interface-route6/node.tag/next-hop-interface/node.def47
-rw-r--r--templates/protocols/static/interface-route6/node.tag/next-hop-interface/node.tag/distance/node.def4
-rw-r--r--templates/protocols/static/interface-route6/node.tag/next-hop-interface/node.tag/node.def1
-rw-r--r--templates/protocols/static/interface-route6/node.tag/node.def3
-rw-r--r--templates/protocols/static/route/node.def2
-rw-r--r--templates/protocols/static/route/node.tag/blackhole/node.def4
-rw-r--r--templates/protocols/static/route/node.tag/next-hop/node.def28
-rw-r--r--templates/protocols/static/route6/node.def4
-rw-r--r--templates/protocols/static/route6/node.tag/blackhole/distance/node.def4
-rw-r--r--templates/protocols/static/route6/node.tag/blackhole/node.def14
-rw-r--r--templates/protocols/static/route6/node.tag/next-hop/node.def15
-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/node.def2
-rw-r--r--templates/protocols/static/route6/node.tag/node.def3
17 files changed, 127 insertions, 18 deletions
diff --git a/templates/protocols/static/interface-route/node.def b/templates/protocols/static/interface-route/node.def
index 0e732ea9..a30f4dac 100644
--- a/templates/protocols/static/interface-route/node.def
+++ b/templates/protocols/static/interface-route/node.def
@@ -1,4 +1,4 @@
tag:
type: ipv4net
help: Set an interface-based static route
-syntax:expression: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --check-prefix-boundry $VAR(@)"
+syntax:expression: exec "${vyatta_sbindir}/check_prefix_boundary $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
index c83201a8..74e5a8a4 100644
--- 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
@@ -35,12 +35,12 @@ syntax:expression: exec " \
delete:expression: "touch /tmp/static.$PPID"
end:expression: "if [ -f \"/tmp/static.$PPID\" ]; then \
- ${vyatta_sbindir}/vyatta-vtysh.pl -c \"configure terminal\" -c \"no ip route $VAR(../@) $VAR(@)\" ; \
+ vyatta-vtysh -c \"configure terminal\" -c \"no ip route $VAR(../@) $VAR(@)\" ; \
rm /tmp/static.$PPID; \
else \
if [ -n \"$VAR(./distance/@)\" ]; then \
DIST=\"$VAR(./distance/@)\"; \
fi; \
- ${vyatta_sbindir}/vyatta-vtysh.pl -c \"configure terminal\" -c \"ip route $VAR(../@) $VAR(@) $DIST \" ; \
+ vyatta-vtysh -c \"configure terminal\" -c \"ip route $VAR(../@) $VAR(@) $DIST \" ; \
fi; "
diff --git a/templates/protocols/static/interface-route6/node.def b/templates/protocols/static/interface-route6/node.def
new file mode 100644
index 00000000..4048960a
--- /dev/null
+++ b/templates/protocols/static/interface-route6/node.def
@@ -0,0 +1,4 @@
+tag:
+type: ipv6net
+help: Set an interface-based IPv6 static route
+syntax:expression: exec "${vyatta_sbindir}/check_prefix_boundary $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
new file mode 100644
index 00000000..981201b3
--- /dev/null
+++ b/templates/protocols/static/interface-route6/node.tag/next-hop-interface/node.def
@@ -0,0 +1,47 @@
+#
+# Config template for
+# protocols/static/interface-route6/<prefix>/next-hop-interface
+#
+
+tag:
+
+type: txt
+
+help: Set the next-hop interface
+
+#
+# Argument must be the name of an interface on the system. PPP interfaces
+# only come into existance when they come up. Allow interface routes
+# via them to be configured even though the link may not be up right now.
+# We need a special case for multilink interfaces because their names
+# are not coded into the name of the PPP config file in /etc/ppp/peers.
+#
+syntax:expression: exec " \
+ IFNAME=$VAR(@) ; \
+ if [ ! -e /sys/class/net/$IFNAME ]; then \
+ if [ \"${IFNAME::5}\" != \"pppoa\" -a \"${IFNAME::5}\" != \"pppoe\" \
+ -a \"${IFNAME::3}\" != \"wan\" \
+ -a \"${IFNAME::2}\" != \"ml\" ]; then \
+ echo interface $IFNAME doesn\\'t exist on this system ; \
+ exit 1 ; \
+ fi ; \
+ if [ ! -e /etc/ppp/peers/${IFNAME} -a \"$IFNAME\" != \"ml0\" \
+ -a \"$IFNAME\" != \"ml1\" ]; then \
+ echo PPP interface $IFNAME doesn\\'t exist on this system ; \
+ exit 1 ; \
+ fi ; \
+ fi ; "
+
+delete: touch /tmp/static.$PPID
+
+end: if [ -f "/tmp/static.$PPID" ]; then
+ vyatta-vtysh -c "configure terminal" \
+ -c "no ipv6 route $VAR(../@) $VAR(@)";
+ rm /tmp/static.$PPID;
+ else
+ if [ -n "$VAR(./distance/@)" ]; then
+ DIST="$VAR(./distance/@)";
+ fi;
+ vyatta-vtysh -c "configure terminal" \
+ -c "ipv6 route $VAR(../@) $VAR(@) $DIST";
+ fi;
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
new file mode 100644
index 00000000..08a06ad8
--- /dev/null
+++ b/templates/protocols/static/interface-route6/node.tag/next-hop-interface/node.tag/distance/node.def
@@ -0,0 +1,4 @@
+type: u32
+help: Set distance value for this route
+syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 255; "Must be between (1-255)"
+comp_help: <1-255> Distance for this route
diff --git a/templates/protocols/static/interface-route6/node.tag/next-hop-interface/node.tag/node.def b/templates/protocols/static/interface-route6/node.tag/next-hop-interface/node.tag/node.def
new file mode 100644
index 00000000..5bd7d7c7
--- /dev/null
+++ b/templates/protocols/static/interface-route6/node.tag/next-hop-interface/node.tag/node.def
@@ -0,0 +1 @@
+help: Set next-hop interface
diff --git a/templates/protocols/static/interface-route6/node.tag/node.def b/templates/protocols/static/interface-route6/node.tag/node.def
new file mode 100644
index 00000000..1bc36220
--- /dev/null
+++ b/templates/protocols/static/interface-route6/node.tag/node.def
@@ -0,0 +1,3 @@
+help: Set IP network
+commit:expression: $VAR(./next-hop-interface/) != "" ; \
+ "Must add a next-hop-interface for route $VAR(@)"
diff --git a/templates/protocols/static/route/node.def b/templates/protocols/static/route/node.def
index 78ead81d..74cf3715 100644
--- a/templates/protocols/static/route/node.def
+++ b/templates/protocols/static/route/node.def
@@ -1,4 +1,4 @@
tag:
type: ipv4net
help: Set a static route
-syntax:expression: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --check-prefix-boundry $VAR(@)"
+syntax:expression: exec "${vyatta_sbindir}/check_prefix_boundary $VAR(@)"
diff --git a/templates/protocols/static/route/node.tag/blackhole/node.def b/templates/protocols/static/route/node.tag/blackhole/node.def
index aaeab5b6..930ecfa3 100644
--- a/templates/protocols/static/route/node.tag/blackhole/node.def
+++ b/templates/protocols/static/route/node.tag/blackhole/node.def
@@ -1,11 +1,11 @@
help: Set to silently discard pkts when matched
delete:expression: "touch /tmp/static.$PPID"
end:expression: "if [ -f \"/tmp/static.$PPID\" ]; then \
- ${vyatta_sbindir}/vyatta-vtysh.pl -c \"configure terminal\" -c \"no ip route $VAR(../@) null0\" ; \
+ vyatta-vtysh -c \"configure terminal\" -c \"no ip route $VAR(../@) null0\" ; \
rm /tmp/static.$PPID; \
else \
if [ -n \"$VAR(./distance/@)\" ]; then \
DIST=\"$VAR(./distance/@)\"; \
fi; \
- ${vyatta_sbindir}/vyatta-vtysh.pl -c \"configure terminal\" -c \"ip route $VAR(../@) null0 $DIST \" ; \
+ vyatta-vtysh -c \"configure terminal\" -c \"ip route $VAR(../@) null0 $DIST \" ; \
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
index 1bb4b579..f93b1270 100644
--- a/templates/protocols/static/route/node.tag/next-hop/node.def
+++ b/templates/protocols/static/route/node.tag/next-hop/node.def
@@ -1,15 +1,19 @@
tag:
type: ipv4
help: Set the next-hop router
-delete:expression: "touch /tmp/static.$PPID"
-end:expression: "if [ -f \"/tmp/static.$PPID\" ]; then \
- if ${vyatta_sbindir}/vyatta-gateway-static_route-check.pl \"$VAR(../@)\" \"$VAR(@)\"; then \
- ${vyatta_sbindir}/vyatta-vtysh.pl -c \"configure terminal\" -c \"no ip route $VAR(../@) $VAR(@)\" ; \
- fi;
- rm /tmp/static.$PPID; \
- else \
- if [ -n \"$VAR(./distance/@)\" ]; then \
- DIST=\"$VAR(./distance/@)\"; \
- fi; \
- ${vyatta_sbindir}/vyatta-vtysh.pl -c \"configure terminal\" -c \"ip route $VAR(../@) $VAR(@) $DIST \" ; \
- fi; "
+delete: touch /tmp/static.$PPID
+end: if [[ -f /tmp/static.$PPID ]]
+ then
+ if ${vyatta_sbindir}/vyatta-gateway-static_route-check.pl \
+ "$VAR(../@)" "$VAR(@)"
+ then
+ vyatta-vtysh -c "configure terminal" -c "no ip route $VAR(../@) $VAR(@)"
+ fi
+ rm -f /tmp/static.$PPID
+ else
+ if [[ -n "$VAR(./distance/@)" ]]
+ then
+ DIST="$VAR(./distance/@)"
+ fi
+ vyatta-vtysh -c "configure terminal" -c "ip route $VAR(../@) $VAR(@) $DIST" ; \
+ fi
diff --git a/templates/protocols/static/route6/node.def b/templates/protocols/static/route6/node.def
new file mode 100644
index 00000000..0be98812
--- /dev/null
+++ b/templates/protocols/static/route6/node.def
@@ -0,0 +1,4 @@
+tag:
+type: ipv6net
+help: Set a static IPv6 route
+syntax:expression: exec "${vyatta_sbindir}/check_prefix_boundary $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
new file mode 100644
index 00000000..08a06ad8
--- /dev/null
+++ b/templates/protocols/static/route6/node.tag/blackhole/distance/node.def
@@ -0,0 +1,4 @@
+type: u32
+help: Set distance value for this route
+syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 255; "Must be between (1-255)"
+comp_help: <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
new file mode 100644
index 00000000..bd8601d5
--- /dev/null
+++ b/templates/protocols/static/route6/node.tag/blackhole/node.def
@@ -0,0 +1,14 @@
+help: Set to silently discard pkts when matched
+delete:expression: "touch /tmp/static.$PPID"
+
+end: if [ -f "/tmp/static.$PPID" ]; then
+ vyatta-vtysh -c "configure terminal" \
+ -c "no ipv6 route $VAR(../@) null0";
+ rm /tmp/static.$PPID;
+ else
+ if [ -n "$VAR(./distance/@)" ]; then
+ DIST="$VAR(./distance/@)";
+ fi;
+ vyatta-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
new file mode 100644
index 00000000..3f9cd440
--- /dev/null
+++ b/templates/protocols/static/route6/node.tag/next-hop/node.def
@@ -0,0 +1,15 @@
+tag:
+type: ipv6
+help: Set the next-hop IPv6 router
+delete: touch /tmp/static.$PPID
+end: if [ -f "/tmp/static.$PPID" ]; then
+ if ${vyatta_sbindir}/vyatta-gateway-static_route-check.pl "$VAR(../@)" "$VAR(@)"; then
+ vyatta-vtysh -c "configure terminal" -c "no ipv6 route $VAR(../@) $VAR(@)" ;
+ fi;
+ rm /tmp/static.$PPID;
+ else
+ if [ -n "$VAR(./distance/@)" ]; then
+ DIST="$VAR(./distance/@)";
+ fi;
+ vyatta-vtysh -c "configure terminal" -c "ipv6 route $VAR(../@) $VAR(@) $DIST";
+ fi;
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
new file mode 100644
index 00000000..08a06ad8
--- /dev/null
+++ b/templates/protocols/static/route6/node.tag/next-hop/node.tag/distance/node.def
@@ -0,0 +1,4 @@
+type: u32
+help: Set distance value for this route
+syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 255; "Must be between (1-255)"
+comp_help: <1-255> Distance for this route
diff --git a/templates/protocols/static/route6/node.tag/next-hop/node.tag/node.def b/templates/protocols/static/route6/node.tag/next-hop/node.tag/node.def
new file mode 100644
index 00000000..08dff1a9
--- /dev/null
+++ b/templates/protocols/static/route6/node.tag/next-hop/node.tag/node.def
@@ -0,0 +1,2 @@
+help: Set next-hop router
+
diff --git a/templates/protocols/static/route6/node.tag/node.def b/templates/protocols/static/route6/node.tag/node.def
new file mode 100644
index 00000000..7e15c498
--- /dev/null
+++ b/templates/protocols/static/route6/node.tag/node.def
@@ -0,0 +1,3 @@
+help: Set IP network
+commit:expression: $VAR(./next-hop/) != "" || $VAR(./blackhole/) != ""; "Must add either a next-hop or blackhole for route $VAR(@)"
+