summaryrefslogtreecommitdiff
path: root/templates/protocols/static
diff options
context:
space:
mode:
authorStig Thormodsrud <stig@vyatta.com>2007-11-28 14:51:30 -0800
committerStig Thormodsrud <stig@vyatta.com>2007-11-28 14:51:30 -0800
commit24c52ea6739354409a493fefef2b01f068b3073c (patch)
treeab4476fca899ad47322302dcfda97bdf8212e821 /templates/protocols/static
parent1ebc228032b2306518da7a07ca07ef39544eaea2 (diff)
downloadvyatta-cfg-quagga-24c52ea6739354409a493fefef2b01f068b3073c.tar.gz
vyatta-cfg-quagga-24c52ea6739354409a493fefef2b01f068b3073c.zip
- Add support for multiple next-hop for same static route.
- Add support for multiple next-hop-interface for same static route. - Add support for blackhole route. - Add support for metric on static routes.
Diffstat (limited to 'templates/protocols/static')
-rw-r--r--templates/protocols/static/interface-route/node.tag/blackhole/metric/node.def4
-rw-r--r--templates/protocols/static/interface-route/node.tag/blackhole/node.def11
-rw-r--r--templates/protocols/static/interface-route/node.tag/next-hop-interface/node.def14
-rw-r--r--templates/protocols/static/interface-route/node.tag/next-hop-interface/node.tag/metric/node.def4
-rw-r--r--templates/protocols/static/interface-route/node.tag/next-hop-interface/node.tag/node.def1
-rw-r--r--templates/protocols/static/interface-route/node.tag/node.def2
-rw-r--r--templates/protocols/static/route/node.tag/blackhole/metric/node.def4
-rw-r--r--templates/protocols/static/route/node.tag/blackhole/node.def11
-rw-r--r--templates/protocols/static/route/node.tag/next-hop/node.def14
-rw-r--r--templates/protocols/static/route/node.tag/next-hop/node.tag/metric/node.def4
-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
12 files changed, 67 insertions, 6 deletions
diff --git a/templates/protocols/static/interface-route/node.tag/blackhole/metric/node.def b/templates/protocols/static/interface-route/node.tag/blackhole/metric/node.def
new file mode 100644
index 00000000..938aea1a
--- /dev/null
+++ b/templates/protocols/static/interface-route/node.tag/blackhole/metric/node.def
@@ -0,0 +1,4 @@
+type: u32
+help: "Distance value for this route"
+syntax: $(@) >= 1 && $(@) <= 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
new file mode 100644
index 00000000..aa54eceb
--- /dev/null
+++ b/templates/protocols/static/interface-route/node.tag/blackhole/node.def
@@ -0,0 +1,11 @@
+help: "Silently discard pkts when matched"
+delete: "touch /tmp/static.\\$PPID"
+end: "if [ -f \"/tmp/static.\\$PPID\" ]; then \
+ /usr/bin/vtysh -c \"configure terminal\" -c \"no ip route $(../@) null0\" ; \
+ rm /tmp/static.\\$PPID; \
+ else \
+ if [ -n \"$(./metric/@)\" ]; then \
+ MET=\"$(./metric/@)\"; \
+ fi; \
+ /usr/bin/vtysh -c \"configure terminal\" -c \"ip route $(../@) null0 \\$MET \" ; \
+ fi; "
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 1417a905..5553f119 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,3 +1,4 @@
+tag:
type: txt
help: "Configure the next-hop interface"
syntax: exec " \
@@ -5,5 +6,14 @@ syntax: exec " \
echo ethernet interface $(@) doesn\\'t exist on this system ; \
exit 1 ; \
fi ; "
-create: "/usr/bin/vtysh -c \"configure terminal\" -c \"ip route $(../@) $(@)\" "
-delete: "/usr/bin/vtysh -c \"configure terminal\" -c \"no ip route $(../@) $(@)\" "
+delete: "touch /tmp/static.\\$PPID"
+end: "if [ -f \"/tmp/static.\\$PPID\" ]; then \
+ /usr/bin/vtysh -c \"configure terminal\" -c \"no ip route $(../@) $(@)\" ; \
+ rm /tmp/static.\\$PPID; \
+ else \
+ if [ -n \"$(./metric/@)\" ]; then \
+ MET=\"$(./metric/@)\"; \
+ fi; \
+ /usr/bin/vtysh -c \"configure terminal\" -c \"ip route $(../@) $(@) \\$MET \" ; \
+ fi; "
+
diff --git a/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.tag/metric/node.def b/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.tag/metric/node.def
new file mode 100644
index 00000000..938aea1a
--- /dev/null
+++ b/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.tag/metric/node.def
@@ -0,0 +1,4 @@
+type: u32
+help: "Distance value for this route"
+syntax: $(@) >= 1 && $(@) <= 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
new file mode 100644
index 00000000..f02c8e46
--- /dev/null
+++ b/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.tag/node.def
@@ -0,0 +1 @@
+help: "Enter 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 3a5b62ec..40651f1a 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"
-
+commit: $(./next-hop-interface/) != "" || $(./blackhole/) != ""; "Must add either a next-hop-interface or blackhole for route $(@)"
diff --git a/templates/protocols/static/route/node.tag/blackhole/metric/node.def b/templates/protocols/static/route/node.tag/blackhole/metric/node.def
new file mode 100644
index 00000000..938aea1a
--- /dev/null
+++ b/templates/protocols/static/route/node.tag/blackhole/metric/node.def
@@ -0,0 +1,4 @@
+type: u32
+help: "Distance value for this route"
+syntax: $(@) >= 1 && $(@) <= 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
new file mode 100644
index 00000000..aa54eceb
--- /dev/null
+++ b/templates/protocols/static/route/node.tag/blackhole/node.def
@@ -0,0 +1,11 @@
+help: "Silently discard pkts when matched"
+delete: "touch /tmp/static.\\$PPID"
+end: "if [ -f \"/tmp/static.\\$PPID\" ]; then \
+ /usr/bin/vtysh -c \"configure terminal\" -c \"no ip route $(../@) null0\" ; \
+ rm /tmp/static.\\$PPID; \
+ else \
+ if [ -n \"$(./metric/@)\" ]; then \
+ MET=\"$(./metric/@)\"; \
+ fi; \
+ /usr/bin/vtysh -c \"configure terminal\" -c \"ip route $(../@) null0 \\$MET \" ; \
+ 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 53de6dc7..46625591 100644
--- a/templates/protocols/static/route/node.tag/next-hop/node.def
+++ b/templates/protocols/static/route/node.tag/next-hop/node.def
@@ -1,5 +1,13 @@
+tag:
type: ipv4
help: "Configure the next-hop router"
-create: "/usr/bin/vtysh -c \"configure terminal\" -c \"ip route $(../@) $(@)\" "
-update: "/usr/bin/vtysh -c \"configure terminal\" -c \"ip route $(../@) $(@)\" "
-delete: "/usr/bin/vtysh -c \"configure terminal\" -c \"no ip route $(../@) $(@)\" "
+delete: "touch /tmp/static.\\$PPID"
+end: "if [ -f \"/tmp/static.\\$PPID\" ]; then \
+ /usr/bin/vtysh -c \"configure terminal\" -c \"no ip route $(../@) $(@)\" ; \
+ rm /tmp/static.\\$PPID; \
+ else \
+ if [ -n \"$(./metric/@)\" ]; then \
+ MET=\"$(./metric/@)\"; \
+ fi; \
+ /usr/bin/vtysh -c \"configure terminal\" -c \"ip route $(../@) $(@) \\$MET \" ; \
+ fi; "
diff --git a/templates/protocols/static/route/node.tag/next-hop/node.tag/metric/node.def b/templates/protocols/static/route/node.tag/next-hop/node.tag/metric/node.def
new file mode 100644
index 00000000..938aea1a
--- /dev/null
+++ b/templates/protocols/static/route/node.tag/next-hop/node.tag/metric/node.def
@@ -0,0 +1,4 @@
+type: u32
+help: "Distance value for this route"
+syntax: $(@) >= 1 && $(@) <= 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
new file mode 100644
index 00000000..45bb111e
--- /dev/null
+++ b/templates/protocols/static/route/node.tag/next-hop/node.tag/node.def
@@ -0,0 +1,2 @@
+help: "Enter next-hop router"
+
diff --git a/templates/protocols/static/route/node.tag/node.def b/templates/protocols/static/route/node.tag/node.def
index e64fee84..56b1f7c8 100644
--- a/templates/protocols/static/route/node.tag/node.def
+++ b/templates/protocols/static/route/node.tag/node.def
@@ -1 +1,3 @@
help: "IP network"
+commit: $(./next-hop/) != "" || $(./blackhole/) != ""; "Must add either a next-hop or blackhole for route $(@)"
+