Net::BGP::Policy - Class representing a Global BGP Routing Policy
use Net::BGP::Policy; # Constructor $policy = new Net::BGP::Policy(); # Accessor Methods $policy->set($peer, 'in', $acl); $policy->delete($peer,'out'); $nlri_array_ref = $policy->in($prefix, { $peer => $nlri, ... } ); $out_hash_ref = $policy->out($prefix, $nlri );
This module implement a class representing a global BGP Routing Policy. It does so using Net::ACL route-maps.
$policy = new Net::BGP::Policy();
This is the constructor for Net::BGP::Policy object. It returns a reference to the newly created object. It ignores all arguments.
This method is used to configure a policy for a peer in a direction. It takes two or three arguments. The first is the peer, the second is the direction (in or out). The third is the policy which should be a Net::ACL route-map (or an object inherited from Net::ACL). The rules of the route-map should be like Net::ACL::RouteMapRule objects. If the third parameter is undefined, no policy will be used for the peer. If the third parameter is not pressent, the peer will not get updates.
in
out
This method is used to remove a peer from the policy in a direction. It takes two arguments. The first is the peer, the second is the direction (in or out).
The in() method executes the policy for incomming updates. The first argument is the prefix, the second should be an hash reference. The hash reference is indexed on peers with values of NLRI objects avaible from that peer.
The method returns a list of NLRIs.
The out() method executes the policy for outgoing updates. The first argument is the prefix, the second is the NLRI object.
The method returns a reference to a hash of NLRIs indexed on peers.
Net::BGP, Net::BGP::RIB, Net::BGP::NLRI, Net::BGP::Router, Net::ACL
Martin Lorensen <bgp@martin.lorensen.dk>
To install Net::BGP::Router, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::BGP::Router
CPAN shell
perl -MCPAN -e shell install Net::BGP::Router
For more information on module installation, please visit the detailed CPAN module installation guide.