diff options
Diffstat (limited to 'templates/protocols/bgp')
4 files changed, 29 insertions, 22 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 9e6db64e..0439166e 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,21 @@ 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 ; + if [ -n "$VAR(../remote-as/@)" ]; then + peer="remote-as $VAR(../remote-as/@)"; 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 c70dba65..f4277aad 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 75b0f3a7..c10df2e1 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/dampening/node.def b/templates/protocols/bgp/node.tag/parameters/dampening/node.def index a86cbe79..5d71fca0 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 ; |