diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2007-10-01 13:14:31 -0700 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2007-10-01 13:14:31 -0700 |
commit | cfa368bbc1d4c55c42c60838e04fc523625932b7 (patch) | |
tree | e439217d7e3ebb726b9954d7f823db2b47f18c9d /templates/protocols/bgp | |
download | vyatta-cfg-quagga-cfa368bbc1d4c55c42c60838e04fc523625932b7.tar.gz vyatta-cfg-quagga-cfa368bbc1d4c55c42c60838e04fc523625932b7.zip |
initial import (from eureka /cli).upstream
Diffstat (limited to 'templates/protocols/bgp')
120 files changed, 805 insertions, 0 deletions
diff --git a/templates/protocols/bgp/node.def b/templates/protocols/bgp/node.def new file mode 100644 index 00000000..df0e79a6 --- /dev/null +++ b/templates/protocols/bgp/node.def @@ -0,0 +1,7 @@ +tag: +type: u32 +help: "Configure a BGP Autonomous System on this router" +# TODO: non-multinode parent +syntax: $(@) >= 1 && $(@) <= 65535; "AS number must be between 1 and 65535" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c\"router bgp $(@)\" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c\"no router bgp $(@)\" " diff --git a/templates/protocols/bgp/node.tag/aggregate-address/node.def b/templates/protocols/bgp/node.tag/aggregate-address/node.def new file mode 100644 index 00000000..b21ef1b5 --- /dev/null +++ b/templates/protocols/bgp/node.tag/aggregate-address/node.def @@ -0,0 +1,19 @@ +tag: +type: ipv4net; "aggregate-entry must be and IPv4 network" +help: "Configure BGP aggregate entries" +syntax: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --check-prefix-boundry $(@)" +delete: "touch /tmp/`echo $(@) | sed 's!/!!'`.\\$PPID" +end: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../@)\" \ + -c \"no aggregate-address $(@)\"; \ + if [ -f \"/tmp/`echo $(@) | sed 's!/!!'`.\\$PPID\" ]; then \ + rm -rf /tmp/`echo $(@) | sed 's!/!!'`.\\$PPID; \ + else \ + if [ -n \"$(./as-set/@)\" ]; then \ + COND=\"as-set\"; + fi; \ + if [ -n \"$(./summary-only/@)\" ]; then \ + COND=\"\\$COND summary-only\"; \ + fi; \ + /opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../@)\" \ + -c \"aggregate-address $(@) \\$COND\"; \ + fi; " diff --git a/templates/protocols/bgp/node.tag/aggregate-address/node.tag/as-set/node.def b/templates/protocols/bgp/node.tag/aggregate-address/node.tag/as-set/node.def new file mode 100644 index 00000000..90c088a1 --- /dev/null +++ b/templates/protocols/bgp/node.tag/aggregate-address/node.tag/as-set/node.def @@ -0,0 +1 @@ +help: "Generate AS set path information" diff --git a/templates/protocols/bgp/node.tag/aggregate-address/node.tag/summary-only/node.def b/templates/protocols/bgp/node.tag/aggregate-address/node.tag/summary-only/node.def new file mode 100644 index 00000000..ccfbd0fa --- /dev/null +++ b/templates/protocols/bgp/node.tag/aggregate-address/node.tag/summary-only/node.def @@ -0,0 +1 @@ +help: "Filter more specific routes from updates" diff --git a/templates/protocols/bgp/node.tag/bgp/always-compare-med/node.def b/templates/protocols/bgp/node.tag/bgp/always-compare-med/node.def new file mode 100644 index 00000000..007de903 --- /dev/null +++ b/templates/protocols/bgp/node.tag/bgp/always-compare-med/node.def @@ -0,0 +1,5 @@ +help: "Allow comparing MED from different neighbors" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"bgp always-compare-med\" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"no bgp always-compare-med\" " diff --git a/templates/protocols/bgp/node.tag/bgp/bestpath/as-path/confed/node.def b/templates/protocols/bgp/node.tag/bgp/bestpath/as-path/confed/node.def new file mode 100644 index 00000000..7bc02046 --- /dev/null +++ b/templates/protocols/bgp/node.tag/bgp/bestpath/as-path/confed/node.def @@ -0,0 +1,6 @@ +help: "Compare path lengths including confederation sets & sequences in selecting a route" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../../@)\" \ + -c \"bgp bestpath as-path confed \" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../../@)\" \ + -c \"no bgp bestpath as-path confed \" " + diff --git a/templates/protocols/bgp/node.tag/bgp/bestpath/as-path/ignore/node.def b/templates/protocols/bgp/node.tag/bgp/bestpath/as-path/ignore/node.def new file mode 100644 index 00000000..5e12c44a --- /dev/null +++ b/templates/protocols/bgp/node.tag/bgp/bestpath/as-path/ignore/node.def @@ -0,0 +1,5 @@ +help: "Ignore as-path length in selecting a route" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../../@)\" \ + -c \"bgp bestpath as-path ignore \" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../../@)\" \ + -c \"no bgp bestpath as-path ignore \" " diff --git a/templates/protocols/bgp/node.tag/bgp/bestpath/as-path/node.def b/templates/protocols/bgp/node.tag/bgp/bestpath/as-path/node.def new file mode 100644 index 00000000..72b50839 --- /dev/null +++ b/templates/protocols/bgp/node.tag/bgp/bestpath/as-path/node.def @@ -0,0 +1 @@ +help: "AS-path attribute" diff --git a/templates/protocols/bgp/node.tag/bgp/bestpath/compare-routerid/node.def b/templates/protocols/bgp/node.tag/bgp/bestpath/compare-routerid/node.def new file mode 100644 index 00000000..19d69ddb --- /dev/null +++ b/templates/protocols/bgp/node.tag/bgp/bestpath/compare-routerid/node.def @@ -0,0 +1,6 @@ +help: "Compare router-id for identical EBGP paths" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"bgp bestpath compare-routerid \" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"no bgp bestpath compare-routerid \" " + diff --git a/templates/protocols/bgp/node.tag/bgp/bestpath/med/confed/node.def b/templates/protocols/bgp/node.tag/bgp/bestpath/med/confed/node.def new file mode 100644 index 00000000..42a64027 --- /dev/null +++ b/templates/protocols/bgp/node.tag/bgp/bestpath/med/confed/node.def @@ -0,0 +1,6 @@ +help: "Compare MED among confederation paths" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../../@)\" \ + -c \"bgp bestpath med confed \" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../../@)\" \ + -c \"no bgp bestpath med confed \" " + diff --git a/templates/protocols/bgp/node.tag/bgp/bestpath/med/missing-as-worst/node.def b/templates/protocols/bgp/node.tag/bgp/bestpath/med/missing-as-worst/node.def new file mode 100644 index 00000000..5a6f571a --- /dev/null +++ b/templates/protocols/bgp/node.tag/bgp/bestpath/med/missing-as-worst/node.def @@ -0,0 +1,6 @@ +help: "Treat missing MED as the least preferred one" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../../@)\" \ + -c \"bgp bestpath med missing-as-worst \" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../../@)\" \ + -c \"no bgp bestpath med missing-as-worst \" " + diff --git a/templates/protocols/bgp/node.tag/bgp/bestpath/med/node.def b/templates/protocols/bgp/node.tag/bgp/bestpath/med/node.def new file mode 100644 index 00000000..350270bb --- /dev/null +++ b/templates/protocols/bgp/node.tag/bgp/bestpath/med/node.def @@ -0,0 +1 @@ +help: "MED attribute" diff --git a/templates/protocols/bgp/node.tag/bgp/bestpath/node.def b/templates/protocols/bgp/node.tag/bgp/bestpath/node.def new file mode 100644 index 00000000..b4a1bbe7 --- /dev/null +++ b/templates/protocols/bgp/node.tag/bgp/bestpath/node.def @@ -0,0 +1 @@ +help: "Change the default bestpath selection" diff --git a/templates/protocols/bgp/node.tag/bgp/client-to-client-reflection/node.def b/templates/protocols/bgp/node.tag/bgp/client-to-client-reflection/node.def new file mode 100644 index 00000000..00b4ef71 --- /dev/null +++ b/templates/protocols/bgp/node.tag/bgp/client-to-client-reflection/node.def @@ -0,0 +1,6 @@ +help: "Configure client to client route reflection" +# TODO: not showing up in vyatta. Probably needs another setting to be applied. +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"bgp client-to-client reflection \" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"no bgp client-to-client reflection \" " diff --git a/templates/protocols/bgp/node.tag/bgp/cluster-id/node.def b/templates/protocols/bgp/node.tag/bgp/cluster-id/node.def new file mode 100644 index 00000000..741d3761 --- /dev/null +++ b/templates/protocols/bgp/node.tag/bgp/cluster-id/node.def @@ -0,0 +1,8 @@ +type: ipv4; "protocols bgp $(../../) cluster-id must be and IPv4 address" +help: "Configure route-reflector cluster-id\n" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"bgp cluster-id $(@)\" " +update: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"bgp cluster-id $(@)\" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"no bgp cluster-id \" " diff --git a/templates/protocols/bgp/node.tag/bgp/confederation/identifier/node.def b/templates/protocols/bgp/node.tag/bgp/confederation/identifier/node.def new file mode 100644 index 00000000..eadc9fc9 --- /dev/null +++ b/templates/protocols/bgp/node.tag/bgp/confederation/identifier/node.def @@ -0,0 +1,9 @@ +type: u32; "protocols bgp $(../../../) confederation identifier must be a u32" +help: "Configure confederation AS id" +syntax: $(@) >= 1 && $(@) <= 65535; "confederation AS id must be between 1 and 65535" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"bgp confederation identifier $(@)\" " +update: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"bgp confederation identifier $(@)\" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"no bgp confederation identifier \" " diff --git a/templates/protocols/bgp/node.tag/bgp/confederation/node.def b/templates/protocols/bgp/node.tag/bgp/confederation/node.def new file mode 100644 index 00000000..272c946c --- /dev/null +++ b/templates/protocols/bgp/node.tag/bgp/confederation/node.def @@ -0,0 +1 @@ +help: "AS confederation parameters" diff --git a/templates/protocols/bgp/node.tag/bgp/confederation/peers/node.def b/templates/protocols/bgp/node.tag/bgp/confederation/peers/node.def new file mode 100644 index 00000000..e8c9b7dd --- /dev/null +++ b/templates/protocols/bgp/node.tag/bgp/confederation/peers/node.def @@ -0,0 +1,10 @@ +multi: +type: u32; "protocols bgp $(../../../@) confederation peer must be a u32" +help: "Peer ASs in BGP confederation" +syntax: $(@) >= 1 && $(@) <= 65535; "confederation AS id must be between 1 and 65535" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"bgp confederation peers $(@)\" " +update: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"bgp confederation peers $(@)\" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"no bgp confederation peers $(@)\" " diff --git a/templates/protocols/bgp/node.tag/bgp/dampening/half-life/node.def b/templates/protocols/bgp/node.tag/bgp/dampening/half-life/node.def new file mode 100644 index 00000000..dbff0dcf --- /dev/null +++ b/templates/protocols/bgp/node.tag/bgp/dampening/half-life/node.def @@ -0,0 +1,3 @@ +type: u32; "protocols bgp $(../../../@) dampening half-life must be a u32" +help: "Half-life time for the penalty" +syntax: $(@) >= 1 && $(@) <= 45; "Half-life penalty must be between 1 and 45" diff --git a/templates/protocols/bgp/node.tag/bgp/dampening/max-suppress-time/node.def b/templates/protocols/bgp/node.tag/bgp/dampening/max-suppress-time/node.def new file mode 100644 index 00000000..5ae075e2 --- /dev/null +++ b/templates/protocols/bgp/node.tag/bgp/dampening/max-suppress-time/node.def @@ -0,0 +1,5 @@ +type: u32; "protocols bgp $(../../../@) dampening max-suppress-time must be a u32" +help: "Maximum duration to suppress a stable route" +syntax: $(@) >= 1 && $(@) <= 255; "Max-suppress-time must be between 1 and 255" +commit: $(../re-use/@) != ""; "Re-use value must be set" +commit: $(../start-suppress-time/@) != ""; "Start-suppress-time must be set" diff --git a/templates/protocols/bgp/node.tag/bgp/dampening/node.def b/templates/protocols/bgp/node.tag/bgp/dampening/node.def new file mode 100644 index 00000000..9086f275 --- /dev/null +++ b/templates/protocols/bgp/node.tag/bgp/dampening/node.def @@ -0,0 +1,12 @@ +help: "Enable route-flap dampening" +delete: "touch /tmp/bgp-dampening.\\$PPID" +end: "sh -c \" + /opt/vyatta/bin/vtysh -c \\\"configure terminal\\\" -c \\\"router bgp $(../../@)\\\" \ + -c \\\"no bgp dampening\\\" ; \ + if [ -f \\\"/tmp/bgp-dampening.\\\\$PPID\\\" ]; then \ + rm -f \\\"/tmp/bgp-dampening.\\\\$PPID\\\" ; \ + else \ + /opt/vyatta/bin/vtysh -c \\\"configure terminal\\\" -c \\\"router bgp $(../../@)\\\" \ + -c \\\"bgp dampening $(./half-life/@) $(./re-use/@) $(./start-suppress-time/@) $(./max-suppress-time/@)\\\" ; \ + fi ; \ + \" " diff --git a/templates/protocols/bgp/node.tag/bgp/dampening/re-use/node.def b/templates/protocols/bgp/node.tag/bgp/dampening/re-use/node.def new file mode 100644 index 00000000..0555c81f --- /dev/null +++ b/templates/protocols/bgp/node.tag/bgp/dampening/re-use/node.def @@ -0,0 +1,5 @@ +type: u32; "protocols bgp $(../../../@) dampening re-use must be a u32" +help: "Value to start reusing a route" +syntax: $(@) >= 1 && $(@) <= 20000; "Re-use value must be between 1 and 20000" +commit: $(../start-suppress-time/@) != ""; "Start-suppress-time must be set" +commit: $(../max-suppress-time/@) != ""; "Max-suppress-time must be set" diff --git a/templates/protocols/bgp/node.tag/bgp/dampening/start-suppress-time/node.def b/templates/protocols/bgp/node.tag/bgp/dampening/start-suppress-time/node.def new file mode 100644 index 00000000..07f8e566 --- /dev/null +++ b/templates/protocols/bgp/node.tag/bgp/dampening/start-suppress-time/node.def @@ -0,0 +1,5 @@ +type: u32; "protocols bgp $(../../../@) dampening start-suppress-time must be a u32" +help: "Value to start suppressing a route" +syntax: $(@) >= 1 && $(@) <= 20000; "Start-suppress-time must be between 1 and 20000" +commit: $(../re-use/@) != ""; "Re-use value must be set" +commit: $(../max-suppress-time/@) != ""; "Max-suppress-time must be set" diff --git a/templates/protocols/bgp/node.tag/bgp/default/local-pref/node.def b/templates/protocols/bgp/node.tag/bgp/default/local-pref/node.def new file mode 100644 index 00000000..7b5847cc --- /dev/null +++ b/templates/protocols/bgp/node.tag/bgp/default/local-pref/node.def @@ -0,0 +1,8 @@ +type: u32; "protocols bgp $(../../../@) bgp default local-pref must be a u32" +help: "local preference (higher=more preferred)" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"bgp default local-preference $(@)\" " +update: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"bgp default local-preference $(@)\" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"no bgp default local-preference\" " diff --git a/templates/protocols/bgp/node.tag/bgp/default/no-ipv4-unicast/node.def b/templates/protocols/bgp/node.tag/bgp/default/no-ipv4-unicast/node.def new file mode 100644 index 00000000..77a49962 --- /dev/null +++ b/templates/protocols/bgp/node.tag/bgp/default/no-ipv4-unicast/node.def @@ -0,0 +1,5 @@ +help: "De-activate ipv4-unicastfor a peer by default" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"no bgp default ipv4-unicast\" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"bgp default ipv4-unicast\" " diff --git a/templates/protocols/bgp/node.tag/bgp/default/node.def b/templates/protocols/bgp/node.tag/bgp/default/node.def new file mode 100644 index 00000000..f1c90ec3 --- /dev/null +++ b/templates/protocols/bgp/node.tag/bgp/default/node.def @@ -0,0 +1 @@ +help: "Configure BGP defaults" diff --git a/templates/protocols/bgp/node.tag/bgp/deterministic-med/node.def b/templates/protocols/bgp/node.tag/bgp/deterministic-med/node.def new file mode 100644 index 00000000..de476ada --- /dev/null +++ b/templates/protocols/bgp/node.tag/bgp/deterministic-med/node.def @@ -0,0 +1,5 @@ +help: "Pick the best-MED path among paths advertised from the neighboring AS" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"bgp deterministic-med \" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"no bgp deterministic-med \" " diff --git a/templates/protocols/bgp/node.tag/bgp/enforce-first-as/node.def b/templates/protocols/bgp/node.tag/bgp/enforce-first-as/node.def new file mode 100644 index 00000000..d54557f4 --- /dev/null +++ b/templates/protocols/bgp/node.tag/bgp/enforce-first-as/node.def @@ -0,0 +1,5 @@ +help: "Enforce the first AS for EBGP routes" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"bgp enforce-first-as \" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"no bgp enforce-first-as \" " diff --git a/templates/protocols/bgp/node.tag/bgp/graceful-restart/node.def b/templates/protocols/bgp/node.tag/bgp/graceful-restart/node.def new file mode 100644 index 00000000..1e849462 --- /dev/null +++ b/templates/protocols/bgp/node.tag/bgp/graceful-restart/node.def @@ -0,0 +1 @@ +help: "Graceful restart capability parameters" diff --git a/templates/protocols/bgp/node.tag/bgp/graceful-restart/stalepath-time/node.def b/templates/protocols/bgp/node.tag/bgp/graceful-restart/stalepath-time/node.def new file mode 100644 index 00000000..7a928fba --- /dev/null +++ b/templates/protocols/bgp/node.tag/bgp/graceful-restart/stalepath-time/node.def @@ -0,0 +1,9 @@ +type: u32; "protocols bgp $(../../../@) bgp graceful-restart stalepath-time must be a u32" +help: "Set the max time in seconds to hold onto restarting peer's stale paths" +syntax: $(@) >= 1 && $(@) <= 3600; "stalepath-time must be between 1 and 3600" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"bgp graceful-restart stalepath-time $(@) \" " +update: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"bgp graceful-restart stalepath-time $(@) \" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"no bgp graceful-restart stalepath-time \" " diff --git a/templates/protocols/bgp/node.tag/bgp/log-neighbor-changes/node.def b/templates/protocols/bgp/node.tag/bgp/log-neighbor-changes/node.def new file mode 100644 index 00000000..9ae8ec2f --- /dev/null +++ b/templates/protocols/bgp/node.tag/bgp/log-neighbor-changes/node.def @@ -0,0 +1,5 @@ +help: "Log neighbor up/down and reset reason" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"bgp log-neighbor-changes \" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"no bgp log-neighbor-changes \" " diff --git a/templates/protocols/bgp/node.tag/bgp/network/import-check/node.def b/templates/protocols/bgp/node.tag/bgp/network/import-check/node.def new file mode 100644 index 00000000..96bae68f --- /dev/null +++ b/templates/protocols/bgp/node.tag/bgp/network/import-check/node.def @@ -0,0 +1,5 @@ +help: "Check BGP network route exists in IGP" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"bgp network import-check \" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"no bgp network import-check \" " diff --git a/templates/protocols/bgp/node.tag/bgp/network/node.def b/templates/protocols/bgp/node.tag/bgp/network/node.def new file mode 100644 index 00000000..883e5fe1 --- /dev/null +++ b/templates/protocols/bgp/node.tag/bgp/network/node.def @@ -0,0 +1 @@ +help: "network parameter options" diff --git a/templates/protocols/bgp/node.tag/bgp/no-fast-external-failover/node.def b/templates/protocols/bgp/node.tag/bgp/no-fast-external-failover/node.def new file mode 100644 index 00000000..de7b3815 --- /dev/null +++ b/templates/protocols/bgp/node.tag/bgp/no-fast-external-failover/node.def @@ -0,0 +1,5 @@ +help: "Immediately reset session if a link to a directly connected external peer goes down" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"no bgp fast-external-failover \" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"bgp fast-external-failover \" " diff --git a/templates/protocols/bgp/node.tag/bgp/node.def b/templates/protocols/bgp/node.tag/bgp/node.def new file mode 100644 index 00000000..b23668f8 --- /dev/null +++ b/templates/protocols/bgp/node.tag/bgp/node.def @@ -0,0 +1 @@ +help: "Configure BGP parameters" diff --git a/templates/protocols/bgp/node.tag/bgp/router-id/node.def b/templates/protocols/bgp/node.tag/bgp/router-id/node.def new file mode 100644 index 00000000..5a65143a --- /dev/null +++ b/templates/protocols/bgp/node.tag/bgp/router-id/node.def @@ -0,0 +1,8 @@ +type: ipv4; "protocols bgp $(../../@) bgp router-id must be an IPv4 address" +help: "Override configured router identifier" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"bgp router-id $(@)\" " +update: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"bgp router-id $(@)\" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"no bgp router-id \" " diff --git a/templates/protocols/bgp/node.tag/bgp/scan-time/node.def b/templates/protocols/bgp/node.tag/bgp/scan-time/node.def new file mode 100644 index 00000000..4b4c8814 --- /dev/null +++ b/templates/protocols/bgp/node.tag/bgp/scan-time/node.def @@ -0,0 +1,9 @@ +type: u32; "protocols bgp $(../../@) bgp scan-time must be a u32" +syntax: $(@) >= 5 && $(@) <= 60; "scan-time must be between 5 and 60 seconds" +help: "Configure background scanner interval" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"bgp scan-time $(@)\" " +update: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"bgp scan-time $(@)\" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"no bgp scan-time \" " diff --git a/templates/protocols/bgp/node.tag/neighbor/node.def b/templates/protocols/bgp/node.tag/neighbor/node.def new file mode 100644 index 00000000..40095c19 --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.def @@ -0,0 +1,9 @@ +tag: +type: txt +help: "Specify neighbor router" +syntax: exec "/opt/vyatta/sbin/vyatta_bgp.pl --check-peer-name $(@)" +# if this neighbor has a text name it is a peer group. setup the peer-group option +create: "if [ -n \"`echo $(@) | sed 's/[0-9]\\{1,3\\}.[0-9]\\{1,3\\}.[0-9]\\{1,3\\}.[0-9]\\{1,3\\}//'`\" ]; then \ + /opt/vyatta/bin/vtysh -c \"configure terminal\" -c\"router bgp $(../@)\" -c\"neighbor $(@) peer-group\" ; \ + fi ; " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c\"router bgp $(../@)\" -c\"no neighbor $(@) \" " diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/advertisement-interval/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/advertisement-interval/node.def new file mode 100644 index 00000000..a6487aab --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/advertisement-interval/node.def @@ -0,0 +1,10 @@ +type: u32 +help: "Minimum interval between sending BGP routing updates" +syntax: $(@) >= 0 && $(@) <= 600; "remote-as must be between 0 and 600" +syntax: ($(../peer-group/@) != "") || ($(../remote-as/@) != ""); "remote-as or peer-group must be specified first" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"neighbor $(../@) advertisement-interval $(@)\" " +update: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"neighbor $(../@) advertisement-interval $(@)\" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"no neighbor $(../@) advertisement-interval\" " diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/allowas-in/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/allowas-in/node.def new file mode 100644 index 00000000..4ad43d58 --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/allowas-in/node.def @@ -0,0 +1,11 @@ +help: "Accept as-path with my AS present in it." +syntax: ($(../peer-group/@) != "") || ($(../remote-as/@) != ""); "remote-as or peer-group must be specified first" +delete: "touch /tmp/bgp-neighbor-$(../@)-allowas-in.\\$PPID" +end: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"no neighbor $(../@) allowas-in \"; \ + if [ -f \"/tmp/bgp-neighbor-$(../@)-allowas-in.\\$PPID\" ]; then \ + rm -rf /tmp/bgp-neighbor-$(../@)-allowas-in.\\$PPID; \ + else \ + /opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"neighbor $(../@) allowas-in $(./number/@)\"; \ + fi; " diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/allowas-in/number/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/allowas-in/number/node.def new file mode 100644 index 00000000..f546cf81 --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/allowas-in/number/node.def @@ -0,0 +1,4 @@ +type: u32 +help: "Number of occurances of AS number" +syntax: $(@) >= 1 && $(@) <= 10; "allowas-in number must be between 1 and 10" +syntax: ($(../../peer-group/@) != "") || ($(../../remote-as/@) != ""); "remote-as or peer-group must be specified first" diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/attribute-unchanged/as-path/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/attribute-unchanged/as-path/node.def new file mode 100644 index 00000000..d9875f1b --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/attribute-unchanged/as-path/node.def @@ -0,0 +1,2 @@ +help: "AS path attribute" +syntax: ($(../../peer-group/@) != "") || ($(../../remote-as/@) != ""); "remote-as or peer-group should be defined first" diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/attribute-unchanged/med/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/attribute-unchanged/med/node.def new file mode 100644 index 00000000..6ca2dea1 --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/attribute-unchanged/med/node.def @@ -0,0 +1,2 @@ +help: "Multi-exit descriminator attribute" +syntax: ($(../../peer-group/@) != "") || ($(../../remote-as/@) != ""); "remote-as or peer-group should be defined first" diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/attribute-unchanged/next-hop/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/attribute-unchanged/next-hop/node.def new file mode 100644 index 00000000..fb58ce09 --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/attribute-unchanged/next-hop/node.def @@ -0,0 +1,2 @@ +help: "Nexthop attribute" +syntax: ($(../../peer-group/@) != "") || ($(../../remote-as/@) != ""); "remote-as or peer-group should be defined first" diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/attribute-unchanged/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/attribute-unchanged/node.def new file mode 100644 index 00000000..6981f0d3 --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/attribute-unchanged/node.def @@ -0,0 +1,20 @@ +help: "BGP attribute is propagated unchanged to this neighbor" +syntax: ($(../peer-group/@) != "") || ($(../remote-as/@) != ""); "remote-as or peer-group must be specified first" +delete: "touch /tmp/bgp-neighbor-$(../@)-attribute-unchanged.\\$PPID" +end: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"no neighbor $(../@) attribute-unchanged \"; \ + if [ -f \"/tmp/bgp-neighbor-$(../@)-attribute-unchanged.\\$PPID\" ]; then \ + rm -rf /tmp/bgp-neighbor-$(../@)-attribute-unchanged.\\$PPID; \ + else \ + if [ -n \"$(./as-path/@)\" ]; then \ + COND=\"as-path \" ; \ + fi ; \ + if [ -n \"$(./med/@)\" ]; then \ + COND=\"\\$COND med \" ; \ + fi ; \ + if [ -n \"$(./next-hop/@)\" ]; then \ + COND=\"\\$COND next-hop \" ; \ + fi ; \ + /opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"neighbor $(../@) attribute-unchanged \\$COND\"; \ + fi; " diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/capability/dynamic/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/capability/dynamic/node.def new file mode 100644 index 00000000..41adb3d3 --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/capability/dynamic/node.def @@ -0,0 +1,7 @@ +help: "Advertise dynamic capability to this neighbor" +syntax: ($(../../peer-group/@) != "") || ($(../../remote-as/@) != ""); "remote-as or peer-group must be specified first" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"neighbor $(../../@) capability dynamic\" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"no neighbor $(../../@) capability dynamic\" " + diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/capability/orf/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/capability/orf/node.def new file mode 100644 index 00000000..78cab42b --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/capability/orf/node.def @@ -0,0 +1 @@ +help: "Advertise ORF capability to the peer" diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/capability/orf/prefix-list/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/capability/orf/prefix-list/node.def new file mode 100644 index 00000000..06be1587 --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/capability/orf/prefix-list/node.def @@ -0,0 +1 @@ +help: "Advertise prefix-list ORF capability to this neighbor" diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/capability/orf/prefix-list/receive/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/capability/orf/prefix-list/receive/node.def new file mode 100644 index 00000000..c7844c1d --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/capability/orf/prefix-list/receive/node.def @@ -0,0 +1,6 @@ +help: "Capability to RECEIVE the ORF to this neighbor" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../../../@)\" \ + -c \"neighbor $(../../../../@) capability orf prefix-list receive\" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../../../@)\" \ + -c \"no neighbor $(../../../../@) capability orf prefix-list receive\" " + diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/capability/orf/prefix-list/send/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/capability/orf/prefix-list/send/node.def new file mode 100644 index 00000000..1d632fa7 --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/capability/orf/prefix-list/send/node.def @@ -0,0 +1,6 @@ +help: "Capability to SEND the ORF to this neighbor" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../../../@)\" \ + -c \"neighbor $(../../../../@) capability orf prefix-list send\" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../../../@)\" \ + -c \"no neighbor $(../../../../@) capability orf prefix-list send\" " + diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/default-originate/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/default-originate/node.def new file mode 100644 index 00000000..235c871f --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/default-originate/node.def @@ -0,0 +1,15 @@ +help: "Originate default route to this neighbor" +syntax: ($(../peer-group/@) != "") || ($(../remote-as/@) != ""); "remote-as or peer-group must be specified first" +delete: "touch /tmp/bgp-neighbor-$(../@)-default-originate.\\$PPID" +end: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"no neighbor $(../@) default-originate \"; \ + if [ -f \"/tmp/bgp-neighbor-$(../@)-default-originate.\\$PPID\" ]; then \ + rm -rf /tmp/bgp-neighbor-$(../@)-default-originate.\\$PPID; \ + else \ + if [ -n \"$(./route-map/@)\" ]; then \ + COND=\"route-map $(./route-map/@) \" ; \ + fi ; \ + /opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"neighbor $(../@) default-originate \\$COND\"; \ + fi; " + diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/default-originate/route-map/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/default-originate/route-map/node.def new file mode 100644 index 00000000..32df685f --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/default-originate/route-map/node.def @@ -0,0 +1,4 @@ +type: txt +help: "Route-map to specify criteria to originate default" +commit: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --exists \"policy route-map $(@)\" " "; "route-map $(@) doesn't exist" + diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/description/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/description/node.def new file mode 100644 index 00000000..f5ba94f0 --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/description/node.def @@ -0,0 +1,2 @@ +type: txt +help: "Neighbor specific description" diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/disable-connected-check/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/disable-connected-check/node.def new file mode 100644 index 00000000..22841ba7 --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/disable-connected-check/node.def @@ -0,0 +1,7 @@ +help: "one-hop away EBGP peer using loopback address" +syntax: ($(../peer-group/@) != "") || ($(../remote-as/@) != ""); "remote-as or peer-group must be specified first" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"neighbor $(../@) disable-connected-check\" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"no neighbor $(../@) disable-connected-check \" " + diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/distribute-list/in/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/distribute-list/in/node.def new file mode 100644 index 00000000..094880f1 --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/distribute-list/in/node.def @@ -0,0 +1,11 @@ +type: u32 +help: "Filter incoming updates" +syntax: ($(../../peer-group/@) != "") || ($(../../remote-as/@) != ""); "remote-as or peer-group must be specified first" +commit: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --exists \"policy access-list $(@)\" ";"access-list $(@) doesn't exist" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"neighbor $(../../@) distribute-list $(@) in\" " +update: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"neighbor $(../../@) distribute-list $(@) in\" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"no neighbor $(../../@) distribute-list $(@) in\" " + diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/distribute-list/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/distribute-list/node.def new file mode 100644 index 00000000..3b9cbb14 --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/distribute-list/node.def @@ -0,0 +1,2 @@ +help: "Filter updates to/from this neighbor" +syntax: ($(../peer-group/@) != "") || ($(../remote-as/@) != ""); "remote-as or peer-group must be specified first" diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/distribute-list/out/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/distribute-list/out/node.def new file mode 100644 index 00000000..4e809cbf --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/distribute-list/out/node.def @@ -0,0 +1,11 @@ +type: u32 +help: "Filter outgoing updates" +syntax: ($(../../peer-group/@) != "") || ($(../../remote-as/@) != ""); "remote-as or peer-group must be specified first" +commit: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --exists \"policy access-list $(@)\" ";"access-list $(@) doesn't exist" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"neighbor $(../../@) distribute-list $(@) out\" " +update: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"neighbor $(../../@) distribute-list $(@) out\" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"no neighbor $(../../@) distribute-list $(@) out\" " + diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/dont-capability-negotiate/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/dont-capability-negotiate/node.def new file mode 100644 index 00000000..af530583 --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/dont-capability-negotiate/node.def @@ -0,0 +1,7 @@ +help: "Do not perform capability negotiation" +syntax: ($(../peer-group/@) != "") || ($(../remote-as/@) != ""); "remote-as or peer-group must be specified first" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"neighbor $(../@) dont-capability-negotiate \" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"no neighbor $(../@) dont-capability-negotiate \" " + diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/ebgp-multihop/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/ebgp-multihop/node.def new file mode 100644 index 00000000..b2867c51 --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/ebgp-multihop/node.def @@ -0,0 +1,11 @@ +type: u32 +help: "Allow EBGP neighbors not on directly connected networks" +syntax: ($(../peer-group/@) != "") || ($(../remote-as/@) != ""); "remote-as or peer-group must be specified first" +syntax: $(@) >=1 && $(@) <= 255; "ebgp-multihop must be btween 1 and 255" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"neighbor $(../@) ebgp-multihop $(@)\" " +update: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"neighbor $(../@) ebgp-multihop $(@)\" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"no neighbor $(../@) ebgp-multihop \" " + diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/enforce-multihop/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/enforce-multihop/node.def new file mode 100644 index 00000000..0a68deab --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/enforce-multihop/node.def @@ -0,0 +1,7 @@ +help: "Enforce EBGP neighbors perform multihop" +syntax: ($(../peer-group/@) != "") || ($(../remote-as/@) != ""); "remote-as or peer-group must be specified first" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"neighbor $(../@) enforce-multihop \" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"no neighbor $(../@) enforce-multihop \" " + diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/filter-list/in/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/filter-list/in/node.def new file mode 100644 index 00000000..d4e6b963 --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/filter-list/in/node.def @@ -0,0 +1,11 @@ +type: txt +help: "Filter incoming updates based on AS path" +syntax: ($(../../peer-group/@) != "") || ($(../../remote-as/@) != ""); "remote-as or peer-group must be specified first" +commit: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --exists \"policy as-path-list $(@)\" ";"as-path-list $(@) doesn't exist" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"neighbor $(../../@) filter-list $(@) in\" " +update: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"neighbor $(../../@) filter-list $(@) in\" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"no neighbor $(../../@) filter-list $(@) in\" " + diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/filter-list/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/filter-list/node.def new file mode 100644 index 00000000..85b039f9 --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/filter-list/node.def @@ -0,0 +1,2 @@ +help: "Establish BGP filters" +syntax: ($(../peer-group/@) != "") || ($(../remote-as/@) != ""); "remote-as or peer-group must be specified first" diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/filter-list/out/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/filter-list/out/node.def new file mode 100644 index 00000000..fa36d5a0 --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/filter-list/out/node.def @@ -0,0 +1,11 @@ +type: txt +help: "Filter outgoing updates" +syntax: ($(../../peer-group/@) != "") || ($(../../remote-as/@) != ""); "remote-as or peer-group must be specified first" +commit: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --exists \"policy as-path-list $(@)\" ";"as-path-list $(@) doesn't exist" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"neighbor $(../../@) filter-list $(@) out\" " +update: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"neighbor $(../../@) filter-list $(@) out\" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"no neighbor $(../../@) filter-list $(@) out\" " + diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/interface/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/interface/node.def new file mode 100644 index 00000000..fcc3705e --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/interface/node.def @@ -0,0 +1,14 @@ +type: txt +help: "Interface name" +syntax: ($(../peer-group/@) != "") || ($(../remote-as/@) != ""); "remote-as or peer-group must be specified first" +syntax: exec " \ + if [ -z \"`ip addr | grep $(@) `\" ]; then \ + echo $(@) doesn\\'t exist on this system ; \ + exit 1 ; \ + fi ; " +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"neighbor $(../@) interface $(@)\" " +update: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"neighbor $(../@) interface $(@)\" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"no neighbor $(../@) interface $(@)\" " diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/local-as/local-as/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/local-as/local-as/node.def new file mode 100644 index 00000000..fd9616b2 --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/local-as/local-as/node.def @@ -0,0 +1,5 @@ +type: u32 +help: "Local AS number" +syntax: ($(../../peer-group/@) != "") || ($(../../remote-as/@) != ""); "remote-as or peer-group must be specified first" +syntax: $(@) >=1 && $(@) <= 65535; "local-as must be between 1 and 65535" +syntax: $(@) != $(../../../@); "Cannot have local-as same as BGP AS number" diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/local-as/no-prepend/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/local-as/no-prepend/node.def new file mode 100644 index 00000000..fbdaecad --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/local-as/no-prepend/node.def @@ -0,0 +1,2 @@ +help: "Do not prepend local-as to updates from ebgp peers" +syntax: ($(../../peer-group/@) != "") || ($(../../remote-as/@) != ""); "remote-as or peer-group must be specified first" diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/local-as/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/local-as/node.def new file mode 100644 index 00000000..29f9d9f7 --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/local-as/node.def @@ -0,0 +1,18 @@ +help: "Specify a local-as number" +syntax: ($(../peer-group/@) != "") || ($(../remote-as/@) != ""); "remote-as or peer-group must be specified first" +delete: "touch /tmp/bgp-neighbor-$(../@)-local-as.\\$PPID" +end: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"no neighbor $(../@) local-as \"; \ + if [ -f \"/tmp/bgp-neighbor-$(../@)-local-as.\\$PPID\" ]; then \ + rm -rf /tmp/bgp-neighbor-$(../@)-local-as.\\$PPID; \ + else \ + if [ -z \"$(./local-as/@)\" ]; then \ + echo You must specify local-as local-as ; \ + exit 1 ; \ + fi ; \ + if [ -n \"$(./no-prepend/@)\" ]; then \ + COND=\"no-prepend \" ; \ + fi ; \ + /opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"neighbor $(../@) local-as $(./local-as/@) \\$COND \"; \ + fi; " diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/nexthop-self/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/nexthop-self/node.def new file mode 100644 index 00000000..c5ee473d --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/nexthop-self/node.def @@ -0,0 +1,7 @@ +help: "Disable the next hop calculation for this neighbor" +syntax: ($(../peer-group/@) != "") || ($(../remote-as/@) != ""); "remote-as or peer-group must be specified first" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"neighbor $(../@) next-hop-self\" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"no neighbor $(../@) next-hop-self \" " + diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/no-activate/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/no-activate/node.def new file mode 100644 index 00000000..1e3dc69f --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/no-activate/node.def @@ -0,0 +1,6 @@ +help: "Disable the Address Family for this Neighbor" +syntax: ($(../peer-group/@) != "") || ($(../remote-as/@) != ""); "remote-as or peer-group must be specified first" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"no neighbor $(../@) activate \" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"neighbor $(../@) activate \" " diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/no-send-community/extended/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/no-send-community/extended/node.def new file mode 100644 index 00000000..2217d559 --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/no-send-community/extended/node.def @@ -0,0 +1,7 @@ +help: "Do not send extended community attributes" +syntax: ($(../../peer-group/@) != "") || ($(../../remote-as/@) != ""); "remote-as or peer-group must be specified first" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"no neighbor $(../../@) send-community extended\" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"neighbor $(../../@) send-community extended\" " + diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/no-send-community/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/no-send-community/node.def new file mode 100644 index 00000000..5a60159b --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/no-send-community/node.def @@ -0,0 +1,3 @@ +help: "Do not send community attributes to this neighbor" +syntax: ($(../peer-group/@) != "") || ($(../remote-as/@) != ""); "remote-as or peer-group must be specified first" +commit: ($(./extended/@) != "") || ($(./standard/@) != ""); "You must specify the type of community." diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/no-send-community/standard/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/no-send-community/standard/node.def new file mode 100644 index 00000000..e1fec957 --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/no-send-community/standard/node.def @@ -0,0 +1,7 @@ +help: "Do not send standard community attributes" +syntax: ($(../../peer-group/@) != "") || ($(../../remote-as/@) != ""); "remote-as or peer-group must be specified first" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"no neighbor $(../../@) send-community standard\" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"neighbor $(../../@) send-community standard\" " + diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/override-capability/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/override-capability/node.def new file mode 100644 index 00000000..68ddeabe --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/override-capability/node.def @@ -0,0 +1,7 @@ +help: "Override capability negotiation result" +syntax: ($(../peer-group/@) != "") || ($(../remote-as/@) != ""); "remote-as or peer-group must be specified first" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"neighbor $(../@) override-capability\" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"no neighbor $(../@) override-capability \" " + diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/passive/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/passive/node.def new file mode 100644 index 00000000..48a11bbc --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/passive/node.def @@ -0,0 +1,7 @@ +help: "Don't send open messages to this neighbor" +syntax: ($(../peer-group/@) != "") || ($(../remote-as/@) != ""); "remote-as or peer-group must be specified first" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"neighbor $(../@) passive\" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"no neighbor $(../@) passive \" " + diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/peer-group/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/peer-group/node.def new file mode 100644 index 00000000..6c94d7b7 --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/peer-group/node.def @@ -0,0 +1,13 @@ +type: txt +help: "Member of the peer-group" +syntax: $(../remote-as/@) == ""; "remote-as must not be defined if putting this neighbor in a peer group" +syntax: exec "if [ -n \"`echo $(../@) | sed 's/[0-9]\\{1,3\\}.[0-9]\\{1,3\\}.[0-9]\\{1,3\\}.[0-9]\\{1,3\\}//'`\" ]; then \ + exit 1; \ + fi; "; "peer-group token may not be specified for a peer-group" +commit: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --exists \"protocols bgp $(../../@) neighbor $(@)\" "; "peer-group $(@) doesn't exist" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"neighbor $(../@) peer-group $(@)\" " +update: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"neighbor $(../@) peer-group $(@)\" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"no neighbor $(../@) peer-group $(@)\" " diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/port/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/port/node.def new file mode 100644 index 00000000..b16839ce --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/port/node.def @@ -0,0 +1,10 @@ +type: u32 +help: "Neighbor's BGP port" +syntax: $(@) >= 1 && $(@) <= 65535; "remote-as must be between 1 and 65535" +syntax: ($(../peer-group/@) != "") || ($(../remote-as/@) != ""); "remote-as or peer-group must be specified first" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"neighbor $(../@) port $(@)\" " +update: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"neighbor $(../@) port $(@)\" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"no neighbor $(../@) port \" " diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/prefix-list/in/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/prefix-list/in/node.def new file mode 100644 index 00000000..b257d2b5 --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/prefix-list/in/node.def @@ -0,0 +1,11 @@ +type: txt +help: "Filter incoming updates" +syntax: ($(../../peer-group/@) != "") || ($(../../remote-as/@) != ""); "remote-as or peer-group must be specified first" +commit: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --exists \"policy prefix-list $(@)\" ";"prefix-list $(@) doesn't exist" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"neighbor $(../../@) prefix-list $(@) in\" " +update: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"neighbor $(../../@) prefix-list $(@) in\" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"no neighbor $(../../@) prefix-list $(@) in\" " + diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/prefix-list/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/prefix-list/node.def new file mode 100644 index 00000000..3b9cbb14 --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/prefix-list/node.def @@ -0,0 +1,2 @@ +help: "Filter updates to/from this neighbor" +syntax: ($(../peer-group/@) != "") || ($(../remote-as/@) != ""); "remote-as or peer-group must be specified first" diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/prefix-list/out/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/prefix-list/out/node.def new file mode 100644 index 00000000..6a973c26 --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/prefix-list/out/node.def @@ -0,0 +1,11 @@ +type: txt +help: "Filter outgoing updates" +syntax: ($(../../peer-group/@) != "") || ($(../../remote-as/@) != ""); "remote-as or peer-group must be specified first" +commit: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --exists \"policy prefix-list $(@)\" ";"prefix-list $(@) doesn't exist" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"neighbor $(../../@) prefix-list $(@) out\" " +update: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"neighbor $(../../@) prefix-list $(@) out\" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"no neighbor $(../../@) prefix-list $(@) out\" " + diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/remote-as/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/remote-as/node.def new file mode 100644 index 00000000..847c49f4 --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/remote-as/node.def @@ -0,0 +1,7 @@ +type: u32 +help: "Specify BGP neighbor ASN" +syntax: $(@) >= 1 && $(@) <= 65535; "remote-as must be between 1 and 65535" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"neighbor $(../@) remote-as $(@)\" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"no neighbor $(../@) remote-as $(@)\" " diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/remove-private-as/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/remove-private-as/node.def new file mode 100644 index 00000000..4b6758b0 --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/remove-private-as/node.def @@ -0,0 +1,7 @@ +help: "Remove private AS number from outbound updates" +syntax: $(../peer-group/@) != "" || $(../remote-as/@) != ""; "remote-as or peer-group must be specified first" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"neighbor $(../@) remove-private-AS \" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"no neighbor $(../@) remove-private-AS \" " + diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/route-map/export/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/route-map/export/node.def new file mode 100644 index 00000000..f6a1f45e --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/route-map/export/node.def @@ -0,0 +1,11 @@ +type: txt +help: "Route-map to apply to incoming updates" +syntax: ($(../../peer-group/@) != "") || ($(../../remote-as/@) != ""); "remote-as or peer-group must be specified first" +commit: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --exists \"policy route-map $(@)\" ";"route-map $(@) doesn't exist" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"neighbor $(../../@) route-map $(@) in\" " +update: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"neighbor $(../../@) route-map $(@) in\" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"no neighbor $(../../@) route-map $(@) in\" " + diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/route-map/import/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/route-map/import/node.def new file mode 100644 index 00000000..f6a1f45e --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/route-map/import/node.def @@ -0,0 +1,11 @@ +type: txt +help: "Route-map to apply to incoming updates" +syntax: ($(../../peer-group/@) != "") || ($(../../remote-as/@) != ""); "remote-as or peer-group must be specified first" +commit: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --exists \"policy route-map $(@)\" ";"route-map $(@) doesn't exist" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"neighbor $(../../@) route-map $(@) in\" " +update: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"neighbor $(../../@) route-map $(@) in\" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"no neighbor $(../../@) route-map $(@) in\" " + diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/route-map/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/route-map/node.def new file mode 100644 index 00000000..171252f7 --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/route-map/node.def @@ -0,0 +1,2 @@ +help: "Route-map to apply on updates to/from this neighbor" +syntax: ($(../peer-group/@) != "") || ($(../remote-as/@) != ""); "remote-as or peer-group must be specified first" diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/route-reflector-client/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/route-reflector-client/node.def new file mode 100644 index 00000000..5a596518 --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/route-reflector-client/node.def @@ -0,0 +1,8 @@ +help: "Configure a neighbor as Route Reflector client" +syntax: ($(../peer-group/@) != "") || ($(../remote-as/@) != ""); "remote-as or peer-group must be specified first" +commit: $(../../@) == $(../remote-as/@); "remote-as must equal local-as to be a route-reflector client" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"neighbor $(../@) route-reflector-client \" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"no neighbor $(../@) route-reflector-client \" " + diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/route-server-client/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/route-server-client/node.def new file mode 100644 index 00000000..ea07fc71 --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/route-server-client/node.def @@ -0,0 +1,7 @@ +help: "Configure a neighbor as Route Server client" +syntax: ($(../peer-group/@) != "") || ($(../remote-as/@) != ""); "remote-as or peer-group must be specified first" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"neighbor $(../@) route-server-client \" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"no neighbor $(../@) route-server-client \" " + diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/shutdown/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/shutdown/node.def new file mode 100644 index 00000000..c155ae09 --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/shutdown/node.def @@ -0,0 +1,5 @@ +help: "Administratively shut down this neighbor" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"neighbor $(../@) shutdown\" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"no neighbor $(../@) shutdown\" " diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/soft-reconfiguration/inbound/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/soft-reconfiguration/inbound/node.def new file mode 100644 index 00000000..eb0ea4af --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/soft-reconfiguration/inbound/node.def @@ -0,0 +1,7 @@ +help: "Allow inbound soft reconfiguration for this neighbor" +syntax: ($(../../peer-group/@) != "") || ($(../../remote-as/@) != ""); "remote-as or peer-group must be specified first" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"no neighbor $(../../@) soft-reconfiguration inbound \" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../../@)\" \ + -c \"neighbor $(../../@) soft-reconfiguration inbound \" " + diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/soft-reconfiguration/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/soft-reconfiguration/node.def new file mode 100644 index 00000000..9f1636eb --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/soft-reconfiguration/node.def @@ -0,0 +1,3 @@ +help: "Per neighbor soft reconfiguration" +syntax: ($(../peer-group/@) != "") || ($(../remote-as/@) != ""); "remote-as or peer-group must be specified first" +commit: $(./inbound/@) != ""; "You must specify the type of soft-reconfiguration" diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/strict-capability-match/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/strict-capability-match/node.def new file mode 100644 index 00000000..61aef8c3 --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/strict-capability-match/node.def @@ -0,0 +1,6 @@ +help: "Strict capability negotiation match" +syntax: ($(../peer-group/@) != "") || ($(../remote-as/@) != ""); "remote-as or peer-group must be specified first" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"neighbor $(../@) strict-capability-match \" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"no neighbor $(../@) strict-capability-match \" " diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/timers/connect/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/timers/connect/node.def new file mode 100644 index 00000000..360a7659 --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/timers/connect/node.def @@ -0,0 +1,4 @@ +type: u32 +help: "BGP connect timer" +syntax: ($(../../peer-group/@) != "") || ($(../../remote-as/@) != ""); "remote-as or peer-group must be specified first" +syntax: $(@) >=0 && $(@) <= 65535; "BGP connect timer must be between 0 and 65535" diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/timers/holdtime/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/timers/holdtime/node.def new file mode 100644 index 00000000..54bf4026 --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/timers/holdtime/node.def @@ -0,0 +1,4 @@ +type: u32 +help: "Holdtime interval" +syntax: ($(../../peer-group/@) != "") || ($(../../remote-as/@) != ""); "remote-as or peer-group must be specified first" +syntax: $(@) == 0 || ($(@) >= 4 && $(@) <= 65535); "Holdtime interval must be 0 or between 4 and 65535" diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/timers/keepalive/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/timers/keepalive/node.def new file mode 100644 index 00000000..bcb2ff0b --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/timers/keepalive/node.def @@ -0,0 +1,4 @@ +type: u32 +help: "Keepalive interval" +syntax: ($(../../peer-group/@) != "") || ($(../../remote-as/@) != ""); "remote-as or peer-group must be specified first" +syntax: $(@) >= 1 && $(@) <= 65535; "Keepalive interval must be between 1 and 65535" diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/timers/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/timers/node.def new file mode 100644 index 00000000..dbfad7ca --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/timers/node.def @@ -0,0 +1,19 @@ +help: "BGP per neighbor timers" +syntax: ($(../peer-group/@) != "") || ($(../remote-as/@) != ""); "remote-as or peer-group must be specified first" +delete: "touch /tmp/bgp-neighbor-$(../@)-timers.\\$PPID" +end: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"no neighbor $(../@) timers \"; \ + /opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"no neighbor $(../@) timers connect \"; \ + if [ -f \"/tmp/bgp-neighbor-$(../@)-timers.\\$PPID\" ]; then \ + rm -rf /tmp/bgp-neighbor-$(../@)-timers.\\$PPID; \ + else \ + if [ -n \"$(./connect/@)\" ]; then \ + /opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"neighbor $(../@) timers connect $(./connect/@)\" ; \ + fi ; \ + if [ -n \"$(./keepalive/@)\" ] || [ -n \"$(./holdtime/@)\" ]; then \ + /opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"neighbor $(../@) timers $(./keepalive/@) $(./holdtime/@)\"; \ + fi ; \ + fi; " diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/unsuppress-map/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/unsuppress-map/node.def new file mode 100644 index 00000000..bdcd3e34 --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/unsuppress-map/node.def @@ -0,0 +1,8 @@ +type: txt +help: "Route-map to selectively unsuppress suppressed routes" +syntax: ($(../peer-group/@) != "") || ($(../remote-as/@) != ""); "remote-as or peer-group must be specified first" +commit: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --exists \"policy route-map $(@)\" ";"route-map $(@) doesn't exist" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"neighbor $(../@) unsuppress-map $(@)\" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"no neighbor $(../@) unsuppress-map $(@)\" " diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/update-source/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/update-source/node.def new file mode 100644 index 00000000..3870a105 --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/update-source/node.def @@ -0,0 +1,12 @@ +type: txt +help: "Source of routing updates" +syntax: ($(../peer-group/@) != "") || ($(../remote-as/@) != ""); "remote-as or peer-group must be specified first" +syntax: exec " \ + if [ -z \"`ip addr | grep $(@) `\" ]; then \ + echo $(@) doesn\\'t exist on this system ; \ + exit 1 ; \ + fi ; " +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"neighbor $(../@) update-source $(@)\" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"no neighbor $(../@) update-source $(@)\" " diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/weight/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/weight/node.def new file mode 100644 index 00000000..f5904a9b --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/weight/node.def @@ -0,0 +1,8 @@ +type: u32 +help: "Set default weight for routes from this neighbor" +syntax: ($(../peer-group/@) != "") || ($(../remote-as/@) != ""); "remote-as or peer-group must be specified first" +syntax: $(@) >= 1 && $(@) <= 65535; "weight must be between 1 and 65535" +create: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"neighbor $(../@) weight $(@)\" " +delete: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../../@)\" \ + -c \"no neighbor $(../@) weight $(@)\" " diff --git a/templates/protocols/bgp/node.tag/network/node.def b/templates/protocols/bgp/node.tag/network/node.def new file mode 100644 index 00000000..f572df35 --- /dev/null +++ b/templates/protocols/bgp/node.tag/network/node.def @@ -0,0 +1,20 @@ +tag: +type: ipv4net +help: "Specify a network to announce via BGP" +syntax: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --check-prefix-boundry $(@)" +syntax: ($(./backdoor/@) != "") && ($(./route-map/@) != ""); "Must specify route-map or backdoor but not both" +delete: "touch /tmp/`echo $(@) | sed 's!/!!'`.\\$PPID" +end: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../@)\" \ + -c \"no network $(@)\"; \ + if [ -f \"/tmp/`echo $(@) | sed 's!/!!'`.\\$PPID\" ]; then \ + rm -rf /tmp/`echo $(@) | sed 's!/!!'`.\\$PPID; \ + else \ + if [ -n \"$(./backdoor/@)\" ]; then \ + COND=\"backdoor\"; + fi; \ + if [ -n \"$(./route-map/@)\" ]; then \ + COND=\"route-map $(./route-map/@)\"; \ + fi; \ + /opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../@)\" \ + -c \"network $(@) \\$COND\"; \ + fi; " diff --git a/templates/protocols/bgp/node.tag/network/node.tag/backdoor/node.def b/templates/protocols/bgp/node.tag/network/node.tag/backdoor/node.def new file mode 100644 index 00000000..eb1b3ab5 --- /dev/null +++ b/templates/protocols/bgp/node.tag/network/node.tag/backdoor/node.def @@ -0,0 +1 @@ +help: "Specify a BGP backdoor route" diff --git a/templates/protocols/bgp/node.tag/network/node.tag/backdoor/node.def.#ORIG# b/templates/protocols/bgp/node.tag/network/node.tag/backdoor/node.def.#ORIG# new file mode 100644 index 00000000..3b6ef106 --- /dev/null +++ b/templates/protocols/bgp/node.tag/network/node.tag/backdoor/node.def.#ORIG# @@ -0,0 +1,15 @@ +type: bool +# TODO: this needs to be an exists type +help: "Specify a BGP backdoor route" +default: false +# TODO: back referencing doesn't remove the %2F +create: "sh -c \" \ + PREF=`echo $(../@) | sed 's!%2F!/!'`; \ + /opt/quagga/bin/vtysh -c \\\"configure terminal\\\" -c \\\"router bgp $(../../@)\\\" \ + -c \\\"network \\\\$PREF backdoor\\\" \ + \" " +delete: "sh -c \" \ + PREF=`echo $(../@) | sed 's!%2F!/!'`; \ + /opt/quagga/bin/vtysh -c \\\"configure terminal\\\" -c \\\"router bgp $(../../@)\\\" \ + -c \\\"no network \\\\$PREF backdoor\\\" \ + \" " diff --git a/templates/protocols/bgp/node.tag/network/node.tag/route-map/node.def b/templates/protocols/bgp/node.tag/network/node.tag/route-map/node.def new file mode 100644 index 00000000..a0f6f5fa --- /dev/null +++ b/templates/protocols/bgp/node.tag/network/node.tag/route-map/node.def @@ -0,0 +1,3 @@ +type: txt +help: "Route-map to modify the attributes" +commit: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --exists \"policy route-map $(@)\" ";"route-map $(@) doesn't exist" diff --git a/templates/protocols/bgp/node.tag/redistribute/connected/metric/node.def b/templates/protocols/bgp/node.tag/redistribute/connected/metric/node.def new file mode 100644 index 00000000..984a7064 --- /dev/null +++ b/templates/protocols/bgp/node.tag/redistribute/connected/metric/node.def @@ -0,0 +1,2 @@ +type: u32 +help: "Metric for redistributed routes" diff --git a/templates/protocols/bgp/node.tag/redistribute/connected/node.def b/templates/protocols/bgp/node.tag/redistribute/connected/node.def new file mode 100644 index 00000000..26573a6f --- /dev/null +++ b/templates/protocols/bgp/node.tag/redistribute/connected/node.def @@ -0,0 +1,16 @@ +help: "Redistribute connected routes" +delete: "touch /tmp/bgp-redist-connected.\\$PPID" +end: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../@)\" \ + -c \"no redistribute connected \"; \ + if [ -f \"/tmp/bgp-redist-connected.\\$PPID\" ]; then \ + rm -rf /tmp/bgp-redist-connected.\\$PPID; \ + else \ + if [ -n \"$(./metric/@)\" ]; then \ + COND=\"metric $(./metric/@)\"; + fi; \ + if [ -n \"$(./route-map/@)\" ]; then \ + COND=\"\\$COND route-map $(./route-map/@)\"; \ + fi; \ + /opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../@)\" \ + -c \"redistribute connected \\$COND\"; \ + fi; " diff --git a/templates/protocols/bgp/node.tag/redistribute/connected/route-map/node.def b/templates/protocols/bgp/node.tag/redistribute/connected/route-map/node.def new file mode 100644 index 00000000..5ce5f0ab --- /dev/null +++ b/templates/protocols/bgp/node.tag/redistribute/connected/route-map/node.def @@ -0,0 +1,3 @@ +type: txt +help: "Route map reference" +commit: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --exists \"policy route-map $(@)\" ";"route-map $(@) doesn't exist" diff --git a/templates/protocols/bgp/node.tag/redistribute/kernel/metric/node.def b/templates/protocols/bgp/node.tag/redistribute/kernel/metric/node.def new file mode 100644 index 00000000..984a7064 --- /dev/null +++ b/templates/protocols/bgp/node.tag/redistribute/kernel/metric/node.def @@ -0,0 +1,2 @@ +type: u32 +help: "Metric for redistributed routes" diff --git a/templates/protocols/bgp/node.tag/redistribute/kernel/node.def b/templates/protocols/bgp/node.tag/redistribute/kernel/node.def new file mode 100644 index 00000000..0fc1441c --- /dev/null +++ b/templates/protocols/bgp/node.tag/redistribute/kernel/node.def @@ -0,0 +1,16 @@ +help: "Redistribute kernel routes" +delete: "touch /tmp/bgp-redist-kernel.\\$PPID" +end: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../@)\" \ + -c \"no redistribute kernel \"; \ + if [ -f \"/tmp/bgp-redist-kernel.\\$PPID\" ]; then \ + rm -rf /tmp/bgp-redist-kernel.\\$PPID; \ + else \ + if [ -n \"$(./metric/@)\" ]; then \ + COND=\"metric $(./metric/@)\"; + fi; \ + if [ -n \"$(./route-map/@)\" ]; then \ + COND=\"\\$COND route-map $(./route-map/@)\"; \ + fi; \ + /opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../@)\" \ + -c \"redistribute kernel \\$COND\"; \ + fi; " diff --git a/templates/protocols/bgp/node.tag/redistribute/kernel/route-map/node.def b/templates/protocols/bgp/node.tag/redistribute/kernel/route-map/node.def new file mode 100644 index 00000000..5ce5f0ab --- /dev/null +++ b/templates/protocols/bgp/node.tag/redistribute/kernel/route-map/node.def @@ -0,0 +1,3 @@ +type: txt +help: "Route map reference" +commit: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --exists \"policy route-map $(@)\" ";"route-map $(@) doesn't exist" diff --git a/templates/protocols/bgp/node.tag/redistribute/node.def b/templates/protocols/bgp/node.tag/redistribute/node.def new file mode 100644 index 00000000..e46c9122 --- /dev/null +++ b/templates/protocols/bgp/node.tag/redistribute/node.def @@ -0,0 +1 @@ +help: "Redistribute information from another routing protocol" diff --git a/templates/protocols/bgp/node.tag/redistribute/ospf/metric/node.def b/templates/protocols/bgp/node.tag/redistribute/ospf/metric/node.def new file mode 100644 index 00000000..984a7064 --- /dev/null +++ b/templates/protocols/bgp/node.tag/redistribute/ospf/metric/node.def @@ -0,0 +1,2 @@ +type: u32 +help: "Metric for redistributed routes" diff --git a/templates/protocols/bgp/node.tag/redistribute/ospf/node.def b/templates/protocols/bgp/node.tag/redistribute/ospf/node.def new file mode 100644 index 00000000..1ac2bf28 --- /dev/null +++ b/templates/protocols/bgp/node.tag/redistribute/ospf/node.def @@ -0,0 +1,16 @@ +help: "Redistribute OSPF routes" +delete: "touch /tmp/bgp-redist-ospf.\\$PPID" +end: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../@)\" \ + -c \"no redistribute ospf \"; \ + if [ -f \"/tmp/bgp-redist-ospf.\\$PPID\" ]; then \ + rm -rf /tmp/bgp-redist-ospf.\\$PPID; \ + else \ + if [ -n \"$(./metric/@)\" ]; then \ + COND=\"metric $(./metric/@)\"; + fi; \ + if [ -n \"$(./route-map/@)\" ]; then \ + COND=\"\\$COND route-map $(./route-map/@)\"; \ + fi; \ + /opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../@)\" \ + -c \"redistribute ospf \\$COND\"; \ + fi; " diff --git a/templates/protocols/bgp/node.tag/redistribute/ospf/route-map/node.def b/templates/protocols/bgp/node.tag/redistribute/ospf/route-map/node.def new file mode 100644 index 00000000..5ce5f0ab --- /dev/null +++ b/templates/protocols/bgp/node.tag/redistribute/ospf/route-map/node.def @@ -0,0 +1,3 @@ +type: txt +help: "Route map reference" +commit: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --exists \"policy route-map $(@)\" ";"route-map $(@) doesn't exist" diff --git a/templates/protocols/bgp/node.tag/redistribute/rip/metric/node.def b/templates/protocols/bgp/node.tag/redistribute/rip/metric/node.def new file mode 100644 index 00000000..984a7064 --- /dev/null +++ b/templates/protocols/bgp/node.tag/redistribute/rip/metric/node.def @@ -0,0 +1,2 @@ +type: u32 +help: "Metric for redistributed routes" diff --git a/templates/protocols/bgp/node.tag/redistribute/rip/node.def b/templates/protocols/bgp/node.tag/redistribute/rip/node.def new file mode 100644 index 00000000..619de2ec --- /dev/null +++ b/templates/protocols/bgp/node.tag/redistribute/rip/node.def @@ -0,0 +1,16 @@ +help: "Redistribute RIP routes" +delete: "touch /tmp/bgp-redist-rip.\\$PPID" +end: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../@)\" \ + -c \"no redistribute rip \"; \ + if [ -f \"/tmp/bgp-redist-rip.\\$PPID\" ]; then \ + rm -rf /tmp/bgp-redist-rip.\\$PPID; \ + else \ + if [ -n \"$(./metric/@)\" ]; then \ + COND=\"metric $(./metric/@)\"; + fi; \ + if [ -n \"$(./route-map/@)\" ]; then \ + COND=\"\\$COND route-map $(./route-map/@)\"; \ + fi; \ + /opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../@)\" \ + -c \"redistribute rip \\$COND\"; \ + fi; " diff --git a/templates/protocols/bgp/node.tag/redistribute/rip/route-map/node.def b/templates/protocols/bgp/node.tag/redistribute/rip/route-map/node.def new file mode 100644 index 00000000..5ce5f0ab --- /dev/null +++ b/templates/protocols/bgp/node.tag/redistribute/rip/route-map/node.def @@ -0,0 +1,3 @@ +type: txt +help: "Route map reference" +commit: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --exists \"policy route-map $(@)\" ";"route-map $(@) doesn't exist" diff --git a/templates/protocols/bgp/node.tag/redistribute/static/metric/node.def b/templates/protocols/bgp/node.tag/redistribute/static/metric/node.def new file mode 100644 index 00000000..984a7064 --- /dev/null +++ b/templates/protocols/bgp/node.tag/redistribute/static/metric/node.def @@ -0,0 +1,2 @@ +type: u32 +help: "Metric for redistributed routes" diff --git a/templates/protocols/bgp/node.tag/redistribute/static/node.def b/templates/protocols/bgp/node.tag/redistribute/static/node.def new file mode 100644 index 00000000..98ff7703 --- /dev/null +++ b/templates/protocols/bgp/node.tag/redistribute/static/node.def @@ -0,0 +1,16 @@ +help: "Redistribute static routes" +delete: "touch /tmp/bgp-redist-static.\\$PPID" +end: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../@)\" \ + -c \"no redistribute static \"; \ + if [ -f \"/tmp/bgp-redist-static.\\$PPID\" ]; then \ + rm -rf /tmp/bgp-redist-static.\\$PPID; \ + else \ + if [ -n \"$(./metric/@)\" ]; then \ + COND=\"metric $(./metric/@)\"; + fi; \ + if [ -n \"$(./route-map/@)\" ]; then \ + COND=\"\\$COND route-map $(./route-map/@)\"; \ + fi; \ + /opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../@)\" \ + -c \"redistribute static \\$COND\"; \ + fi; " diff --git a/templates/protocols/bgp/node.tag/redistribute/static/route-map/node.def b/templates/protocols/bgp/node.tag/redistribute/static/route-map/node.def new file mode 100644 index 00000000..5ce5f0ab --- /dev/null +++ b/templates/protocols/bgp/node.tag/redistribute/static/route-map/node.def @@ -0,0 +1,3 @@ +type: txt +help: "Route map reference" +commit: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --exists \"policy route-map $(@)\" ";"route-map $(@) doesn't exist" diff --git a/templates/protocols/bgp/node.tag/timers/holdtime/node.def b/templates/protocols/bgp/node.tag/timers/holdtime/node.def new file mode 100644 index 00000000..b7da119e --- /dev/null +++ b/templates/protocols/bgp/node.tag/timers/holdtime/node.def @@ -0,0 +1,3 @@ +type: u32 +help: "Holdtime interval" +syntax: $(@) == 0 || ($(@) >= 4 && $(@) <= 65535); "Holdtime interval must be 0 or between 4 and 65535" diff --git a/templates/protocols/bgp/node.tag/timers/keepalive/node.def b/templates/protocols/bgp/node.tag/timers/keepalive/node.def new file mode 100644 index 00000000..59067fdc --- /dev/null +++ b/templates/protocols/bgp/node.tag/timers/keepalive/node.def @@ -0,0 +1,3 @@ +type: u32 +help: "Keepalive interval" +syntax: $(@) >= 1 && $(@) <= 65535; "Keepalive interval must be between 1 and 65535" diff --git a/templates/protocols/bgp/node.tag/timers/node.def b/templates/protocols/bgp/node.tag/timers/node.def new file mode 100644 index 00000000..bf6da0c7 --- /dev/null +++ b/templates/protocols/bgp/node.tag/timers/node.def @@ -0,0 +1,12 @@ +help: "Adjust routing timers" +commit: $(./keepalive/@) != ""; "You must set a keepalive interval" +commit: $(./holdtime/@) != ""; "You must set a holdtime interval" +delete: "touch /tmp/bgp-timers.\\$PPID" +end: "/opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../@)\" \ + -c \"no timers bgp\"; \ + if [ -f \"/tmp/bgp-timers.\\$PPID\" ]; then \ + rm -rf /tmp/bgp-timers.\\$PPID; \ + else \ + /opt/vyatta/bin/vtysh -c \"configure terminal\" -c \"router bgp $(../@)\" \ + -c \"timers bgp $(./keepalive/@) $(./holdtime/@)\"; \ + fi; " |