OpenBSD manual page server

Manual Page Search Parameters

BGPCTL(8) System Manager's Manual BGPCTL(8)

bgpctlcontrol the Border Gateway Protocol daemon

bgpctl [-n] [-s socket] command [argument ...]

The bgpctl program controls the bgpd(8) daemon. Commands may be abbreviated to the minimum unambiguous prefix; for example, s s for show summary.

The options are as follows:

Show neighbors' IP addresses instead of their description.
socket
Use socket instead of the default /var/run/bgpd.sock to communicate with bgpd(8).

The commands are as follows:

[table number] couple
Insert the learned routes into the specified Forwarding Information Base a.k.a. the kernel routing table.
[table number] decouple
Remove the learned routes from the specified Forwarding Information Base a.k.a. the kernel routing table.
[options] as [arguments]
Get the object from the and generate bgpd filters from the policy specified therein. The aut-num object as well as the associated as-set and route objects have to be in RPSL format.

The options are as follows:

directory
Use directory to write the filter files to.
Fetch only IPv4 prefixes from the registry.
Fetch only IPv6 prefixes from the registry.
Disable verbose debug logging.
Enable verbose debug logging.
peer clear
Stop and restart the BGP session to the specified neighbor. peer may be the neighbor's address or description.
peer destroy
Destroy a previously cloned peer. The peer must be down before calling this function. peer may be the neighbor's address or description.
peer down
Take the BGP session to the specified neighbor down. peer may be the neighbor's address or description.
peer refresh
Request the neighbor to re-send all routes. Note that the neighbor is not obliged to re-send all routes, or any routes at all, even if it announced the route refresh capability. peer may be the neighbor's address or description.
peer up
Take the BGP session to the specified neighbor up. peer may be the neighbor's address or description.
prefix [arguments]
Add the specified prefix to the list of announced networks. It is possible to set various path attributes with additional arguments.
[arguments] [add]
Bulk add specified prefixes to the list of announced networks. Prefixes should be sent via stdin. It is possible to set various path attributes with additional arguments. If neither add or delete is given, add is the default.
Bulk remove the specified prefixes from the list of announced networks. Prefixes should be sent via stdin.
prefix
Remove the specified prefix from the list of announced networks.
Remove all dynamically added prefixes from the list of announced networks.
file filter
Import networks from an MRT table dump for debugging purposes. filter can be specified similarly to the show mrt command. Only networks matching the filter will be imported.
family
Show all announced networks. family, if given, limits the output to the given address family. The supported families are inet and inet6.
Reload the configuration file.
filter
Show routes from bgpd(8)'s view of the Forwarding Information Base. filter can be an IP address, in which case the route to this address is shown, or a flag:

Show only connected routes.
Show only static routes.
Show only routes originating from bgpd(8) itself.
Show only routes required to reach a BGP nexthop.
Show only IPv4 routes.
Show only IPv6 routes.
number
Show the routing table with ID number instead of the default routing table with ID 0.
Show the interface states.
[options] filter
Show routes from an MRT table dump file. filter can be an IP address, a CIDR prefix, an AS filter, a combination or nothing:

address
Show best matching route for address.
address/len
Show RIB entry for this CIDR prefix.
address/len all
Show all entries in the specified range.
as
Show all entries with as anywhere in the AS path.
Show all entries that are internal routes with no AS's in the AS path.
ip
Show only entries from the specified peer.
as
Show all entries with as as leftmost AS.
as
Show all entries with as as rightmost AS.
as
Show all entries with as anywhere but rightmost.

Additionally, the following options are defined:

Show more detailed output for matching routes.
family
Limit the output to the given address family.
name
Read the MRT dump from file name instead of using stdin.

Multiple options and filters can be used at the same time.

Show a list of all neighbors, including information about the session state and message counters.
Show a list of all neighbors, including information about the session state, in a terse format.
peer modifier
Show detailed information about the neighbor identified by peer, which may be the neighbor's address or description, according to the given modifier:

Show statistics about sent and received BGP messages.
Show statistics in an easily parseable terse format. The printed numbers are the sent and received open, sent and received notifications, sent and received updates, sent and received keepalives, and sent and received route refresh messages plus the current and maximum prefix count, the number of sent and received updates, and withdraws.
Show the BGP timers.
Show the list of BGP nexthops and the result of their validity check.
[options] filter
Show routes from the bgpd(8) Routing Information Base. filter can be an IP address, a CIDR prefix, an AS filter or nothing:

address
Show best matching route for address.
address/len
Show RIB entry for this CIDR prefix.
address/len all
Show all entries in the specified range.
as
Show all entries with as anywhere in the AS path.
community
Show all entries with community community.
Show all entries that are internal routes with no AS's in the AS path.
Show RIB memory statistics.
peer
Show only entries from the specified peer.
as
Show all entries with as as leftmost AS.
as
Show all entries with as as rightmost AS.
This is the same as the show summary command.
rib
Show only entries from the specified RIB table.
as
Show all entries with as anywhere but rightmost.

Additionally, the following options are defined:

Show only selected routes.
Show more detailed output for matching routes.
family
Limit the output to the given address family.
Show routes from the unfiltered Adj-RIB-In. This is only possible if is enabled for the neighbor.
Show the filtered routes sent to a neighbor also known as Adj-RIB-Out.

Options are silently ignored when used together with summary or memory. Multiple options can be used at the same time and the neighbor filter can be combined with other filters.

Show a list of all neighbors, including information about the session state and message counters.
Show a list of all neighbors, including information about the session state, in a terse format.
Show a list of all currently loaded fib routing tables.

/etc/bgpd.conf
default bgpd(8) configuration file
/var/run/bgpd.sock
default bgpd(8) control socket

bgpd.conf(5), bgpd(8), bgplg(8), bgplgsh(8)

C. Alaettinoglu, C. Villamizar, E. Gerich, D. Kessens, D. Meyer, T. Bates, D. Karrenberg, and M. Terpstra, Routing Policy Specification Language (RPSL), RFC 2622, June 1999.

The bgpctl program first appeared in OpenBSD 3.5. irrfilter mode was added in OpenBSD 4.1.

October 9, 2013 OpenBSD-5.5