1*67a9111eSjob.\" $OpenBSD: bgplgd.8,v 1.8 2024/01/26 18:11:49 job Exp $ 2e76e7180Sclaudio.\" 3e76e7180Sclaudio.\" Copyright (c) 2021 Claudio Jeker <claudio@openbsd.org> 4e76e7180Sclaudio.\" 5e76e7180Sclaudio.\" Permission to use, copy, modify, and distribute this software for any 6e76e7180Sclaudio.\" purpose with or without fee is hereby granted, provided that the above 7e76e7180Sclaudio.\" copyright notice and this permission notice appear in all copies. 8e76e7180Sclaudio.\" 9e76e7180Sclaudio.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10e76e7180Sclaudio.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11e76e7180Sclaudio.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12e76e7180Sclaudio.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13e76e7180Sclaudio.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14e76e7180Sclaudio.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15e76e7180Sclaudio.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16e76e7180Sclaudio.\" 17*67a9111eSjob.Dd $Mdocdate: January 26 2024 $ 18e76e7180Sclaudio.Dt BGPLGD 8 19e76e7180Sclaudio.Os 20e76e7180Sclaudio.Sh NAME 21e76e7180Sclaudio.Nm bgplgd 22e76e7180Sclaudio.Nd a bgpctl FastCGI server 23e76e7180Sclaudio.Sh SYNOPSIS 24e76e7180Sclaudio.Nm 25e76e7180Sclaudio.Op Fl d 26e76e7180Sclaudio.Op Fl p Ar path 27e76e7180Sclaudio.Op Fl S Ar socket 28e76e7180Sclaudio.Op Fl s Ar socket 29e76e7180Sclaudio.Op Fl U Ar user 30*67a9111eSjob.Op Fl V 31e76e7180Sclaudio.Sh DESCRIPTION 32e76e7180Sclaudio.Nm 33e76e7180Sclaudiois a server which implements the FastCGI Protocol to execute 34e76e7180Sclaudio.Xr bgpctl 8 35e76e7180Sclaudiocommands. 36e76e7180Sclaudio.Nm 37e76e7180Sclaudiois a simple server that implements a simple web API to query 38e76e7180Sclaudio.Xr bgpd 8 . 39e76e7180Sclaudio.Pp 40e76e7180Sclaudio.Nm 41e76e7180Sclaudioopens a socket at 42e76e7180Sclaudio.Pa /var/www/run/bgplgd.sock , 43e76e7180Sclaudioowned by www:www, 44e76e7180Sclaudiowith permissions 0660. 45760a8f95SclaudioIt will then drop privileges to user 46760a8f95Sclaudio.Qq _bgplgd , 47e76e7180Sclaudio.Xr unveil 2 48e76e7180Sclaudiothe 49e76e7180Sclaudio.Xr bgpctl 8 50e76e7180Sclaudiobinary 51e76e7180Sclaudioand restrict itself with 52e76e7180Sclaudio.Xr pledge 2 . 53e76e7180Sclaudio.Pp 54e76e7180SclaudioThe options are as follows: 55e76e7180Sclaudio.Bl -tag -width Ds 56e76e7180Sclaudio.It Fl d 57e76e7180SclaudioDo not daemonize. 58e76e7180SclaudioIf this option is specified, 59e76e7180Sclaudio.Nm 60e76e7180Sclaudiowill run in the foreground and log to stderr. 61e76e7180Sclaudio.It Fl p Ar path 62e76e7180SclaudioUse 63e76e7180Sclaudio.Ar path 64e76e7180Sclaudioinstead of 65e76e7180Sclaudio.Xr bgpctl 8 66e76e7180Sclaudioto query 67e76e7180Sclaudio.Xr bgpd 8 . 68e76e7180Sclaudio.It Fl S Ar socket 69e76e7180SclaudioUse 70e76e7180Sclaudio.Ar socket 71e76e7180Sclaudioinstead of the default 72e76e7180Sclaudio.Pa /var/run/bgpd.rsock 73e76e7180Sclaudioto communicate with 74e76e7180Sclaudio.Xr bgpd 8 . 75e76e7180Sclaudio.It Fl s Ar socket 76e76e7180SclaudioCreate and bind to alternative local socket at 77e76e7180Sclaudio.Ar socket . 78e76e7180Sclaudio.It Fl U Ar user 79e76e7180SclaudioChange the owner of 80e76e7180Sclaudio.Pa /var/www/run/bgplgd.sock 81e76e7180Sclaudioto 82e76e7180Sclaudio.Ar user 83e76e7180Sclaudioand its primary group instead of the default www:www. 84*67a9111eSjob.It Fl V 85*67a9111eSjobShow the version and exit. 86e76e7180Sclaudio.El 87e76e7180Sclaudio.Pp 88e76e7180Sclaudio.Nm 89e76e7180Sclaudioprovides the following API endpoints. 90e76e7180SclaudioUnless further specified the endpoints do not take any parameters: 91e76e7180Sclaudio.Bl -tag -width Ds 92e76e7180Sclaudio.It Pa /interfaces 93e76e7180SclaudioShow the interface states. 94e76e7180Sclaudio.It Pa /memory 95e76e7180SclaudioShow RIB memory statistics. 96fe299990Sclaudio.It Pa /metrics 97fe299990SclaudioOutput various statistics in OpenMetrics format. 98e76e7180Sclaudio.It Pa /neighbors 99e76e7180SclaudioShow detailed neighbors information. 100e76e7180SclaudioThe output can be limited with the following parameters: 101e76e7180Sclaudio.Pp 102e76e7180Sclaudio.Bl -tag -width "neighbor=peer" -compact 103e76e7180Sclaudio.It Cm neighbor Ns = Ns Ar peer 1047e354e24SjsgShow information for a specific neighbor. 105e76e7180Sclaudio.Ar peer 106e76e7180Sclaudiomay be the neighbor's address or description. 107e76e7180Sclaudio.It Cm group Ns = Ns Ar name 108e76e7180SclaudioShow only entries from the specified peer group. 109e76e7180Sclaudio.El 110e76e7180Sclaudio.It Pa /nexthops 111e76e7180SclaudioShow the list of BGP nexthops and the result of their validity check. 112e76e7180Sclaudio.It Pa /rib 113e76e7180SclaudioShow routes from the bgpd(8) Routing Information Base. 114e76e7180SclaudioThe following parameters can be used to filter the output: 115e76e7180Sclaudio.Pp 116e76e7180Sclaudio.Bl -tag -width "neighbor=peer" -compact 117e76e7180Sclaudio.It Cm neighbor Ns = Ns Ar peer 1187e354e24SjsgShow information for a specific neighbor. 119e76e7180Sclaudio.Ar peer 120e76e7180Sclaudiomay be the neighbor's address or description. 121e76e7180Sclaudio.It Cm group Ns = Ns Ar name 122e76e7180SclaudioShow only entries from the specified peer group. 123e76e7180Sclaudio.It Cm as Ns = Ns Ar number 124e76e7180SclaudioShow only entries with the specified source AS number. 125e76e7180Sclaudio.It Cm community Ns = Ns Ar string 126e76e7180Sclaudio.It Cm ext-community Ns = Ns Ar string 127e76e7180Sclaudio.It Cm large-community Ns = Ns Ar string 128e76e7180SclaudioShow only entries that match the specified community. 129e76e7180Sclaudio.It Xo 130e76e7180Sclaudio.Ic af Ns = Ns 131e76e7180Sclaudio.Pq Ic ipv4 | ipv6 | vpnv4 | vpnv6 132e76e7180Sclaudio.Xc 133e76e7180SclaudioShow only entries that match the specified address family. 134e76e7180Sclaudio.It Cm rib Ns = Ns Ar name 135e76e7180SclaudioShow only entries from the RIB with name 136e76e7180Sclaudio.Ar name . 137e76e7180Sclaudio.It Xo 138e76e7180Sclaudio.Ic ovs Ns = Ns 139e76e7180Sclaudio.Pq Ic valid | not-found | invalid 140e76e7180Sclaudio.Xc 141e76e7180SclaudioShow only prefixes that match the specified Origin Validation State. 142a35a1b73Sjmc.It Xo 143600dedbfSjob.Ic avs Ns = Ns 144600dedbfSjob.Pq Ic valid | invalid | unknown 145600dedbfSjob.Xc 146600dedbfSjobShow only prefixes that match the specified ASPA Validation State. 147e76e7180Sclaudio.It Cm best Ns = Ns 1 148e76e7180SclaudioShow only selected routes. 149e76e7180Sclaudio.It Cm error Ns = Ns 1 150e76e7180SclaudioShow only prefixes which are marked invalid and were treated as withdrawn. 151cb563a9eSclaudio.It Cm invalid Ns = Ns 1 152cb563a9eSclaudioShow only prefixes which are not eligible. 153cb563a9eSclaudio.It Cm leaked Ns = Ns 1 154cb563a9eSclaudioShow only prefixes where a route leak was detected. 155e76e7180Sclaudio.It Cm prefix Ns = Ns Ar addr 156e76e7180SclaudioShow only entries that match prefix either as the best matching route or 157e76e7180Sclaudioshow the entry for this CIDR prefix. 158e76e7180Sclaudio.It Cm all Ns = Ns 1 159e76e7180SclaudioShow all entries in the specified prefix range. 160e76e7180Sclaudio.It Cm or-shorter Ns = Ns 1 161e76e7180SclaudioShow all entries covering and including the specified prefix. 162e76e7180Sclaudio.El 163e76e7180Sclaudio.It Pa /rtr 164e76e7180SclaudioShow a list of all RTR sessions. 165e76e7180Sclaudio.It Pa /sets 166e76e7180SclaudioShow a list summarizing all roa-set, as-set, prefix-set, and origin-set tables. 167e76e7180Sclaudio.It Pa /summary 168e76e7180SclaudioShow a list of all neighbors, including information about the session state 169e76e7180Sclaudioand message counters. 170e76e7180Sclaudio.El 171e76e7180Sclaudio.Sh EXAMPLES 172e76e7180SclaudioAn example setup in 173e76e7180Sclaudio.Xr httpd 8 174e76e7180Sclaudiois: 175e76e7180Sclaudio.Bd -literal -offset indent 176e76e7180Sclaudio location "/bgplgd/*" { 177e76e7180Sclaudio fastcgi socket "/run/bgplgd.sock" 178e76e7180Sclaudio request strip 1 179e76e7180Sclaudio } 180e76e7180Sclaudio.Ed 181e76e7180Sclaudio.Sh SEE ALSO 182e76e7180Sclaudio.Xr bgpctl 8 , 183e76e7180Sclaudio.Xr bgpd 8 , 184e76e7180Sclaudio.Xr httpd 8 185e76e7180Sclaudio.Sh HISTORY 186e76e7180SclaudioThe 187e76e7180Sclaudio.Nm 188e76e7180Sclaudioserver first appeared in 189e76e7180Sclaudio.Ox 7.2 . 190e76e7180Sclaudio.Sh AUTHORS 191e76e7180Sclaudio.An Claudio Jeker Aq Mt claudio@openbsd.org 192