diff options
author | Stig Thormodsrud <stig@vyatta.com> | 2007-11-28 14:51:30 -0800 |
---|---|---|
committer | Stig Thormodsrud <stig@vyatta.com> | 2007-11-28 14:51:30 -0800 |
commit | 24c52ea6739354409a493fefef2b01f068b3073c (patch) | |
tree | ab4476fca899ad47322302dcfda97bdf8212e821 /templates/protocols/static/route | |
parent | 1ebc228032b2306518da7a07ca07ef39544eaea2 (diff) | |
download | vyatta-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/route')
6 files changed, 34 insertions, 3 deletions
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 $(@)" + |