summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/protocols/bgp/node.tag/neighbor/node.tag/attribute-unchanged/node.def24
-rw-r--r--templates/protocols/bgp/node.tag/neighbor/node.tag/local-as/local-as/node.def2
-rw-r--r--templates/protocols/bgp/node.tag/neighbor/node.tag/remote-as/node.def6
-rw-r--r--templates/protocols/bgp/node.tag/parameters/confederation/peers/node.def2
-rw-r--r--templates/protocols/bgp/node.tag/parameters/dampening/node.def17
5 files changed, 28 insertions, 23 deletions
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
index c45b57f0..a0de96f2 100644
--- 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
@@ -7,17 +7,19 @@ end: ${vyatta_sbindir}/vyatta-vtysh.pl -noerr -c "configure terminal" -c "route
if [ -f "/tmp/bgp-neighbor-$VAR(../@)-attribute-unchanged.$PPID" ]; then
rm -rf /tmp/bgp-neighbor-$VAR(../@)-attribute-unchanged.$PPID;
else
- if [ -n "$VAR(./as-path/@)" ]; then
- cond="as-path " ;
- fi ;
- if [ -n "$VAR(./med/@)" ]; then
- cond="$cond med " ;
- fi ;
- if [ -n "$VAR(./next-hop/@)" ]; then
- cond="$cond next-hop " ;
- fi ;
- if [ -n "$VAR(../remote-as/@)" ]; then
- peer="remote-as $VAR(../remote-as/@)";
+ ## the calls to check-typeless-node should be removed when the type-less node built-in returns correctly
+ ${vyatta_sbindir}/vyatta-check-typeless-node.pl "protocols bgp $VAR(../../@) neighbor $VAR(../@) attribute-unchanged as-path"
+ if [ $? -eq 0 ]; then
+ cond="as-path " ;
+ fi ;
+ ${vyatta_sbindir}/vyatta-check-typeless-node.pl "protocols bgp $VAR(../../@) neighbor $VAR(../@) attribute-unchanged med"
+ if [ $? -eq 0 ]; then
+ cond="$cond med " ;
+ fi ;
+ ${vyatta_sbindir}/vyatta-check-typeless-node.pl "protocols bgp $VAR(../../@) neighbor $VAR(../@) attribute-unchanged next-hop"
+ if [ $? -eq 0 ]; then
+ cond="$cond next-hop " ;
+ fi ;
else
peer="peer-group $VAR(../peer-group/@)";
fi;
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
index 6a7a1f87..ba8f4c04 100644
--- 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
@@ -2,6 +2,6 @@ type: u32
help: set the local AS number
comp_help: \1 <1-4294967294>\tlocal AS number
syntax:expression: $VAR(@) >=1 && $VAR(@) <= 4294967294; "local-as must be between 1 and 4294967294"
-syntax:expression: $VAR(@) != $VAR(../../../@); "Cannot have local-as same as BGP AS number"
+commit:expression: $VAR(@) != $VAR(../../../@); "protocols bgp $VAR(../../../@) neighbor $VAR(../../@): you can't set local-as the same as the router AS"
commit:expression: exec "/opt/vyatta/sbin/vyatta-bgp.pl --check-as --as $VAR(../../../@) --neighbor $VAR(../../@)"
commit:expression: $VAR(../peer-group/) == ""; "protocols bgp $VAR(../../../@) neighbor $VAR(../../@): you can't set local-as for a neighbor in a peer-group"
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
index e668c22b..7830da49 100644
--- 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
@@ -4,5 +4,7 @@ comp_help: \1 <1-4294967294>\tAS number
syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 4294967294; "remote-as must be between 1 and 4294967294"
update: ${vyatta_sbindir}/vyatta-vtysh.pl -c "configure terminal" -c "router bgp $VAR(../../@)" \
-c "neighbor $VAR(../@) remote-as $VAR(@)"
-delete: ${vyatta_sbindir}/vyatta-vtysh.pl -c "configure terminal" -c "router bgp $VAR(../../@)" \
- -c "no neighbor $VAR(../@) remote-as $VAR(@)"
+# commented out because deleting anything after remote-as will cause a failure in Quagga
+# this is a temporary fix until node ordering is enabled
+#delete: ${vyatta_sbindir}/vyatta-vtysh.pl -c "configure terminal" -c "router bgp $VAR(../../@)" \
+# -c "no neighbor $VAR(../@) remote-as $VAR(@)"
diff --git a/templates/protocols/bgp/node.tag/parameters/confederation/peers/node.def b/templates/protocols/bgp/node.tag/parameters/confederation/peers/node.def
index c07a346d..1d81c26f 100644
--- a/templates/protocols/bgp/node.tag/parameters/confederation/peers/node.def
+++ b/templates/protocols/bgp/node.tag/parameters/confederation/peers/node.def
@@ -1,7 +1,7 @@
multi:
type: u32
help: set the peer ASs in the BGP confederation
-comp_help: \1 <1-4294967294>\tpeer AS number numbers (ex: "435 234")
+comp_help: \1 <1-4294967294>\tpeer AS number number
syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 4294967294; "confederation AS id must be between 1 and 4294967294"
update: ${vyatta_sbindir}/vyatta-vtysh.pl -c "configure terminal" -c "router bgp $VAR(../../../@)" \
-c "bgp confederation peers $VAR(@)"
diff --git a/templates/protocols/bgp/node.tag/parameters/dampening/node.def b/templates/protocols/bgp/node.tag/parameters/dampening/node.def
index ed61e381..5ab6108f 100644
--- a/templates/protocols/bgp/node.tag/parameters/dampening/node.def
+++ b/templates/protocols/bgp/node.tag/parameters/dampening/node.def
@@ -1,11 +1,12 @@
help: enable route-flap dampening
delete:expression: "touch /tmp/bgp-dampening.$PPID"
-end: ${vyatta_sbindir}/vyatta-vtysh.pl -c "configure terminal" -c "router bgp $VAR(../../@)" \
- -c "no bgp dampening" ;
- if [ -f "/tmp/bgp-dampening.$PPID" ]; then
- rm -f "/tmp/bgp-dampening.$PPID" ;
- else
+# Note that there is a bug in quagga here. If bgpd gets two 'no bgp dampening'
+# commands in a row it will crash
+end: if [ -f "/tmp/bgp-dampening.$PPID" ]; then
${vyatta_sbindir}/vyatta-vtysh.pl -c "configure terminal" -c "router bgp $VAR(../../@)" \
- -c "bgp dampening $VAR(./half-life/@) $VAR(./re-use/@) $VAR(./start-suppress-time/@) $VAR(./max-suppress-time/@)" ;
- fi ;
-
+ -c "no bgp dampening" ;
+ rm -f "/tmp/bgp-dampening.$PPID" ;
+ else
+ ${vyatta_sbindir}/vyatta-vtysh.pl -c "configure terminal" -c "router bgp $VAR(../../@)" \
+ -c "bgp dampening $VAR(./half-life/@) $VAR(./re-use/@) $VAR(./start-suppress-time/@) $VAR(./max-suppress-time/@)" ;
+ fi ;