|
|
| |
Net::ACL::RouteMapRule(3) |
User Contributed Perl Documentation |
Net::ACL::RouteMapRule(3) |
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.
- new() - create a new Net::ACL::RouteMapRule object
- 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:
- ASPath
- 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.
- Community
- 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.
- Prefix
- The Prefix named argument can only be used under Match. It's value should
be a list of Net::ACL prefix-list names.
- Next_hop
- 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.
- Routesource
- The Routesource named argument can only be used under Match. It's value
should be a list of Net::ACL access-list names.
- Origin
- The Origin named argument should have a value of either IGP, EGP or
INCOMPLETE, as exported by Net::BGP::NLRI
":origin".
- Local_Pref
- MED
- Weight
- The Local_Pref, MED and Weight named argument should have values of
integers.
Weight can only be used in Set.
- query()
- match()
- 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>
Visit the GSP FreeBSD Man Page Interface. Output converted with ManDoc. |