DOKK / manpages / debian 12 / openbgpd / bgplgd.8.en
BGPLGD(8) System Manager's Manual BGPLGD(8)

bgplgda bgpctl FastCGI server

bgplgd [-d] [-p path] [-S socket] [-s socket] [-U user]

bgplgd is a server which implements the FastCGI Protocol to execute bgpctl(8) commands. bgplgd is a simple server that implements a simple web API to query bgpd(8).

bgplgd opens a socket at /run/bgplgd.sock, owned by www-data:www-data, with permissions 0660. It will then drop privileges to user "_bgplgd", unveil(2) the bgpctl(8) binary and restrict itself with pledge(2).

The options are as follows:

Do not daemonize. If this option is specified, bgplgd will run in the foreground and log to stderr.
path
Use path instead of bgpctl(8) to query bgpd(8).
socket
Use socket instead of the default /run/openbgpd/bgpd.sock to communicate with bgpd(8).
socket
Create and bind to alternative local socket at socket.
user
Change the owner of /run/bgplgd.sock to user and its primary group instead of the default www:www.

bgplgd provides the following API endpoints. Unless further specified the endpoints do not take any parameters:

/interfaces
Show the interface states.
/memory
Show RIB memory statistics.
/neighbors
Show detailed neighbors information. The output can be limited with the following parameters:

=peer
Show information for a specific neighbor. peer may be the neighbor's address or description.
=name
Show only entries from the specified peer group.
/nexthops
Show the list of BGP nexthops and the result of their validity check.
/rib
Show routes from the bgpd(8) Routing Information Base. The following parameters can be used to filter the output:

=peer
Show information for a specific neighbor. peer may be the neighbor's address or description.
=name
Show only entries from the specified peer group.
=number
Show only entries with the specified source AS number.
=string
 
=string
 
=string
Show only entries that match the specified community.
=(ipv4 | ipv6 | vpnv4 | vpnv6)
Show only entries that match the specified address family.
=name
Show only entries from the RIB with name name.
=(valid | not-found | invalid)
Show only prefixes that match the specified Origin Validation State.
=1
Show only selected routes.
=1
Show only prefixes which are marked invalid and were treated as withdrawn.
=addr
Show only entries that match prefix either as the best matching route or show the entry for this CIDR prefix.
=1
Show all entries in the specified prefix range.
=1
Show all entries covering and including the specified prefix.
/rtr
Show a list of all RTR sessions.
/sets
Show a list summarizing all roa-set, as-set, prefix-set, and origin-set tables.
/summary
Show a list of all neighbors, including information about the session state and message counters.

An example setup in httpd(8) is:

        location "/bgplgd/*" {
                fastcgi socket "/run/bgplgd.sock"
                request strip 1
        }

bgpctl(8), bgpd(8), httpd(8)

The bgplgd server first appeared in OpenBSD 7.2.

Claudio Jeker <claudio@openbsd.org>

July 17, 2022 Debian