diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-03-25 14:15:44 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-03-25 14:15:44 -0700 |
commit | eedd04171ff3c6017e52830e8e07ec437e1c6663 (patch) | |
tree | 2e6be92570d53c1e134c806e3de7e0477b11c017 /interface-templates/ip/rip | |
parent | 82b2f6abc7b3b5e3164675c28a27506b39eeb9a7 (diff) | |
download | vyatta-cfg-quagga-eedd04171ff3c6017e52830e8e07ec437e1c6663.tar.gz vyatta-cfg-quagga-eedd04171ff3c6017e52830e8e07ec437e1c6663.zip |
Generate interface templates as part of build
Rather than 100's of copies of the same template, use the same
process as the firewall module to generate the templates.
For this, the are meta-templates in interface-templates directory
which get processed and $IFNAME is replaced by the appropriate CLI
syntax to refer back to the directory name. Changing a quagga
template in most cases can be done by fixing the meta-template.
Diffstat (limited to 'interface-templates/ip/rip')
9 files changed, 60 insertions, 0 deletions
diff --git a/interface-templates/ip/rip/authentication/md5/node.def b/interface-templates/ip/rip/authentication/md5/node.def new file mode 100644 index 00000000..8d165fe6 --- /dev/null +++ b/interface-templates/ip/rip/authentication/md5/node.def @@ -0,0 +1,8 @@ +tag: +type: u32 +help: Set MD5 authentication key ID +syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 255; \ + "ID must be between 1 and 255" + +commit:expression: $VAR(../plaintext-password/) == "" ; \ + "plaintext-password already set" diff --git a/interface-templates/ip/rip/authentication/md5/node.tag/node.def b/interface-templates/ip/rip/authentication/md5/node.tag/node.def new file mode 100644 index 00000000..488acd8c --- /dev/null +++ b/interface-templates/ip/rip/authentication/md5/node.tag/node.def @@ -0,0 +1 @@ +help: Set authentication password diff --git a/interface-templates/ip/rip/authentication/md5/node.tag/password/node.def b/interface-templates/ip/rip/authentication/md5/node.tag/password/node.def new file mode 100644 index 00000000..1d675b0b --- /dev/null +++ b/interface-templates/ip/rip/authentication/md5/node.tag/password/node.def @@ -0,0 +1,19 @@ +type: txt +help: Set authentication password +syntax:expression: pattern $VAR(@) "^[^[:space:]]{1,16}" ; "MD5 key must be 16 characters or less" + +update:vyatta-vtysh \ + -c "configure terminal" -c "interface $IFNAME" \ + -c "ip rip authentication mode md5" \ + -c "ip rip authentication key-chain $IFNAME-rip" \ + -c "key chain $IFNAME-rip" -c "key $VAR(../@)" \ + -c "key-string $VAR(@)" + +delete:vyatta-vtysh --noerror \ + -c "configure terminal" -c "interface $IFNAME" \ + -c "no ip rip authentication mode md5" \ + -c "no ip rip authentication key-chain $IFNAME-rip" \ + -c "no key chain $IFNAME-rip" " + +comp_help: possible completions: + <text> MD5 Key (16 characters or less) diff --git a/interface-templates/ip/rip/authentication/node.def b/interface-templates/ip/rip/authentication/node.def new file mode 100644 index 00000000..8756de35 --- /dev/null +++ b/interface-templates/ip/rip/authentication/node.def @@ -0,0 +1 @@ +help: Set authentication method diff --git a/interface-templates/ip/rip/authentication/plaintext-password/node.def b/interface-templates/ip/rip/authentication/plaintext-password/node.def new file mode 100644 index 00000000..f4fefb78 --- /dev/null +++ b/interface-templates/ip/rip/authentication/plaintext-password/node.def @@ -0,0 +1,13 @@ +type: txt +help: Set plain text password +syntax:expression: pattern $VAR(@) "^[^[:space:]{1,16}$" ; "Password must be 16 characters or less" +commit:expression: $VAR(../md5/) == "" ; "md5 password already set" + +update: vyatta-vtysh -c "configure terminal" -c "interface $IFNAME" \ + -c "ip rip authentication mode text" -c "ip rip authentication string $VAR(@)"; + +delete: vyatta-vtysh -c "configure terminal" -c "interface $IFNAME" \ + -c "no ip rip authentication mode" -c "no ip rip authentication string $VAR(@)"; + +comp_help: possible completions: + <text> Password (16 characters or less) diff --git a/interface-templates/ip/rip/node.def b/interface-templates/ip/rip/node.def new file mode 100644 index 00000000..b01a779f --- /dev/null +++ b/interface-templates/ip/rip/node.def @@ -0,0 +1,2 @@ +help: Set Routing Information Protocol (RIP) for specified interface +create: sudo /opt/vyatta/sbin/quagga-manager check ripd diff --git a/interface-templates/ip/rip/split-horizon/disable/node.def b/interface-templates/ip/rip/split-horizon/disable/node.def new file mode 100644 index 00000000..10c57ba4 --- /dev/null +++ b/interface-templates/ip/rip/split-horizon/disable/node.def @@ -0,0 +1,6 @@ +help: Disable split horizon on specified interface +create:vyatta-vtysh -c "configure terminal" -c "interface $IFNAME" -c "no ip rip split-horizon " +delete:vyatta-vtysh -c "configure terminal" -c "interface $IFNAME" -c "ip rip split-horizon " " + +commit:expression: ($VAR(../poison-reverse/) == ""); \ + "You cannot have 'split-horizon poison-reverse' enabled with 'split-horizon' disabled for $IFNAME" diff --git a/interface-templates/ip/rip/split-horizon/node.def b/interface-templates/ip/rip/split-horizon/node.def new file mode 100644 index 00000000..ba39b616 --- /dev/null +++ b/interface-templates/ip/rip/split-horizon/node.def @@ -0,0 +1 @@ +help: Set to control split horizon parameters on this interface diff --git a/interface-templates/ip/rip/split-horizon/poison-reverse/node.def b/interface-templates/ip/rip/split-horizon/poison-reverse/node.def new file mode 100644 index 00000000..07cb8944 --- /dev/null +++ b/interface-templates/ip/rip/split-horizon/poison-reverse/node.def @@ -0,0 +1,9 @@ +help: Enable poison reverse for split-horizon +create:vyatta-vtysh -c "configure terminal" -c "interface $IFNAME" \ + -c "ip rip split-horizon poisoned-reverse" + +delete:vyatta-vtysh -c "configure terminal" -c "interface $IFNAME" \ + -c "no ip rip split-horizon" -c "ip rip split-horizon " + +commit:expression: ($VAR(../disable/) == ""); \ + "You cannot have 'split-horizon poison-reverse' enabled with 'split-horizon' disabled for $IFNAME" |