BGPLGD(8)

✨ bgplgd(8) ✨

okay bestie, welcome to the system manager's manual for bgplgd πŸ’–


NAME

bgplgd β€” it's a FastCGI server for bgpctl. that's the whole vibe. πŸ¦‹


SYNOPSIS

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

DESCRIPTION

so bgplgd is a server that implements the FastCGI Protocol so it can run bgpctl(8) commands for you πŸ’… it's a simple server, and it implements a simple web API to query bgpd(8). no cap.

here's the glow-up sequence: bgplgd opens a socket at /run/bgplgd.sock, owned by www-data, with permissions 0660. then it drops privileges to user "_bgplgd", calls unveil(2) on the bgpctl(8) binary, and restricts itself with pledge(2). self-care, but make it security πŸ”’βœ¨

the options are as follows:

  • -d β€” do NOT daemonize, bestie. if you pass this, bgplgd runs in the foreground and logs to stderr. main character energy, staying right there where you can see it πŸ‘€
  • -p path β€” use path instead of bgpctl(8) to query bgpd(8). swap the tool, keep the vibes.
  • -S socket β€” use socket instead of the default /run/openbgpd/bgpd.rsock to talk to bgpd(8). different socket, same energy πŸ”Œ
  • -s socket β€” create and bind to an alternative local socket at socket. your socket, your rules πŸ’…
  • -U user β€” change the owner of /run/bgplgd.sock to user and its primary group, instead of the default www-data. glow-up the ownership fr fr πŸ‘‘
  • -V β€” show the version and exit. short, sweet, iconic.

🌸 the API endpoints 🌸

bgplgd provides the following API endpoints. unless it says otherwise, the endpoints don't take any parameters. simple like that ✨

  • /interfaces β€” show the interface states.
  • /memory β€” show RIB memory statistics.
  • /metrics β€” output various statistics in OpenMetrics format.
  • /neighbors β€” show detailed neighbors information. you can limit the output with these parameters:
    • neighbor=peer β€” show information for a specific neighbor. peer can be the neighbor's address or description.
    • group=name β€” show only entries from the specified peer group.
  • /nexthops β€” show the list of BGP nexthops and the result of their validity check.
  • /rib
  • /rib/in
  • /rib/out β€” show routes from the bgpd(8) Routing Information Base. for /rib/in the Adj-RIB-In gets queried, and for /rib/out it's the Adj-RIB-out. you can filter the output with these parameters:
    • neighbor=peer β€” show information for a specific neighbor. peer can be the neighbor's address or description.
    • group=name β€” show only entries from the specified peer group.
    • as=number β€” show only entries with the specified source AS number.
    • community=string
    • ext-community=string
    • large-community=string β€” show only entries that match the specified community.
    • af=(ipv4 | ipv6 | vpnv4 | vpnv6) β€” show only entries that match the specified address family.
    • rib=name β€” show only entries from the RIB with name name. can only be used with the /rib endpoint. iykyk.
    • ovs=(valid | not-found | invalid) β€” show only prefixes that match the specified Origin Validation State.
    • avs=(valid | invalid | unknown) β€” show only prefixes that match the specified ASPA Validation State.
    • best=1 β€” show only selected routes.
    • error=1 β€” show only prefixes which are marked invalid and were treated as withdrawn.
    • filtered=1 β€” show only prefixes which are marked filtered by the input filter.
    • invalid=1 β€” show only prefixes which are not eligible.
    • leaked=1 β€” show only prefixes where a route leak was detected. πŸ’€
    • prefix=addr β€” show only entries that match prefix, either as the best matching route or show the entry for this CIDR prefix.
    • all=1 β€” show all entries in the specified prefix range.
    • or-shorter=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 info about the session state and message counters.

EXAMPLES

bestie, drop this into /etc/bgpd.conf so bgpd(8) opens a second, restricted, control socket:

socket "/run/openbgpd/bgpd.rsock" restricted

and here's an example setup in httpd(8):

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

SEE ALSO

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


HISTORY

the bgplgd server first appeared in OpenBSD 7.2. a legend was born πŸŽ€


AUTHORS

Claudio Jeker <claudio@openbsd.org> 🫢


okay that's the whole page, you ate that πŸ’… go forth and query your BGP fr fr

this was the Debian build, dated July 13, 2025 β€” mwah, love u, bye βœ¨πŸ’–

πŸ“¦ where this page comes from