Net::BGP::Router - A BGP Router based on Net::BGP
use Net::BGP::Router; # Constructor $router = new Net::BGP::Router( Name => 'My very own router!', Policy => new Net::BGP::Policy ); # Accessor Methods $router->add_peer($peer,'both',$acl); $router->remove_peer($peer,'both'); $router->set_policy($policy); $router->set_policy($peer,'in',$acl);
This module implement a BGP router. It uses Net::BGP objects for the BGP sessions and a Net::BGP::RIB object to store the routes. Policy are handled using a Net::BGP::Policy object.
$router = new Net::BGP::Router( Name => 'My very own router!', Policy => new Net::BGP::Policy );
This is the constructor for Net::BGP::Router object. It returns a reference to the newly created object. The following named parameters may be passed to the constructor:
This is the name of the router or router-context. This is for informational use only.
This is the Net::BGP::Policy object used as policy. If not specified, no policy will be used. Note that the Policy method set() will be issued on every add_peer() and remove_peer(). Therefor there is no reason to do this manualy before adding the peers.
This method adds a peer to the router. The first argument is the peer object. The second argument is the direction of the peer. A peer can either only contribute with updates in, only recieve updates out, or both both. The third argument is optitional and is a peer/direction-specific policy as a Net::ACL object.
in
out
both
This medhod removes a peer from the router. The first argument is the peer object. The second argument is the direction in which the peer should be removed.
This medhod can either change the global policy or the policy for a peer in some direction. The first argument is the policy object. If the policy object is a Net::BGP::Policy object, it will be used as a new global policy. If it is a Net::ACL object, it will be used as a peer policy for the peer object and diraction specified as second and third argument.
Net::BGP, Net::BGP::RIB, Net::BGP::Policy, 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.