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/blackhole/distance/node.def2
-rw-r--r--templates/protocols/static/interface-route/node.tag/blackhole/node.def2
-rw-r--r--templates/protocols/static/interface-route/node.tag/next-hop-interface/node.def35
-rw-r--r--templates/protocols/static/interface-route/node.tag/next-hop-interface/node.tag/distance/node.def2
-rw-r--r--templates/protocols/static/interface-route/node.tag/next-hop-interface/node.tag/node.def2
-rw-r--r--templates/protocols/static/interface-route/node.tag/node.def2
-rw-r--r--templates/protocols/static/node.def2
-rw-r--r--templates/protocols/static/route/node.def2
-rw-r--r--templates/protocols/static/route/node.tag/blackhole/distance/node.def2
-rw-r--r--templates/protocols/static/route/node.tag/blackhole/node.def2
-rw-r--r--templates/protocols/static/route/node.tag/next-hop/node.def2
-rw-r--r--templates/protocols/static/route/node.tag/next-hop/node.tag/distance/node.def2
-rw-r--r--templates/protocols/static/route/node.tag/next-hop/node.tag/node.def2
-rw-r--r--templates/protocols/static/route/node.tag/node.def2
15 files changed, 45 insertions, 18 deletions
diff --git a/templates/protocols/static/interface-route/node.def b/templates/protocols/static/interface-route/node.def
index 56992140..0e732ea9 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: Configure an interface-based static route
+help: Set an interface-based static route
syntax:expression: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --check-prefix-boundry $VAR(@)"
diff --git a/templates/protocols/static/interface-route/node.tag/blackhole/distance/node.def b/templates/protocols/static/interface-route/node.tag/blackhole/distance/node.def
index ac8083af..08a06ad8 100644
--- a/templates/protocols/static/interface-route/node.tag/blackhole/distance/node.def
+++ b/templates/protocols/static/interface-route/node.tag/blackhole/distance/node.def
@@ -1,4 +1,4 @@
type: u32
-help: Distance value for this route
+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-route/node.tag/blackhole/node.def b/templates/protocols/static/interface-route/node.tag/blackhole/node.def
index d8e65ef4..aaeab5b6 100644
--- a/templates/protocols/static/interface-route/node.tag/blackhole/node.def
+++ b/templates/protocols/static/interface-route/node.tag/blackhole/node.def
@@ -1,4 +1,4 @@
-help: Silently discard pkts when matched
+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\" ; \
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 6f3b606a..80526635 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
@@ -1,12 +1,39 @@
+#
+# Config template for
+# protocols/static/interface-route/<prefix>/next-hop-interface
+#
+
tag:
+
type: txt
-help: Configure the next-hop interface
+
+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 " \
- if [ -z \"`ip addr | grep $VAR(@) `\" ]; then \
- echo ethernet interface $VAR(@) doesn\\'t exist on this system ; \
- exit 1 ; \
+ IFNAME=$VAR(@) ; \
+ if [ -z \"`ip addr | grep $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: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(@)\" ; \
rm /tmp/static.$PPID; \
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
index ac8083af..08a06ad8 100644
--- 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
@@ -1,4 +1,4 @@
type: u32
-help: Distance value for this route
+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-route/node.tag/next-hop-interface/node.tag/node.def b/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.tag/node.def
index 0422e89c..5bd7d7c7 100644
--- a/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.tag/node.def
+++ b/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.tag/node.def
@@ -1 +1 @@
-help: Enter next-hop interface
+help: Set next-hop interface
diff --git a/templates/protocols/static/interface-route/node.tag/node.def b/templates/protocols/static/interface-route/node.tag/node.def
index e6893719..21624367 100644
--- a/templates/protocols/static/interface-route/node.tag/node.def
+++ b/templates/protocols/static/interface-route/node.tag/node.def
@@ -1,2 +1,2 @@
-help: IP network
+help: Set IP network
commit:expression: $VAR(./next-hop-interface/) != "" || $VAR(./blackhole/) != ""; "Must add either a next-hop-interface or blackhole for route $VAR(@)"
diff --git a/templates/protocols/static/node.def b/templates/protocols/static/node.def
index 0cb6cd0c..37216e4a 100644
--- a/templates/protocols/static/node.def
+++ b/templates/protocols/static/node.def
@@ -1,3 +1,3 @@
-help: Static route configuration
+help: Configure static route parameters
diff --git a/templates/protocols/static/route/node.def b/templates/protocols/static/route/node.def
index be26c621..78ead81d 100644
--- a/templates/protocols/static/route/node.def
+++ b/templates/protocols/static/route/node.def
@@ -1,4 +1,4 @@
tag:
type: ipv4net
-help: Configure a static route
+help: Set a static route
syntax:expression: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --check-prefix-boundry $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
index ac8083af..08a06ad8 100644
--- a/templates/protocols/static/route/node.tag/blackhole/distance/node.def
+++ b/templates/protocols/static/route/node.tag/blackhole/distance/node.def
@@ -1,4 +1,4 @@
type: u32
-help: Distance value for this route
+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/route/node.tag/blackhole/node.def b/templates/protocols/static/route/node.tag/blackhole/node.def
index d8e65ef4..aaeab5b6 100644
--- a/templates/protocols/static/route/node.tag/blackhole/node.def
+++ b/templates/protocols/static/route/node.tag/blackhole/node.def
@@ -1,4 +1,4 @@
-help: Silently discard pkts when matched
+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\" ; \
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 1540a0b4..cfd4b923 100644
--- a/templates/protocols/static/route/node.tag/next-hop/node.def
+++ b/templates/protocols/static/route/node.tag/next-hop/node.def
@@ -1,6 +1,6 @@
tag:
type: ipv4
-help: Configure the next-hop router
+help: Set the next-hop router
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(@)\" ; \
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
index ac8083af..08a06ad8 100644
--- 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
@@ -1,4 +1,4 @@
type: u32
-help: Distance value for this route
+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/route/node.tag/next-hop/node.tag/node.def b/templates/protocols/static/route/node.tag/next-hop/node.tag/node.def
index 7a5e624b..08dff1a9 100644
--- a/templates/protocols/static/route/node.tag/next-hop/node.tag/node.def
+++ b/templates/protocols/static/route/node.tag/next-hop/node.tag/node.def
@@ -1,2 +1,2 @@
-help: Enter next-hop router
+help: Set next-hop router
diff --git a/templates/protocols/static/route/node.tag/node.def b/templates/protocols/static/route/node.tag/node.def
index ce1324d8..7e15c498 100644
--- a/templates/protocols/static/route/node.tag/node.def
+++ b/templates/protocols/static/route/node.tag/node.def
@@ -1,3 +1,3 @@
-help: IP network
+help: Set IP network
commit:expression: $VAR(./next-hop/) != "" || $VAR(./blackhole/) != ""; "Must add either a next-hop or blackhole for route $VAR(@)"