1BGPCTL(8) BSD System Manager's Manual BGPCTL(8)
2
4 bgpctl — control the BGP routing daemon
5
7 bgpctl [-jnV] [-s socket] command [argument ...]
8
10 The bgpctl program controls the bgpd(8) daemon. Commands may be abbrevi‐
11 ated to the minimum unambiguous prefix; for example, s su for show
12 summary.
13
14 The options are as follows:
15
16 -j Create output as JSON object.
17
18 -n Show neighbors' IP addresses instead of their description.
19
20 -s socket
21 Use socket to communicate with bgpd(8) instead of the default
22 /run/bgpd/bgpd.sock.<rdomain> where <rdomain> is the routing do‐
23 main bgpctl is running in. To administer bgpd(8) in a different
24 routing domain, run bgpctl in said routing domain.
25
26 -V Show the version and exit.
27
28 The commands are as follows:
29
30 fib [table number] couple
31 Insert the learned routes into the specified Forwarding Informa‐
32 tion Base a.k.a. the kernel routing table.
33
34 fib [table number] decouple
35 Remove the learned routes from the specified Forwarding Informa‐
36 tion Base a.k.a. the kernel routing table.
37
38 flowspec add family rule [set argument ...]
39 Add the specified flowspec rule to the list of announced rules.
40 Currently family can be either inet or inet6. It is possible to
41 set various path attributes with additional arguments. Adding a
42 rule will replace an existing equal rule, including rules loaded
43 from the configuration. See bgpd.conf(5) for information on how
44 to write a flowspec rule.
45
46 flowspec delete family rule
47 Remove the specified flowspec rule from the list of announced
48 rules.
49
50 flowspec flush
51 Remove all dynamically added (i.e. with bgpctl flowspec add)
52 flowspec rules from the list of announced rules.
53
54 flowspec show family
55 Show all announced flowspec rules. family, if given, limits the
56 output to the given address family. The supported families are
57 inet and inet6.
58
59 log brief
60 Disable verbose debug logging.
61
62 log verbose
63 Enable verbose debug logging.
64
65 neighbor peer clear [reason]
66 Stop and restart the BGP session to the specified neighbor. If a
67 reason is provided, the reason is sent as Administrative Shutdown
68 Communication to the neighbor. peer may be the neighbor's ad‐
69 dress, description or the word group followed by a group descrip‐
70 tion.
71
72 neighbor peer destroy
73 Destroy a previously cloned peer. The peer must be down before
74 calling this function. peer may be the neighbor's address, de‐
75 scription or the word group followed by a group description.
76
77 neighbor peer down [reason]
78 Take the BGP session to the specified neighbor down. If a reason
79 is provided, the reason is sent as Administrative Shutdown Commu‐
80 nication to the neighbor. peer may be the neighbor's address,
81 description or the word group followed by a group description.
82
83 neighbor peer refresh
84 Request the neighbor to re-send all routes. Note that the neigh‐
85 bor is not obliged to re-send all routes, or any routes at all,
86 even if it announced the route refresh capability. peer may be
87 the neighbor's address, description or the word group followed by
88 a group description.
89
90 neighbor peer up
91 Bring the BGP session to the specified neighbor up. peer may be
92 the neighbor's address, description or the word group followed by
93 a group description.
94
95 network add prefix [argument ...]
96 Add the specified prefix to the list of announced networks. It
97 is possible to set various path attributes with additional argu‐
98 ments. Adding a prefix will replace an existing equal prefix,
99 including prefixes loaded from the configuration.
100
101 network bulk add [argument ...]
102 Bulk add specified prefixes to the list of announced networks.
103 Prefixes should be sent via stdin. It is possible to set various
104 path attributes with additional arguments.
105
106 network bulk delete
107 Bulk remove the specified prefixes from the list of announced
108 networks. Prefixes should be sent via stdin.
109
110 network delete prefix
111 Remove the specified prefix from the list of announced networks.
112
113 network flush
114 Remove all dynamically added (i.e. with bgpctl network add) pre‐
115 fixes from the list of announced networks.
116
117 network mrt file file filter
118 Import networks from an MRT table dump for debugging purposes.
119 filter can be specified similarly to the show mrt command. Only
120 networks matching the filter will be imported.
121
122 network show family
123 Show all announced networks. family, if given, limits the output
124 to the given address family. The supported families are inet and
125 inet6.
126
127 reload [reason]
128 Reload the configuration file. Changes to the following neighbor
129 options in bgpd.conf(5) only take effect when the session is re‐
130 set: ipsec and tcp md5sig.
131
132 show fib filter
133 Show routes from bgpd(8)'s view of the Forwarding Information
134 Base. filter can be an IP address, in which case the route to
135 this address is shown, or a flag:
136
137 bgp Show only routes originating from bgpd(8) itself.
138 connected Show only connected routes.
139 inet Show only IPv4 routes.
140 inet6 Show only IPv6 routes.
141 nexthop Show only routes required to reach a BGP nexthop.
142 static Show only static routes.
143 table number Show the routing table with ID number instead of
144 the default routing table with ID 0.
145
146 show interfaces
147 Show the interface states.
148
149 show metrics
150 Dump various BGP statistics in OpenMetrics format.
151
152 show mrt [options] filter
153 Show routes from an MRT table dump file. filter can be an IP ad‐
154 dress, a CIDR prefix, an AS filter, a combination or nothing:
155
156 address Show best matching route for address.
157 address/len Show RIB entry for this CIDR prefix.
158 address/len all Show all entries in the specified range.
159 address/len or-shorter Show all entries covering and including
160 the specified prefix.
161 as as Show all entries with as anywhere in the
162 AS path.
163 empty-as Show all entries that are internal routes
164 with no AS's in the AS path.
165 neighbor ip Show only entries from the specified
166 peer.
167 peer-as as Show all entries with as as leftmost AS.
168 source-as as Show all entries with as as rightmost AS.
169 transit-as as Show all entries with as anywhere but
170 rightmost.
171
172 Additionally, the following options are defined:
173
174 detail Show more detailed output for matching routes.
175 family Limit the output to the given address family.
176 file name Read the MRT dump from file name instead of using
177 stdin.
178 peers Print the neighbor table of MRT TABLE_DUMP_V2 dumps.
179 Using this on other table dumps will only show the
180 neighbor of the first entry.
181
182 Multiple options and filters can be used at the same time.
183
184 show neighbor peer modifier
185 Show detailed information about the neighbor identified by peer,
186 according to the given modifier:
187
188 messages Show statistics about sent and received BGP messages.
189 terse Show statistics in an easily parseable terse format.
190 The printed numbers are the sent and received open,
191 sent and received notifications, sent and received up‐
192 dates, sent and received keepalives, and sent and re‐
193 ceived route refresh messages plus the current and max‐
194 imum prefix count, the number of sent and received up‐
195 dates, sent and received withdraws, the neighbor's ad‐
196 dress (or subnet, for a template), AS number, and fi‐
197 nally description.
198 timers Show the BGP timers.
199 peer may be the neighbor's address, description or the word group
200 followed by a group description.
201
202 show nexthop
203 Show the list of BGP nexthops and the result of their validity
204 check.
205
206 show rib [options] filter
207 Show routes from the bgpd(8) Routing Information Base. filter
208 can be an IP address, a CIDR prefix, an AS filter or nothing:
209
210 address Show best matching route for address.
211 address/len Show RIB entry for this CIDR prefix.
212 address/len all Show all entries in the specified range.
213 address/len or-shorter Show all entries covering and including
214 the specified prefix.
215 as as Show all entries with as anywhere in the
216 AS path.
217 avs (valid | unknown | invalid)
218 Show all entries with matching ASAP Vali‐
219 dation State (AVS).
220 community community Show all entries with community
221 community.
222 empty-as Show all entries that are internal routes
223 with no AS's in the AS path.
224 large-community large-community
225 Show all entries with large-community
226 large-community.
227 memory Show RIB memory statistics.
228 neighbor peer Show only entries from the specified
229 peer.
230 neighbor group description
231 Show only entries from the specified peer
232 group.
233 ovs (valid | not-found | invalid)
234 Show all entries with matching Origin
235 Validation State (OVS).
236 path-id pathid Show only entries which match the speci‐
237 fied pathid. Must be used together with
238 either neighbor or out.
239 peer-as as Show all entries with as as leftmost AS.
240 source-as as Show all entries with as as rightmost AS.
241 summary This is the same as the show summary com‐
242 mand.
243 table rib Show only entries from the specified RIB
244 table.
245 transit-as as Show all entries with as anywhere but
246 rightmost.
247
248 Additionally, the following options are defined:
249
250 best Alias for selected.
251 detail Show more detailed output for matching routes.
252 disqualified Show only routes which are not eligible.
253 error Show only prefixes which are marked invalid and
254 were treated as withdrawn.
255 family Limit the output to the given address family.
256 in Show routes from the unfiltered Adj-RIB-In. The
257 neighbor needs to be specified.
258 leaked Show only routes where a route leak was detected.
259 out Show the filtered routes sent to a neighbor. The
260 neighbor needs to be specified.
261 selected Show only selected routes.
262 ssv Show each RIB entry as a single line, with fields
263 separated by semicolons. Only works if detail is
264 specified.
265
266 Options are silently ignored when used together with summary or
267 memory. Multiple options can be used at the same time and the
268 neighbor filter can be combined with other filters.
269
270 show rtr
271 Show a list of all RTR sessions, including information about the
272 session state.
273
274 show sets
275 Show a list summarizing all roa-set, as-set, prefix-set, and
276 origin-set tables.
277
278 show summary
279 Show a list of all neighbors, including information about the
280 session state and message counters:
281
282 Neighbor Description of the neighbor.
283 AS Autonomous system number.
284 MsgRcvd Number of messages received from the neighbor.
285 MsgSent Number of messages sent to the neighbor.
286 OutQ Number of outgoing messages queued.
287 Up/Down Number of days and hours that the session has
288 been up.
289 State/PrfRcvd State of the session / Number of routes received.
290 The session is up if there is no information for
291 the State column (Established is not displayed).
292
293 show summary terse
294 Show a list of all neighbors, including information about the
295 session state, in a terse format.
296
297 show tables
298 Show a list of all currently loaded fib routing tables.
299
301 /etc/bgpd.conf default bgpd(8) configuration file
302 /run/bgpd/bgpd.sock default bgpd(8) control socket
303
305 bgpd.conf(5), bgpd(8), bgplg(8), bgplgsh(8)
306
308 The bgpctl program first appeared in OpenBSD 3.5.
309
310BSD May 9, 2023 BSD