Speaker
NAME
SYNOPSIS
use Net::BGP::Speaker;
$speaker = Net::BGP::Speaker.new(
allow-unknown-peers => False,
asn-filter => 65000,
cidr-filter => "10.0.0.0/16,192.168.0.0/16",
colored => True,
)
TYPES
our subset Asn of Int:D where ^2³²
Defines a subset covering legal ASN numbers.
our subset Port of Int:D where ^2¹⁶
Defines a subset covering legal TCP/IP port numbers.
ATTRIBUTES
allow-unwanted-peers
Allow unknown peers to be able to connect without having been pre-configured.
colored
Note that this attribute can't be set directly except at construction time, however it can be changed via a helper method:
say "Colored!" if $speaker.colored;
$speaker.colored(True); # Make colored
If this is set to true, log messages will be displayed using ANSI-compatible colored text.
communities
A list of communities to use when advertising routes. Communities are specified in string form (I.E. "65000:1000").
display
This is a Net::BGP::Speaker::Display object. It's intended to be created during object construction, but it can be overriden by a subclass of this object during construction.
listen-host
The host to listen on for BGP connections on (defaults to 0.0.0.0
). This
is a string.
listen-port
The port number to listen for BGP connections on (defaults to 179
).
my-asn
Our Autonymous System Number.
my-domain
Domain name of local system, to be sent in FQDN capability during OPEN. Can be undefined, which will result in Net::BGP attempting to guess the domain name.
my-hostname
Hostname of local system, to be sent in FQDN capability during OPEN. Can be undefined, which will result in Net::BGP attempting to guess the host name.
my-asn
Our Autonymous System Number.
wanted-asn
A list of Asn
objects that we are interested in observing.
This can also be set by passing the constructor a comma-seperated string
of ASNs the :asn-filter pseudo-attribute.
wanted-cidr
A list of Net::BGP::CIDR objects that we are interested in observing. This can also be set by passing the constructor a comma-seperated string of CIDRs as the :cidr-filter pseudo-attribute.
METHODS
peer-add
$bgp.peer-add(
:peer-asn(65001),
:peer-ip("192.0.2.1"),
:peer-port(179),
:passive(False),
:ipv4(True),
:ipv6(False),
:md5($key),
);
Add a new peer to the BGP server.
Provide the peer information (peer-asn
, peer-ip
, and peer-port
),
along with whether this should be a passive
session, whether the
ipv4
and ipv6
address families should be negotiated, and, if necessary,
an md5
key.
AUTHOR
Joelle Maslak <[email protected]>
COPYRIGHT AND LICENSE
Copyright © 2018-2019 Joelle Maslak
This library is free software; you can redistribute it and/or modify it under the Artisitic License 2.0.