BGPCTL(8)
π BGPCTL π β like, the control page for the BGP routing daemon, from the System Manager's Manual (section 8, bestie)
okay so. you know bgpd(8)? the BGP routing daemon? this is its remote control. that's the whole vibe. π
β¨ NAME β¨
bgpctl β control the BGP routing daemon π¦
β¨ SYNOPSIS β¨
bgpctl [-jnV] [-s socket] command [argument ...]
β¨ DESCRIPTION β¨
so bgpctl is the program that controls the bgpd(8) daemon. main character energy, but make it sysadmin. π
and here's the little life hack: commands can be abbreviated β just give the minimum unambiguous prefix. like, s su is a totally valid way to say show summary. not me typing three letters instead of twelve bestie, it's called efficiency. π
the options, bestie
-jβ make the output a JSON object. yes, machine-readable. slay. π§-nβ show the neighbors' IP addresses instead of their description. raw facts only.-s socketβ use socket to talk tobgpd(8)instead of the default/run/bgpd/bgpd.sock.<rdomain>, where<rdomain>is the routing domainbgpctlis running in. wanna administerbgpd(8)in a different routing domain? then runbgpctlin that routing domain. that's it, that's the rule. π«Ά-Vβ show the version and dip. bye. βοΈ
the commands, and yes there are a LOT of them
π©΅ fib
fib [table number] coupleβ insert the learned routes into the specified Forwarding Information Base, a.k.a. the kernel routing table. couple them up, they're in love now πfib [table number] decoupleβ remove the learned routes from the specified Forwarding Information Base, a.k.a. the kernel routing table. it's giving breakup era π
πΈ flowspec
flowspec add family rule [set argument ...]β add the specified flowspec rule to the list of announced rules. right now family can be eitherinetorinet6. you can set various path attributes with the extra arguments. and heads up: adding a rule will replace an existing equal rule, including rules loaded from the configuration. checkbgpd.conf(5)for how to actually write a flowspec rule. πflowspec delete family ruleβ remove the specified flowspec rule from the list of announced rules. gone. ghosted. πflowspec flushβ remove all dynamically added flowspec rules (i.e. the ones you added withbgpctl flowspec add) from the list of announced rules.flowspec show familyβ show all announced flowspec rules. family, if given, limits the output to that address family. supported families areinetandinet6.
π¦ log
log briefβ disable verbose debug logging. turn it off. quiet luxury.log verboseβ enable verbose debug logging. turn it on. loud era.
π neighbor
neighbor peer clear [reason]β stop and restart the BGP session to the specified neighbor. if you give a reason, that reason gets sent as an Administrative Shutdown Communication to the neighbor. peer may be the neighbor's address, the neighbor's description, or the wordgroupfollowed by a group description.neighbor peer destroyβ destroy a previously cloned peer. β οΈ the peer must be down before you call this one, no exceptions. peer may be the neighbor's address, the neighbor's description, or the wordgroupfollowed by a group description.neighbor peer down [reason]β take the BGP session to the specified neighbor down. if you give a reason, it's sent as an Administrative Shutdown Communication to the neighbor. peer may be the neighbor's address, the neighbor's description, or the wordgroupfollowed by a group description.neighbor peer refreshβ ask the neighbor to re-send all routes. but lowkey important: the neighbor is not obliged to re-send all routes, or any routes at all, even if it announced the route refresh capability. so. yeah. don't count on it bestie. π peer may be the neighbor's address, the neighbor's description, or the wordgroupfollowed by a group description.neighbor peer upβ bring the BGP session to the specified neighbor up. rise and shine β¨ peer may be the neighbor's address, the neighbor's description, or the wordgroupfollowed by a group description.
π network
network add prefix [argument ...]β add the specified prefix to the list of announced networks. you can set various path attributes with the extra arguments. and fyi: adding a prefix will replace an existing equal prefix, including prefixes loaded from the configuration.network bulk add [argument ...]β bulk add the specified prefixes to the list of announced networks. prefixes should be sent via stdin. you can set various path attributes with the extra arguments. mass add, main character behaviour πnetwork bulk deleteβ bulk remove the specified prefixes from the list of announced networks. prefixes should be sent via stdin.network delete prefixβ remove the specified prefix from the list of announced networks.network flushβ remove all dynamically added prefixes (i.e. the ones you added withbgpctl network add) from the list of announced networks.network mrt file file filterβ import networks from an MRT table dump, for debugging purposes. filter can be specified the same way as with theshow mrtcommand. only networks matching the filter will be imported.network show familyβ show all announced networks. family, if given, limits the output to that address family. supported families areinetandinet6.
π« reload
reload [reason]β reload the configuration file. β οΈ changes to these neighbor options inbgpd.conf(5)only take effect when the session is reset:ipsecandtcp md5sig. so don't come crying to me when your config reload didn't do the thing, bestie.
π show
show fib filterβ show routes frombgpd(8)'s view of the Forwarding Information Base. filter can be an IP address β in which case the route to that address is shown β or a flag:bgpβ show only routes originating frombgpd(8)itself.connectedβ show only connected routes.inetβ show only IPv4 routes.inet6β show only IPv6 routes.nexthopβ show only routes required to reach a BGP nexthop.staticβ show only static routes.table numberβ show the routing table with ID number instead of the default routing table with ID 0.
show interfacesβ show the interface states. the vibe check, but for interfaces.show metricsβ dump various BGP statistics in OpenMetrics format. numbers numbers numbers πshow mrt [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 literally 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.address/len or-shorterβ show all entries covering and including the specified prefix.as asβ show all entries with as anywhere in the AS path.empty-asβ show all entries that are internal routes with no AS's in the AS path.neighbor ipβ show only entries from the specified peer.peer-as asβ show all entries with as as leftmost AS.source-as asβ show all entries with as as rightmost AS.transit-as asβ show all entries with as anywhere but rightmost.
also, these options exist too:
detailβ show more detailed output for matching routes.familyβ limit the output to the given address family.file nameβ read the MRT dump from file name instead of using stdin.peersβ print the neighbor table of MRT TABLE_DUMP_V2 dumps. using this on other table dumps will only show the neighbor of the first entry.
multiple options and filters can be used at the same time. mix and match, it's a lewk. π
show neighbor peer modifierβ show detailed information about the neighbor identified by peer, according to the given modifier:messagesβ show statistics about sent and received BGP messages.terseβ 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, sent and received withdraws, the neighbor's address (or subnet, for a template), AS number, and finally description. that's a lot of numbers bestie, hydrate. πtimersβ show the BGP timers.
peer may be the neighbor's address, the neighbor's description, or the word group followed by a group description.
show nexthopβ show the list of BGP nexthops and the result of their validity check. are they valid? are they a mess? find out. π₯show rib [options] filterβ show routes from thebgpd(8)Routing Information Base. filter can be an IP address, a CIDR prefix, an AS filter or nothing:addressβ shows the best matching route for address. like, the one route that wins for that IP πaddress/lenβ shows the RIB entry for this CIDR prefix.address/len allβ shows every entry in the specified range.address/len or-shorterβ shows all entries covering and including the specified prefix. so the prefix itself plus everything more general π¦asas β shows all entries with as anywhere in the AS path.avs(valid|unknown|invalid) β shows all entries with a matching ASAP Validation State (AVS).communitycommunity β shows all entries with community community.empty-asβ shows all entries that are internal routes with no AS's in the AS path.large-communitylarge-community β shows all entries with large-community large-community.memoryβ shows RIB memory statistics.neighborpeer β shows only entries from the specified peer.neighbor groupdescription β shows only entries from the specified peer group.ovs(valid|not-found|invalid) β shows all entries with a matching Origin Validation State (OVS).path-idpathid β shows only entries which match the specified pathid. β οΈ must be used together with eitherneighbororout, no solo runs bestie.peer-asas β shows all entries with as as the leftmost AS.source-asas β shows all entries with as as the rightmost AS.summaryβ this is the same as theshow summarycommand.tablerib β shows only entries from the specified RIB table.transit-asas β shows all entries with as anywhere but the rightmost position.
Additionally, the following options are defined:
bestβ alias forselected.detailβ show more detailed output for matching routes.disqualifiedβ show only routes which are not eligible.errorβ show only prefixes which are marked invalid and were treated as withdrawn.familyβ limit the output to the given address family.filteredβ show only routes which were filtered out. needsrde rib Loc-RIB include filteredto be set in the config, no cap.inβ show routes from the unfiltered Adj-RIB-In. the neighbor needs to be specified.leakedβ show only routes where a route leak was detected.outβ show the filtered routes sent to a neighbor. the neighbor needs to be specified.selectedβ show only selected routes.ssvβ show each RIB entry as a single line, with fields separated by semicolons. only works ifdetailis specified.
Options are silently ignored when used together withsummaryormemory. multiple options can be used at the same time and the neighbor filter can be combined with other filters. so yeah, stack them besties π
β¨ show rtr β¨
Show a list of all RPKI-to-Router (RTR) sessions, including information about the session state. it's giving peek behind the RTR curtain π¦
β¨ show sets β¨
Show a list summarizing all roa-set, as-set, prefix-set, and origin-set tables. all the sets, one lil summary, obsessed π
β¨ show summary β¨
Show a list of all neighbors, including information about the session state and message counters:
Neighborβ description of the neighbor.ASβ autonomous system number.MsgRcvdβ number of messages received from the neighbor.MsgSentβ number of messages sent to the neighbor.OutQβ number of outgoing messages queued.Up/Downβ number of days and hours that the session has been up.State/PrfRcvdβ state of the session / number of routes received. the session is up if there is no information for theStatecolumn (Establishedis not displayed). so like, no news = good news πΈ
β¨ show summary terse β¨
Show a list of all neighbors, including information about the session state, in a terse format. short queen energy π
β¨ show tables β¨
Show a list of all currently loaded fib routing tables.
π FILES π
/etc/bgpd.confβ defaultbgpd(8)configuration file/run/bgpd/bgpd.sockβ defaultbgpd(8)control socket
π SEE ALSO π
rdomain(4), route(4), bgpd.conf(5), bgpd(8), bgplg(8), bgplgd(8), bgplgsh(8), route(8), rpki-client(8), rtrctl(8), rtrd(8)
π HISTORY π
The bgpctl program first appeared in OpenBSD 3.5. a true vintage icon, been serving since way back π
and that's a wrap bestie!! π«Ά this Debian page was dated September 21, 2026 and it's the BGPCTL(8) man page β go forth and inspect those routes, you absolute legend π
β¨
π¦ where this page comes from
- epel 10: openbgpd 9.3-1.el10_3 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND LicenseRef-Fedora-Public-Domain
- epel 9: openbgpd 9.3-1.el9 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND LicenseRef-Fedora-Public-Domain
- fedora 43: openbgpd 9.3-1.fc43 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND LicenseRef-Fedora-Public-Domain
- fedora 44: openbgpd 9.3-1.fc44 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND LicenseRef-Fedora-Public-Domain
- Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms