1BGPCTL(8)                 BSD System Manager's Manual                BGPCTL(8)
2

NAME

4     bgpctl — control the Border Gateway Protocol daemon
5

SYNOPSIS

7     bgpctl [-jnV] [-s socket] command [argument ...]
8

DESCRIPTION

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     log brief
39             Disable verbose debug logging.
40
41     log verbose
42             Enable verbose debug logging.
43
44     neighbor peer clear [reason]
45             Stop and restart the BGP session to the specified neighbor.  If a
46             reason is provided, the reason is sent as Administrative Shutdown
47             Communication to the neighbor.  peer may be the neighbor's ad‐
48             dress, description or the word group followed by a group descrip‐
49             tion.
50
51     neighbor peer destroy
52             Destroy a previously cloned peer.  The peer must be down before
53             calling this function.  peer may be the neighbor's address, de‐
54             scription or the word group followed by a group description.
55
56     neighbor peer down [reason]
57             Take the BGP session to the specified neighbor down.  If a reason
58             is provided, the reason is sent as Administrative Shutdown Commu‐
59             nication to the neighbor.  peer may be the neighbor's address,
60             description or the word group followed by a group description.
61
62     neighbor peer refresh
63             Request the neighbor to re-send all routes.  Note that the neigh‐
64             bor is not obliged to re-send all routes, or any routes at all,
65             even if it announced the route refresh capability.  peer may be
66             the neighbor's address, description or the word group followed by
67             a group description.
68
69     neighbor peer up
70             Bring the BGP session to the specified neighbor up.  peer may be
71             the neighbor's address, description or the word group followed by
72             a group description.
73
74     network add prefix [arguments]
75             Add the specified prefix to the list of announced networks.  It
76             is possible to set various path attributes with additional
77             arguments.  Adding a prefix will replace an existing equal pre‐
78             fix, including prefixes loaded from the configuration.
79
80     network bulk [arguments] [add]
81             Bulk add specified prefixes to the list of announced networks.
82             Prefixes should be sent via stdin.  It is possible to set various
83             path attributes with additional arguments.  If neither add or
84             delete is given, add is the default.
85
86     network bulk delete
87             Bulk remove the specified prefixes from the list of announced
88             networks.  Prefixes should be sent via stdin.
89
90     network delete prefix
91             Remove the specified prefix from the list of announced networks.
92
93     network flush
94             Remove all dynamically (i.e. with bgpctl network add) added pre‐
95             fixes from the list of announced networks.
96
97     network mrt file file filter
98             Import networks from an MRT table dump for debugging purposes.
99             filter can be specified similarly to the show mrt command.  Only
100             networks matching the filter will be imported.
101
102     network show family
103             Show all announced networks.  family, if given, limits the output
104             to the given address family.  The supported families are inet and
105             inet6.
106
107     reload [reason]
108             Reload the configuration file.  Changes to the following neighbor
109             options in bgpd.conf(5) only take effect when the session is re‐
110             set: ipsec and tcp md5sig.
111
112     show fib filter
113             Show routes from bgpd(8)'s view of the Forwarding Information
114             Base.  filter can be an IP address, in which case the route to
115             this address is shown, or a flag:
116
117             connected     Show only connected routes.
118             static        Show only static routes.
119             bgp           Show only routes originating from bgpd(8) itself.
120             nexthop       Show only routes required to reach a BGP nexthop.
121             inet          Show only IPv4 routes.
122             inet6         Show only IPv6 routes.
123             table number  Show the routing table with ID number instead of
124                           the default routing table with ID 0.
125
126     show interfaces
127             Show the interface states.
128
129     show mrt [options] filter
130             Show routes from an MRT table dump file.  filter can be an IP ad‐
131             dress, a CIDR prefix, an AS filter, a combination or nothing:
132
133             address                 Show best matching route for address.
134             address/len             Show RIB entry for this CIDR prefix.
135             address/len all         Show all entries in the specified range.
136             address/len or-shorter  Show all entries covering and including
137                                     the specified prefix.
138             as as                   Show all entries with as anywhere in the
139                                     AS path.
140             empty-as                Show all entries that are internal routes
141                                     with no AS's in the AS path.
142             neighbor ip             Show only entries from the specified
143                                     peer.
144             peer-as as              Show all entries with as as leftmost AS.
145             source-as as            Show all entries with as as rightmost AS.
146             transit-as as           Show all entries with as anywhere but
147                                     rightmost.
148
149             Additionally, the following options are defined:
150
151             detail     Show more detailed output for matching routes.
152             family     Limit the output to the given address family.
153             file name  Read the MRT dump from file name instead of using
154                        stdin.
155             peers      Print the neighbor table of MRT TABLE_DUMP_V2 dumps.
156                        Using this on other table dumps will only show the
157                        neighbor of the first entry.
158
159             Multiple options and filters can be used at the same time.
160
161     show neighbor peer modifier
162             Show detailed information about the neighbor identified by peer,
163             according to the given modifier:
164
165             messages  Show statistics about sent and received BGP messages.
166             terse     Show statistics in an easily parseable terse format.
167                       The printed numbers are the sent and received open,
168                       sent and received notifications, sent and received up‐
169                       dates, sent and received keepalives, and sent and re‐
170                       ceived route refresh messages plus the current and max‐
171                       imum prefix count, the number of sent and received up‐
172                       dates, sent and received withdraws, the neighbor's ad‐
173                       dress (or subnet, for a template), AS number, and fi‐
174                       nally description.
175             timers    Show the BGP timers.
176             peer may be the neighbor's address, description or the word group
177             followed by a group description.
178
179     show nexthop
180             Show the list of BGP nexthops and the result of their validity
181             check.
182
183     show rib [options] filter
184             Show routes from the bgpd(8) Routing Information Base.  filter
185             can be an IP address, a CIDR prefix, an AS filter or nothing:
186
187             address                 Show best matching route for address.
188             address/len             Show RIB entry for this CIDR prefix.
189             address/len all         Show all entries in the specified range.
190             address/len or-shorter  Show all entries covering and including
191                                     the specified prefix.
192             as as                   Show all entries with as anywhere in the
193                                     AS path.
194             community community     Show all entries with community
195                                     community.
196             large-community large-community
197                                     Show all entries with large-community
198                                     large-community.
199             empty-as                Show all entries that are internal routes
200                                     with no AS's in the AS path.
201             memory                  Show RIB memory statistics.
202             neighbor peer           Show only entries from the specified
203                                     peer.
204             neighbor group description
205                                     Show only entries from the specified peer
206                                     group.
207             path-id pathid          Show only entries which match the speci‐
208                                     fied pathid.  Must be used together with
209                                     either neighbor or out.
210             peer-as as              Show all entries with as as leftmost AS.
211             source-as as            Show all entries with as as rightmost AS.
212             summary                 This is the same as the show summary com‐
213                                     mand.
214             table rib               Show only entries from the specified RIB
215                                     table.
216             transit-as as           Show all entries with as anywhere but
217                                     rightmost.
218             ovs (valid | not-found | invalid)
219                                     Show all entries with matching Origin
220                                     Validation State (OVS).
221
222             Additionally, the following options are defined:
223
224             best      Alias for selected.
225             error     Show only prefixes which are marked invalid and were
226                       treated as withdrawn.
227             selected  Show only selected routes.
228             ssv       Show each RIB entry as a single line, with fields sepa‐
229                       rated by semicolons.  Only works if detail is speci‐
230                       fied.
231             detail    Show more detailed output for matching routes.
232             family    Limit the output to the given address family.
233             in        Show routes from the unfiltered Adj-RIB-In.  The
234                       neighbor needs to be specified.
235             out       Show the filtered routes sent to a neighbor.  The
236                       neighbor needs to be specified.
237
238             Options are silently ignored when used together with summary or
239             memory.  Multiple options can be used at the same time and the
240             neighbor filter can be combined with other filters.
241
242     show rtr
243             Show a list of all RTR sessions, including information about the
244             session state.
245
246     show sets
247             Show a list summarizing all roa-set, as-set, prefix-set, and
248             origin-set tables.
249
250     show summary
251             Show a list of all neighbors, including information about the
252             session state and message counters:
253
254             Neighbor        Description of the neighbor.
255             AS              Autonomous system number.
256             MsgRcvd         Number of messages received from the neighbor.
257             MsgSent         Number of messages sent to the neighbor.
258             OutQ            Number of outgoing messages queued.
259             Up/Down         Number of days and hours that the session has
260                             been up.
261             State/PrfRcvd   State of the session / Number of routes received.
262                             The session is up if there is no information for
263                             the State column (Established is not displayed).
264
265     show summary terse
266             Show a list of all neighbors, including information about the
267             session state, in a terse format.
268
269     show tables
270             Show a list of all currently loaded fib routing tables.
271

FILES

273     /etc/bgpd.conf          default bgpd(8) configuration file
274     /run/bgpd/bgpd.sock     default bgpd(8) control socket
275

SEE ALSO

277     bgpd.conf(5), bgpd(8), bgplg(8), bgplgsh(8)
278

HISTORY

280     The bgpctl program first appeared in OpenBSD 3.5.
281
282BSD                            September 1, 2022                           BSD
Impressum