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