Net::ACL::RouteMapRule - Class representing a BGP-4 policy route-map rule
use Net::ACL::RouteMapRule; # Constructor $rule = new Net::ACL::RouteMapRule( Action => ACL_PERMIT, Match => { ASPath => [ 'my-as-path-list' ], Community => [ 'my-community-list' ], Prefix => [ 'my-prefix-list' ], Next_hop => [ 'my-access-list' ], Routesource => [ 'my-access-list' ], MED => 20, Local_Pref => 200, Origin => IGP }, Set => { ASPath => [ 65001, 65001 ], # Prepend Community => [ qw( 65001:100 65001:200 ) ], Next_hop => '10.0.0.1', Local_Pref => 200, MED => 50, Origin => EGP, Weight => 42 } ); # Accessor Methods ($rc,$nlri) = $rule->query($prefix, $nlri); $rc = $rule->match($prefix, $nlri);
This module represents a single route-map clause with a match part, a set part and an action. This object is used by the Net::ACL::RouteMap object. It inherits from Net::ACL::Rule, with the only changed method being the autoconstructor() method.
The method is inherited from the Net::ACL::Rule object. But since the autoconstruction() method has been replaced, some extra named arguments below Match and Set are understood:
When used in Match, the ASPath named argument should be a name of an ASPath access-lists.
When used in Set, it should be the AS numbers that should be prepended. They may be specified in anyway that the Net::BGP:ASPath->new() constructor allows them.
When used in Match, the Community named argument should be a community-list.
When used in Set, it should be a list of communities to set.
The Prefix named argument can only be used under Match. It's value should be a list of Net::ACL prefix-list names.
When used under Match, its value should be a list of names of access-lists.
When used under Set, its value should be an IP address.
The Routesource named argument can only be used under Match. It's value should be a list of Net::ACL access-list names.
The Origin named argument should have a value of either IGP, EGP or INCOMPLETE, as exported by Net::BGP::NLRI :origin.
:origin
The Local_Pref, MED and Weight named argument should have values of integers.
Weight can only be used in Set.
The query() and match() methods take a Net::BGP::NLRI object as first argument and a prefix as second, but does and return the same as the match() and query() methods of the Net::ACL::Rule object.
Net::ACL, Net::ACL::Rule, Net::ACL::RouteMap, Net::BGP, Net::BGP::NLRI, Net::BGP::Router
Martin Lorensen <bgp@martin.lorensen.dk>
To install Net::ACL, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::ACL
CPAN shell
perl -MCPAN -e shell install Net::ACL
For more information on module installation, please visit the detailed CPAN module installation guide.