NAME

Net::BGP::Router - A BGP Router based on Net::BGP

SYNOPSIS

    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);

DESCRIPTION

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.

CONSTRUCTOR

new() - create a new Net::BGP::Router 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:

Name

This is the name of the router or router-context. This is for informational use only.

Policy

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.

ACCESSOR METHODS

add_peer()

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.

remove_peer()

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.

set_policy()

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.

SEE ALSO

Net::BGP, Net::BGP::RIB, Net::BGP::Policy, Net::ACL

AUTHOR

Martin Lorensen <bgp@martin.lorensen.dk>