From 5ae305002d35de573a34974104f13ebede556715 Mon Sep 17 00:00:00 2001 From: Robert Bays Date: Fri, 23 Jul 2010 13:07:44 -0700 Subject: fix for bug 5892 --- templates/protocols/bgp/node.tag/neighbor/node.tag/local-as/node.def | 4 +--- .../protocols/bgp/node.tag/parameters/confederation/peers/node.def | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'templates') 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 index a60b9bb1..42fd3cec 100644 --- 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 @@ -4,6 +4,4 @@ help: Local AS number [REQUIRED] val_help: u32:1-4294967294; Local AS number syntax:expression: $VAR(@) >=1 && $VAR(@) <= 4294967294; "local-as must be between 1 and 4294967294" commit:expression: $VAR(@) != $VAR(../../@); "you can't set local-as the same as the router AS" -commit:expression: $VAR(../remote-as/@) != $VAR(../../@); "local-as can't be set on iBGP peers" -commit:expression: exec "/opt/vyatta/sbin/vyatta-bgp.pl --check-local-as --neighbor $VAR(../@) --as $VAR(../../@)" - +commit:expression: exec "/opt/vyatta/sbin/vyatta-bgp.pl --is-iBGP --neighbor $VAR(../@) --as $VAR(../../@)"; "local-as can't be set on iBGP peers" 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 71c6b0a8..a5d5b671 100644 --- a/templates/protocols/bgp/node.tag/parameters/confederation/peers/node.def +++ b/templates/protocols/bgp/node.tag/parameters/confederation/peers/node.def @@ -3,3 +3,4 @@ type: u32 help: Peer ASs in the BGP confederation val_help: u32:1-4294967294; Peer AS number numbers (ex: "435 234") syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 4294967294; "confederation AS id must be between 1 and 4294967294" +commit:expression: exec "/opt/vyatta/sbin/vyatta-bgp.pl --check-for-iBGP-ASN $VAR(@) --as $VAR(../../../@)"; "can't set confederation ASN to $VAR(@). Delete neighbors with remote-as $VAR(@) first." -- cgit v1.2.3 From 0773ce1032d07f7f74e2b41c0f160570a8ed66a1 Mon Sep 17 00:00:00 2001 From: Robert Bays Date: Fri, 6 Aug 2010 15:40:27 -0700 Subject: fix for bug 5925 --- scripts/bgp/vyatta-bgp.pl | 3 ++- .../protocols/bgp/node.tag/parameters/confederation/peers/node.def | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'templates') diff --git a/scripts/bgp/vyatta-bgp.pl b/scripts/bgp/vyatta-bgp.pl index d97a3e69..a91d16e5 100755 --- a/scripts/bgp/vyatta-bgp.pl +++ b/scripts/bgp/vyatta-bgp.pl @@ -1304,7 +1304,8 @@ sub check_for_iBGP_ASN { my $config = new Vyatta::Config; $config->setLevel("protocols bgp $as"); - my @neighbors = $config->listNodes('neighbor'); + #my @neighbors = $config->listNodes('neighbor'); + my @neighbors = $config->listOrigNodes('neighbor'); foreach $neighbor (@neighbors) { my $remoteas = $config->returnValue("neighbor $neighbor remote-as"); if ("$testas" eq "$remoteas") { 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 a5d5b671..52823424 100644 --- a/templates/protocols/bgp/node.tag/parameters/confederation/peers/node.def +++ b/templates/protocols/bgp/node.tag/parameters/confederation/peers/node.def @@ -3,4 +3,4 @@ type: u32 help: Peer ASs in the BGP confederation val_help: u32:1-4294967294; Peer AS number numbers (ex: "435 234") syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 4294967294; "confederation AS id must be between 1 and 4294967294" -commit:expression: exec "/opt/vyatta/sbin/vyatta-bgp.pl --check-for-iBGP-ASN $VAR(@) --as $VAR(../../../@)"; "can't set confederation ASN to $VAR(@). Delete neighbors with remote-as $VAR(@) first." +commit:expression: exec "/opt/vyatta/sbin/vyatta-bgp.pl --check-for-iBGP-ASN $VAR(@) --as $VAR(../../../@)"; "Can't set confederation peers ASN to $VAR(@). Delete any neighbors with remote-as $VAR(@) and/or change the local ASN first." -- cgit v1.2.3 From 3966df08824342315b4e31e3a60224bd6100ece7 Mon Sep 17 00:00:00 2001 From: Robert Bays Date: Fri, 6 Aug 2010 15:50:08 -0700 Subject: fix for bug 5937 --- .../node.tag/address-family/ipv6-unicast/attribute-unchanged/node.def | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'templates') diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/address-family/ipv6-unicast/attribute-unchanged/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/address-family/ipv6-unicast/attribute-unchanged/node.def index fa360913..2678e539 100644 --- a/templates/protocols/bgp/node.tag/neighbor/node.tag/address-family/ipv6-unicast/attribute-unchanged/node.def +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/address-family/ipv6-unicast/attribute-unchanged/node.def @@ -1,2 +1,2 @@ help: Send BGP attributes unchanged -commit:expression: $VAR(../../../../peer-group/) == ""; "you can't set attribute-unchanged for a neighbor in a peer-group" +commit:expression: $VAR(../../../peer-group/) == ""; "you can't set attribute-unchanged for a neighbor in a peer-group" -- cgit v1.2.3 From 5023738b93a104ef33c502c78e2c21b4e61a0e90 Mon Sep 17 00:00:00 2001 From: Robert Bays Date: Fri, 6 Aug 2010 16:43:16 -0700 Subject: larkspur specific fix for 5971 --- .../bgp/node.tag/peer-group/node.tag/.timers/holdtime/node.def | 7 +++++++ .../bgp/node.tag/peer-group/node.tag/.timers/keepalive/node.def | 5 +++++ .../protocols/bgp/node.tag/peer-group/node.tag/.timers/node.def | 5 +++++ .../bgp/node.tag/peer-group/node.tag/timers/holdtime/node.def | 7 ------- .../bgp/node.tag/peer-group/node.tag/timers/keepalive/node.def | 5 ----- .../protocols/bgp/node.tag/peer-group/node.tag/timers/node.def | 5 ----- 6 files changed, 17 insertions(+), 17 deletions(-) create mode 100644 templates/protocols/bgp/node.tag/peer-group/node.tag/.timers/holdtime/node.def create mode 100644 templates/protocols/bgp/node.tag/peer-group/node.tag/.timers/keepalive/node.def create mode 100644 templates/protocols/bgp/node.tag/peer-group/node.tag/.timers/node.def delete mode 100644 templates/protocols/bgp/node.tag/peer-group/node.tag/timers/holdtime/node.def delete mode 100644 templates/protocols/bgp/node.tag/peer-group/node.tag/timers/keepalive/node.def delete mode 100644 templates/protocols/bgp/node.tag/peer-group/node.tag/timers/node.def (limited to 'templates') diff --git a/templates/protocols/bgp/node.tag/peer-group/node.tag/.timers/holdtime/node.def b/templates/protocols/bgp/node.tag/peer-group/node.tag/.timers/holdtime/node.def new file mode 100644 index 00000000..d97fd47a --- /dev/null +++ b/templates/protocols/bgp/node.tag/peer-group/node.tag/.timers/holdtime/node.def @@ -0,0 +1,7 @@ +type: u32 +default: 180 +help: BGP hold timer for this peer-group +val_help: u32:1-65535; Hold timer in seconds +val_help: 0; Disable hold timer + +syntax:expression: $VAR(@) == 0 || ($VAR(@) >= 4 && $VAR(@) <= 65535); "Holdtime interval must be 0 or between 4 and 65535" diff --git a/templates/protocols/bgp/node.tag/peer-group/node.tag/.timers/keepalive/node.def b/templates/protocols/bgp/node.tag/peer-group/node.tag/.timers/keepalive/node.def new file mode 100644 index 00000000..5562c9f8 --- /dev/null +++ b/templates/protocols/bgp/node.tag/peer-group/node.tag/.timers/keepalive/node.def @@ -0,0 +1,5 @@ +type: u32 +default: 60 +help: BGP keepalive interval for this peer-group +val_help: u32:1-65535; Keepalive interval in seconds +syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 65535; "Keepalive interval must be between 1 and 65535" diff --git a/templates/protocols/bgp/node.tag/peer-group/node.tag/.timers/node.def b/templates/protocols/bgp/node.tag/peer-group/node.tag/.timers/node.def new file mode 100644 index 00000000..362c7f15 --- /dev/null +++ b/templates/protocols/bgp/node.tag/peer-group/node.tag/.timers/node.def @@ -0,0 +1,5 @@ +help: Peer-group timers +# TODO: fix this. Can set connect &&|| (keepalive && holdtime) +commit:expression: $VAR(./keepalive/) != ""; "you must set a keepalive interval" +commit:expression: $VAR(./holdtime/) != ""; "you must set a holdtime interval" + diff --git a/templates/protocols/bgp/node.tag/peer-group/node.tag/timers/holdtime/node.def b/templates/protocols/bgp/node.tag/peer-group/node.tag/timers/holdtime/node.def deleted file mode 100644 index d97fd47a..00000000 --- a/templates/protocols/bgp/node.tag/peer-group/node.tag/timers/holdtime/node.def +++ /dev/null @@ -1,7 +0,0 @@ -type: u32 -default: 180 -help: BGP hold timer for this peer-group -val_help: u32:1-65535; Hold timer in seconds -val_help: 0; Disable hold timer - -syntax:expression: $VAR(@) == 0 || ($VAR(@) >= 4 && $VAR(@) <= 65535); "Holdtime interval must be 0 or between 4 and 65535" diff --git a/templates/protocols/bgp/node.tag/peer-group/node.tag/timers/keepalive/node.def b/templates/protocols/bgp/node.tag/peer-group/node.tag/timers/keepalive/node.def deleted file mode 100644 index 5562c9f8..00000000 --- a/templates/protocols/bgp/node.tag/peer-group/node.tag/timers/keepalive/node.def +++ /dev/null @@ -1,5 +0,0 @@ -type: u32 -default: 60 -help: BGP keepalive interval for this peer-group -val_help: u32:1-65535; Keepalive interval in seconds -syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 65535; "Keepalive interval must be between 1 and 65535" diff --git a/templates/protocols/bgp/node.tag/peer-group/node.tag/timers/node.def b/templates/protocols/bgp/node.tag/peer-group/node.tag/timers/node.def deleted file mode 100644 index 362c7f15..00000000 --- a/templates/protocols/bgp/node.tag/peer-group/node.tag/timers/node.def +++ /dev/null @@ -1,5 +0,0 @@ -help: Peer-group timers -# TODO: fix this. Can set connect &&|| (keepalive && holdtime) -commit:expression: $VAR(./keepalive/) != ""; "you must set a keepalive interval" -commit:expression: $VAR(./holdtime/) != ""; "you must set a holdtime interval" - -- cgit v1.2.3 From 57a3d8e42d6ead50cecac01e4f384ec3c84d95b9 Mon Sep 17 00:00:00 2001 From: Robert Bays Date: Tue, 10 Aug 2010 11:12:40 -0700 Subject: rename function to be more descriptive of the actual use --- scripts/bgp/vyatta-bgp.pl | 11 ++++++----- .../bgp/node.tag/parameters/confederation/peers/node.def | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'templates') diff --git a/scripts/bgp/vyatta-bgp.pl b/scripts/bgp/vyatta-bgp.pl index bf289511..7e276231 100755 --- a/scripts/bgp/vyatta-bgp.pl +++ b/scripts/bgp/vyatta-bgp.pl @@ -1138,7 +1138,7 @@ my %qcom = ( ); my ( $pg, $as, $neighbor ); -my ( $main, $peername, $isneighbor, $checkpeergroups, $checksource, $isIBGPpeer, $checkforibgpasn); +my ( $main, $peername, $isneighbor, $checkpeergroups, $checksource, $isIBGPpeer, $confedibgpasn); GetOptions( "peergroup=s" => \$pg, @@ -1149,7 +1149,7 @@ GetOptions( "check-peer-groups" => \$checkpeergroups, "check-source=s" => \$checksource, "is-iBGP" => \$isIBGPpeer, - "check-for-iBGP-ASN=s" => \$checkforibgpasn, + "confed-iBGP-ASN-check=s" => \$confedibgpasn, "main" => \$main, ); @@ -1158,7 +1158,7 @@ check_peergroup_name($peername) if ($peername); check_neighbor_ip($neighbor) if ($isneighbor); check_for_peer_groups( $pg, $as ) if ($checkpeergroups); check_source($checksource) if ($checksource); -check_for_iBGP_ASN($as, $checkforibgpasn) if ($checkforibgpasn); +confed_iBGP_ASN($as, $confedibgpasn) if ($confedibgpasn); is_IBGP_peer($neighbor, $as) if ($isIBGPpeer); @@ -1296,8 +1296,9 @@ sub check_remote_as { } -# check to see if this ASN will make a peer an iBGP peer -sub check_for_iBGP_ASN { +# check to see if adding this ASN to confederations +# will make a peer an iBGP peer +sub confed_iBGP_ASN { my ($as, $testas) = @_; if ("$as" eq "$testas") { exit 1 ; } 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 52823424..e806b5d7 100644 --- a/templates/protocols/bgp/node.tag/parameters/confederation/peers/node.def +++ b/templates/protocols/bgp/node.tag/parameters/confederation/peers/node.def @@ -3,4 +3,4 @@ type: u32 help: Peer ASs in the BGP confederation val_help: u32:1-4294967294; Peer AS number numbers (ex: "435 234") syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 4294967294; "confederation AS id must be between 1 and 4294967294" -commit:expression: exec "/opt/vyatta/sbin/vyatta-bgp.pl --check-for-iBGP-ASN $VAR(@) --as $VAR(../../../@)"; "Can't set confederation peers ASN to $VAR(@). Delete any neighbors with remote-as $VAR(@) and/or change the local ASN first." +commit:expression: exec "/opt/vyatta/sbin/vyatta-bgp.pl --confed-iBGP-ASN-check $VAR(@) --as $VAR(../../../@)"; "Can't set confederation peers ASN to $VAR(@). Delete any neighbors with remote-as $VAR(@) and/or change the local ASN first." -- cgit v1.2.3 From 21858a3f00d9fcbdd4d6f627f28bb139c76ab82f Mon Sep 17 00:00:00 2001 From: Robert Bays Date: Tue, 10 Aug 2010 17:46:01 -0700 Subject: fix for bug 4393 --- .../bgp/node.tag/neighbor/node.tag/distribute-list/export/node.def | 1 + .../bgp/node.tag/neighbor/node.tag/distribute-list/import/node.def | 1 + .../bgp/node.tag/neighbor/node.tag/prefix-list/export/node.def | 1 + .../bgp/node.tag/neighbor/node.tag/prefix-list/import/node.def | 2 +- 4 files changed, 4 insertions(+), 1 deletion(-) (limited to 'templates') diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/distribute-list/export/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/distribute-list/export/node.def index 6e1360a5..d2c3a492 100644 --- a/templates/protocols/bgp/node.tag/neighbor/node.tag/distribute-list/export/node.def +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/distribute-list/export/node.def @@ -8,3 +8,4 @@ allowed: local -a params echo -n ${params[@]##*/} commit:expression: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --exists \"policy access-list $VAR(@)\" "; "access-list $VAR(@) doesn't exist" commit:expression: $VAR(../../prefix-list/export/) == ""; "you can't set both a prefix-list and a distribute list" +commit:expression: $VAR(../../peer-group/) == ""; "distribute-lists can't be set for members of a peer-group" diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/distribute-list/import/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/distribute-list/import/node.def index 05c38e66..41faaf35 100644 --- a/templates/protocols/bgp/node.tag/neighbor/node.tag/distribute-list/import/node.def +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/distribute-list/import/node.def @@ -8,3 +8,4 @@ allowed: local -a params echo -n ${params[@]##*/} commit:expression: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --exists \"policy access-list $VAR(@)\" "; "access-list $VAR(@) doesn't exist" commit:expression: $VAR(../../prefix-list/import/) == ""; "you can't set both a prefix-list and a distribute list" +commit:expression: $VAR(../../peer-group/) == ""; "distribute-lists can't be set for members of a peer-group" diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/prefix-list/export/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/prefix-list/export/node.def index 8e84af9d..cd084876 100644 --- a/templates/protocols/bgp/node.tag/neighbor/node.tag/prefix-list/export/node.def +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/prefix-list/export/node.def @@ -4,4 +4,5 @@ allowed: local -a params params=$( /opt/vyatta/sbin/vyatta-policy.pl --list-policy prefix-list ) echo -n ${params[@]##*/} commit:expression: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --exists \"policy prefix-list $VAR(@)\" "; "prefix-list $VAR(@) doesn't exist" +commit:expression: $VAR(../../peer-group/) == ""; "prefix-lists can't be set for members of a peer-group" commit:expression: $VAR(../../distribute-list/export/) == ""; "you can't set both a prefix-list and a distribute list" diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/prefix-list/import/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/prefix-list/import/node.def index baa56b2e..5fc93a3a 100644 --- a/templates/protocols/bgp/node.tag/neighbor/node.tag/prefix-list/import/node.def +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/prefix-list/import/node.def @@ -4,5 +4,5 @@ allowed: local -a params params=$( /opt/vyatta/sbin/vyatta-policy.pl --list-policy prefix-list ) echo -n ${params[@]##*/} commit:expression: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --exists \"policy prefix-list $VAR(@)\" "; "prefix-list $VAR(@) doesn't exist" +commit:expression: $VAR(../../peer-group/) == ""; "prefix-lists can't be set for members of a peer-group" commit:expression: $VAR(../../distribute-list/import/) == ""; "you can't set both a prefix-list and a distribute list" - -- cgit v1.2.3 From 8e1d84ff4bba498f362e59770fe8b03bb1275c7c Mon Sep 17 00:00:00 2001 From: Robert Bays Date: Thu, 12 Aug 2010 18:30:59 -0700 Subject: fix for bug 6049 --- .../protocols/bgp/node.tag/parameters/confederation/peers/node.def | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'templates') 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 e806b5d7..7e165489 100644 --- a/templates/protocols/bgp/node.tag/parameters/confederation/peers/node.def +++ b/templates/protocols/bgp/node.tag/parameters/confederation/peers/node.def @@ -1,6 +1,6 @@ multi: type: u32 help: Peer ASs in the BGP confederation -val_help: u32:1-4294967294; Peer AS number numbers (ex: "435 234") +val_help: u32:1-4294967294; Peer AS number syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 4294967294; "confederation AS id must be between 1 and 4294967294" commit:expression: exec "/opt/vyatta/sbin/vyatta-bgp.pl --confed-iBGP-ASN-check $VAR(@) --as $VAR(../../../@)"; "Can't set confederation peers ASN to $VAR(@). Delete any neighbors with remote-as $VAR(@) and/or change the local ASN first." -- cgit v1.2.3