diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/bgp/vyatta-bgp.pl | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/scripts/bgp/vyatta-bgp.pl b/scripts/bgp/vyatta-bgp.pl index 4f4ac40e..d10a37af 100755 --- a/scripts/bgp/vyatta-bgp.pl +++ b/scripts/bgp/vyatta-bgp.pl @@ -1072,7 +1072,7 @@ my %qcom = ( my $qconfig = new Vyatta::Quagga::Config('protocols', \%qcom); my ( $pg, $as, $neighbor ); -my ( $main, $peername, $isneighbor, $checkpeergroups, $checksource, $isiBGPpeer, $wasiBGPpeer, $confedibgpasn); +my ( $main, $peername, $isneighbor, $checkpeergroups, $checksource, $isiBGPpeer, $wasiBGPpeer, $confedibgpasn, $listpeergroups); GetOptions( "peergroup=s" => \$pg, @@ -1085,6 +1085,7 @@ GetOptions( "is-iBGP" => \$isiBGPpeer, "was-iBGP" => \$wasiBGPpeer, "confed-iBGP-ASN-check=s" => \$confedibgpasn, + "list-peer-groups" => \$listpeergroups, "main" => \$main, ); @@ -1096,10 +1097,20 @@ check_source($checksource) if ($checksource); confed_iBGP_ASN($as, $confedibgpasn) if ($confedibgpasn); is_iBGP_peer($neighbor, $as) if ($isiBGPpeer); was_iBGP_peer($neighbor, $as) if ($wasiBGPpeer); - +list_peer_groups($as) if ($listpeergroups); exit 0; +sub list_peer_groups { + my $as = shift; + my $config = new Vyatta::Config; + + $config->setLevel("protocols bgp $as peer-group"); + my @nodes = $config->listNodes(); + foreach my $node (@nodes) { print "$node "; } + return; +} + # Make sure the peer IP isn't a local system IP sub check_neighbor_ip { my $neighbor = shift; |