]>
Commit | Line | Data |
---|---|---|
0efdf0fe | 1 | .. _bgp: |
42fc5d26 QY |
2 | |
3 | *** | |
4 | BGP | |
5 | *** | |
6 | ||
8fcedbd2 | 7 | :abbr:`BGP` stands for Border Gateway Protocol. The latest BGP version is 4. |
d1e7591e | 8 | BGP-4 is one of the Exterior Gateway Protocols and the de facto standard |
8fcedbd2 QY |
9 | interdomain routing protocol. BGP-4 is described in :rfc:`1771` and updated by |
10 | :rfc:`4271`. :rfc:`2858` adds multiprotocol support to BGP-4. | |
42fc5d26 | 11 | |
0efdf0fe | 12 | .. _starting-bgp: |
42fc5d26 QY |
13 | |
14 | Starting BGP | |
15 | ============ | |
16 | ||
8fcedbd2 QY |
17 | The default configuration file of *bgpd* is :file:`bgpd.conf`. *bgpd* searches |
18 | the current directory first, followed by |INSTALL_PREFIX_ETC|/bgpd.conf. All of | |
19 | *bgpd*'s commands must be configured in :file:`bgpd.conf` when the integrated | |
20 | config is not being used. | |
42fc5d26 | 21 | |
c1a54c05 | 22 | *bgpd* specific invocation options are described below. Common options may also |
0efdf0fe | 23 | be specified (:ref:`common-invocation-options`). |
42fc5d26 | 24 | |
c1a54c05 | 25 | .. program:: bgpd |
42fc5d26 | 26 | |
c9365894 | 27 | .. option:: -p, --bgp_port <port> |
42fc5d26 | 28 | |
db759bb0 | 29 | Set the bgp protocol's port number. When port number is 0, that means do not |
30 | listen bgp port. | |
42fc5d26 | 31 | |
c9365894 | 32 | .. option:: -l, --listenon |
42fc5d26 | 33 | |
c0868e8b QY |
34 | Specify a specific IP address for bgpd to listen on, rather than its default |
35 | of ``0.0.0.0`` / ``::``. This can be useful to constrain bgpd to an internal | |
36 | address, or to run multiple bgpd processes on one host. | |
42fc5d26 | 37 | |
11a9a236 DS |
38 | .. option:: -n, --no_kernel |
39 | ||
40 | Do not install learned routes into the linux kernel. This option is useful | |
41 | for a route-reflector environment or if you are running multiple bgp | |
42 | processes in the same namespace. This option is different than the --no_zebra | |
43 | option in that a ZAPI connection is made. | |
44 | ||
45 | .. option:: -S, --skip_runas | |
46 | ||
47 | Skip the normal process of checking capabilities and changing user and group | |
48 | information. | |
49 | ||
50 | .. option:: -e, --ecmp | |
51 | ||
52 | Run BGP with a limited ecmp capability, that is different than what BGP | |
53 | was compiled with. The value specified must be greater than 0 and less | |
54 | than or equal to the MULTIPATH_NUM specified on compilation. | |
55 | ||
56 | .. option:: -Z, --no_zebra | |
57 | ||
58 | Do not communicate with zebra at all. This is different than the --no_kernel | |
59 | option in that we do not even open a ZAPI connection to the zebra process. | |
60 | ||
61 | .. option:: -s, --socket_size | |
62 | ||
63 | When opening tcp connections to our peers, set the socket send buffer | |
64 | size that the kernel will use for the peers socket. This option | |
65 | is only really useful at a very large scale. Experimentation should | |
66 | be done to see if this is helping or not at the scale you are running | |
67 | at. | |
68 | ||
69 | LABEL MANAGER | |
70 | ------------- | |
71 | ||
72 | .. option:: -I, --int_num | |
73 | ||
74 | Set zclient id. This is required when using Zebra label manager in proxy mode. | |
75 | ||
8fcedbd2 | 76 | .. _bgp-basic-concepts: |
42fc5d26 | 77 | |
8fcedbd2 QY |
78 | Basic Concepts |
79 | ============== | |
42fc5d26 | 80 | |
8fcedbd2 | 81 | .. _bgp-autonomous-systems: |
c3c5a71f | 82 | |
8fcedbd2 QY |
83 | Autonomous Systems |
84 | ------------------ | |
42fc5d26 | 85 | |
c0868e8b QY |
86 | From :rfc:`1930`: |
87 | ||
88 | An AS is a connected group of one or more IP prefixes run by one or more | |
89 | network operators which has a SINGLE and CLEARLY DEFINED routing policy. | |
90 | ||
91 | Each AS has an identifying number associated with it called an :abbr:`ASN | |
92 | (Autonomous System Number)`. This is a two octet value ranging in value from 1 | |
93 | to 65535. The AS numbers 64512 through 65535 are defined as private AS numbers. | |
94 | Private AS numbers must not be advertised on the global Internet. | |
95 | ||
96 | The :abbr:`ASN (Autonomous System Number)` is one of the essential elements of | |
8fcedbd2 | 97 | BGP. BGP is a distance vector routing protocol, and the AS-Path framework |
c0868e8b | 98 | provides distance vector metric and loop detection to BGP. |
42fc5d26 | 99 | |
c0868e8b | 100 | .. seealso:: :rfc:`1930` |
42fc5d26 | 101 | |
8fcedbd2 | 102 | .. _bgp-address-families: |
42fc5d26 | 103 | |
8fcedbd2 QY |
104 | Address Families |
105 | ---------------- | |
42fc5d26 | 106 | |
c0868e8b QY |
107 | Multiprotocol extensions enable BGP to carry routing information for multiple |
108 | network layer protocols. BGP supports an Address Family Identifier (AFI) for | |
109 | IPv4 and IPv6. Support is also provided for multiple sets of per-AFI | |
110 | information via the BGP Subsequent Address Family Identifier (SAFI). FRR | |
111 | supports SAFIs for unicast information, labeled information (:rfc:`3107` and | |
112 | :rfc:`8277`), and Layer 3 VPN information (:rfc:`4364` and :rfc:`4659`). | |
c3c5a71f | 113 | |
8fcedbd2 | 114 | .. _bgp-route-selection: |
42fc5d26 | 115 | |
8fcedbd2 QY |
116 | Route Selection |
117 | --------------- | |
42fc5d26 | 118 | |
8fcedbd2 QY |
119 | The route selection process used by FRR's BGP implementation uses the following |
120 | decision criterion, starting at the top of the list and going towards the | |
121 | bottom until one of the factors can be used. | |
42fc5d26 | 122 | |
8fcedbd2 | 123 | 1. **Weight check** |
42fc5d26 | 124 | |
c1a54c05 | 125 | Prefer higher local weight routes to lower routes. |
42fc5d26 | 126 | |
8fcedbd2 QY |
127 | 2. **Local preference check** |
128 | ||
c1a54c05 | 129 | Prefer higher local preference routes to lower. |
42fc5d26 | 130 | |
8fcedbd2 QY |
131 | 3. **Local route check** |
132 | ||
c1a54c05 | 133 | Prefer local routes (statics, aggregates, redistributed) to received routes. |
42fc5d26 | 134 | |
8fcedbd2 QY |
135 | 4. **AS path length check** |
136 | ||
c1a54c05 | 137 | Prefer shortest hop-count AS_PATHs. |
42fc5d26 | 138 | |
8fcedbd2 QY |
139 | 5. **Origin check** |
140 | ||
c1a54c05 QY |
141 | Prefer the lowest origin type route. That is, prefer IGP origin routes to |
142 | EGP, to Incomplete routes. | |
42fc5d26 | 143 | |
8fcedbd2 QY |
144 | 6. **MED check** |
145 | ||
c1a54c05 | 146 | Where routes with a MED were received from the same AS, prefer the route |
0efdf0fe | 147 | with the lowest MED. :ref:`bgp-med`. |
42fc5d26 | 148 | |
8fcedbd2 QY |
149 | 7. **External check** |
150 | ||
c1a54c05 QY |
151 | Prefer the route received from an external, eBGP peer over routes received |
152 | from other types of peers. | |
42fc5d26 | 153 | |
8fcedbd2 QY |
154 | 8. **IGP cost check** |
155 | ||
c1a54c05 | 156 | Prefer the route with the lower IGP cost. |
42fc5d26 | 157 | |
8fcedbd2 QY |
158 | 9. **Multi-path check** |
159 | ||
c1a54c05 QY |
160 | If multi-pathing is enabled, then check whether the routes not yet |
161 | distinguished in preference may be considered equal. If | |
9e146a81 | 162 | :clicmd:`bgp bestpath as-path multipath-relax` is set, all such routes are |
c1a54c05 QY |
163 | considered equal, otherwise routes received via iBGP with identical AS_PATHs |
164 | or routes received from eBGP neighbours in the same AS are considered equal. | |
42fc5d26 | 165 | |
8fcedbd2 QY |
166 | 10. **Already-selected external check** |
167 | ||
07738543 QY |
168 | Where both routes were received from eBGP peers, then prefer the route |
169 | which is already selected. Note that this check is not applied if | |
170 | :clicmd:`bgp bestpath compare-routerid` is configured. This check can | |
171 | prevent some cases of oscillation. | |
172 | ||
8fcedbd2 QY |
173 | 11. **Router-ID check** |
174 | ||
07738543 QY |
175 | Prefer the route with the lowest `router-ID`. If the route has an |
176 | `ORIGINATOR_ID` attribute, through iBGP reflection, then that router ID is | |
177 | used, otherwise the `router-ID` of the peer the route was received from is | |
178 | used. | |
179 | ||
8fcedbd2 QY |
180 | 12. **Cluster-List length check** |
181 | ||
07738543 QY |
182 | The route with the shortest cluster-list length is used. The cluster-list |
183 | reflects the iBGP reflection path the route has taken. | |
184 | ||
8fcedbd2 QY |
185 | 13. **Peer address** |
186 | ||
07738543 QY |
187 | Prefer the route received from the peer with the higher transport layer |
188 | address, as a last-resort tie-breaker. | |
42fc5d26 | 189 | |
8fcedbd2 QY |
190 | .. _bgp-capability-negotiation: |
191 | ||
192 | Capability Negotiation | |
193 | ---------------------- | |
194 | ||
195 | When adding IPv6 routing information exchange feature to BGP. There were some | |
196 | proposals. :abbr:`IETF (Internet Engineering Task Force)` | |
197 | :abbr:`IDR (Inter Domain Routing)` adopted a proposal called Multiprotocol | |
198 | Extension for BGP. The specification is described in :rfc:`2283`. The protocol | |
199 | does not define new protocols. It defines new attributes to existing BGP. When | |
200 | it is used exchanging IPv6 routing information it is called BGP-4+. When it is | |
201 | used for exchanging multicast routing information it is called MBGP. | |
202 | ||
203 | *bgpd* supports Multiprotocol Extension for BGP. So if a remote peer supports | |
204 | the protocol, *bgpd* can exchange IPv6 and/or multicast routing information. | |
205 | ||
206 | Traditional BGP did not have the feature to detect a remote peer's | |
207 | capabilities, e.g. whether it can handle prefix types other than IPv4 unicast | |
208 | routes. This was a big problem using Multiprotocol Extension for BGP in an | |
209 | operational network. :rfc:`2842` adopted a feature called Capability | |
210 | Negotiation. *bgpd* use this Capability Negotiation to detect the remote peer's | |
211 | capabilities. If a peer is only configured as an IPv4 unicast neighbor, *bgpd* | |
212 | does not send these Capability Negotiation packets (at least not unless other | |
213 | optional BGP features require capability negotiation). | |
214 | ||
215 | By default, FRR will bring up peering with minimal common capability for the | |
216 | both sides. For example, if the local router has unicast and multicast | |
217 | capabilities and the remote router only has unicast capability the local router | |
218 | will establish the connection with unicast only capability. When there are no | |
219 | common capabilities, FRR sends Unsupported Capability error and then resets the | |
220 | connection. | |
221 | ||
8fcedbd2 QY |
222 | .. _bgp-router-configuration: |
223 | ||
224 | BGP Router Configuration | |
225 | ======================== | |
226 | ||
227 | ASN and Router ID | |
228 | ----------------- | |
229 | ||
230 | First of all you must configure BGP router with the :clicmd:`router bgp ASN` | |
231 | command. The AS number is an identifier for the autonomous system. The BGP | |
232 | protocol uses the AS number for detecting whether the BGP connection is | |
233 | internal or external. | |
234 | ||
235 | .. index:: router bgp ASN | |
236 | .. clicmd:: router bgp ASN | |
237 | ||
238 | Enable a BGP protocol process with the specified ASN. After | |
239 | this statement you can input any `BGP Commands`. | |
240 | ||
241 | .. index:: no router bgp ASN | |
242 | .. clicmd:: no router bgp ASN | |
243 | ||
244 | Destroy a BGP protocol process with the specified ASN. | |
245 | ||
246 | .. index:: bgp router-id A.B.C.D | |
247 | .. clicmd:: bgp router-id A.B.C.D | |
248 | ||
249 | This command specifies the router-ID. If *bgpd* connects to *zebra* it gets | |
250 | interface and address information. In that case default router ID value is | |
251 | selected as the largest IP Address of the interfaces. When `router zebra` is | |
252 | not enabled *bgpd* can't get interface information so `router-id` is set to | |
253 | 0.0.0.0. So please set router-id by hand. | |
254 | ||
c8a5e5e1 QY |
255 | |
256 | .. _bgp-multiple-autonomous-systems: | |
257 | ||
258 | Multiple Autonomous Systems | |
259 | --------------------------- | |
260 | ||
261 | FRR's BGP implementation is capable of running multiple autonomous systems at | |
262 | once. Each configured AS corresponds to a :ref:`zebra-vrf`. In the past, to get | |
263 | the same functionality the network administrator had to run a new *bgpd* | |
264 | process; using VRFs allows multiple autonomous systems to be handled in a | |
265 | single process. | |
266 | ||
267 | When using multiple autonomous systems, all router config blocks after the | |
268 | first one must specify a VRF to be the target of BGP's route selection. This | |
269 | VRF must be unique within respect to all other VRFs being used for the same | |
270 | purpose, i.e. two different autonomous systems cannot use the same VRF. | |
271 | However, the same AS can be used with different VRFs. | |
272 | ||
273 | .. note:: | |
274 | ||
275 | The separated nature of VRFs makes it possible to peer a single *bgpd* | |
edde3ce9 QY |
276 | process to itself, on one machine. Note that this can be done fully within |
277 | BGP without a corresponding VRF in the kernel or Zebra, which enables some | |
278 | practical use cases such as :ref:`route reflectors <bgp-route-reflector>` | |
279 | and route servers. | |
c8a5e5e1 QY |
280 | |
281 | Configuration of additional autonomous systems, or of a router that targets a | |
282 | specific VRF, is accomplished with the following command: | |
283 | ||
284 | .. index:: router bgp ASN vrf VRFNAME | |
285 | .. clicmd:: router bgp ASN vrf VRFNAME | |
286 | ||
287 | ``VRFNAME`` is matched against VRFs configured in the kernel. When ``vrf | |
288 | VRFNAME`` is not specified, the BGP protocol process belongs to the default | |
289 | VRF. | |
290 | ||
291 | An example configuration with multiple autonomous systems might look like this: | |
292 | ||
293 | .. code-block:: frr | |
294 | ||
295 | router bgp 1 | |
296 | neighbor 10.0.0.1 remote-as 20 | |
297 | neighbor 10.0.0.2 remote-as 30 | |
298 | ! | |
299 | router bgp 2 vrf blue | |
300 | neighbor 10.0.0.3 remote-as 40 | |
301 | neighbor 10.0.0.4 remote-as 50 | |
302 | ! | |
303 | router bgp 3 vrf red | |
304 | neighbor 10.0.0.5 remote-as 60 | |
305 | neighbor 10.0.0.6 remote-as 70 | |
306 | ... | |
307 | ||
c8a5e5e1 QY |
308 | .. seealso:: :ref:`bgp-vrf-route-leaking` |
309 | .. seealso:: :ref:`zebra-vrf` | |
310 | ||
311 | ||
312 | .. _bgp-views: | |
313 | ||
314 | Views | |
315 | ----- | |
316 | ||
317 | In addition to supporting multiple autonomous systems, FRR's BGP implementation | |
318 | also supports *views*. | |
319 | ||
320 | BGP views are almost the same as normal BGP processes, except that routes | |
195c7461 QY |
321 | selected by BGP are not installed into the kernel routing table. Each BGP view |
322 | provides an independent set of routing information which is only distributed | |
323 | via BGP. Multiple views can be supported, and BGP view information is always | |
324 | independent from other routing protocols and Zebra/kernel routes. BGP views use | |
325 | the core instance (i.e., default VRF) for communication with peers. | |
edde3ce9 | 326 | |
c8a5e5e1 QY |
327 | .. index:: router bgp AS-NUMBER view NAME |
328 | .. clicmd:: router bgp AS-NUMBER view NAME | |
329 | ||
330 | Make a new BGP view. You can use an arbitrary word for the ``NAME``. Routes | |
331 | selected by the view are not installed into the kernel routing table. | |
332 | ||
333 | With this command, you can setup Route Server like below. | |
334 | ||
335 | .. code-block:: frr | |
336 | ||
337 | ! | |
338 | router bgp 1 view 1 | |
339 | neighbor 10.0.0.1 remote-as 2 | |
340 | neighbor 10.0.0.2 remote-as 3 | |
341 | ! | |
342 | router bgp 2 view 2 | |
343 | neighbor 10.0.0.3 remote-as 4 | |
344 | neighbor 10.0.0.4 remote-as 5 | |
345 | ||
346 | .. index:: show [ip] bgp view NAME | |
347 | .. clicmd:: show [ip] bgp view NAME | |
348 | ||
349 | Display the routing table of BGP view ``NAME``. | |
350 | ||
351 | ||
8fcedbd2 QY |
352 | Route Selection |
353 | --------------- | |
c3c5a71f | 354 | |
c1a54c05 | 355 | .. index:: bgp bestpath as-path confed |
29adcd50 | 356 | .. clicmd:: bgp bestpath as-path confed |
42fc5d26 | 357 | |
c1a54c05 QY |
358 | This command specifies that the length of confederation path sets and |
359 | sequences should should be taken into account during the BGP best path | |
360 | decision process. | |
42fc5d26 | 361 | |
c3c5a71f | 362 | .. index:: bgp bestpath as-path multipath-relax |
29adcd50 | 363 | .. clicmd:: bgp bestpath as-path multipath-relax |
42fc5d26 | 364 | |
c1a54c05 QY |
365 | This command specifies that BGP decision process should consider paths |
366 | of equal AS_PATH length candidates for multipath computation. Without | |
367 | the knob, the entire AS_PATH must match for multipath computation. | |
c3c5a71f | 368 | |
29adcd50 | 369 | .. clicmd:: bgp bestpath compare-routerid |
42fc5d26 | 370 | |
c1a54c05 QY |
371 | Ensure that when comparing routes where both are equal on most metrics, |
372 | including local-pref, AS_PATH length, IGP cost, MED, that the tie is broken | |
373 | based on router-ID. | |
42fc5d26 | 374 | |
c1a54c05 QY |
375 | If this option is enabled, then the already-selected check, where |
376 | already selected eBGP routes are preferred, is skipped. | |
42fc5d26 | 377 | |
c1a54c05 QY |
378 | If a route has an `ORIGINATOR_ID` attribute because it has been reflected, |
379 | that `ORIGINATOR_ID` will be used. Otherwise, the router-ID of the peer the | |
380 | route was received from will be used. | |
42fc5d26 | 381 | |
c1a54c05 QY |
382 | The advantage of this is that the route-selection (at this point) will be |
383 | more deterministic. The disadvantage is that a few or even one lowest-ID | |
d1e7591e | 384 | router may attract all traffic to otherwise-equal paths because of this |
c1a54c05 QY |
385 | check. It may increase the possibility of MED or IGP oscillation, unless |
386 | other measures were taken to avoid these. The exact behaviour will be | |
387 | sensitive to the iBGP and reflection topology. | |
42fc5d26 | 388 | |
8fcedbd2 QY |
389 | .. _bgp-distance: |
390 | ||
391 | Administrative Distance Metrics | |
392 | ------------------------------- | |
393 | ||
394 | .. index:: distance bgp (1-255) (1-255) (1-255) | |
395 | .. clicmd:: distance bgp (1-255) (1-255) (1-255) | |
396 | ||
397 | This command change distance value of BGP. The arguments are the distance | |
398 | values for for external routes, internal routes and local routes | |
399 | respectively. | |
400 | ||
401 | .. index:: distance (1-255) A.B.C.D/M | |
402 | .. clicmd:: distance (1-255) A.B.C.D/M | |
403 | ||
404 | .. index:: distance (1-255) A.B.C.D/M WORD | |
405 | .. clicmd:: distance (1-255) A.B.C.D/M WORD | |
406 | ||
407 | Sets the administrative distance for a particular route. | |
42fc5d26 | 408 | |
713c64dd DA |
409 | .. _bgp-requires-policy: |
410 | ||
411 | Require policy on EBGP | |
412 | ------------------------------- | |
413 | ||
414 | .. index:: [no] bgp ebgp-requires-policy | |
415 | .. clicmd:: [no] bgp ebgp-requires-policy | |
416 | ||
8955d9e5 DA |
417 | This command requires incoming and outgoing filters to be applied |
418 | for eBGP sessions. Without the incoming filter, no routes will be | |
419 | accepted. Without the outgoing filter, no routes will be announced. | |
420 | ||
421 | This is enabled by default. | |
713c64dd | 422 | |
62c42b0e DA |
423 | When the incoming or outgoing filter is missing you will see |
424 | "(Policy)" sign under ``show bgp summary``: | |
425 | ||
426 | .. code-block:: frr | |
427 | ||
428 | exit1# show bgp summary | |
429 | ||
430 | IPv4 Unicast Summary: | |
431 | BGP router identifier 10.10.10.1, local AS number 65001 vrf-id 0 | |
432 | BGP table version 4 | |
433 | RIB entries 7, using 1344 bytes of memory | |
434 | Peers 2, using 43 KiB of memory | |
435 | ||
436 | Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd PfxSnt | |
437 | 192.168.0.2 4 65002 8 10 0 0 0 00:03:09 5 (Policy) | |
438 | fe80:1::2222 4 65002 9 11 0 0 0 00:03:09 (Policy) (Policy) | |
439 | ||
f0c81afe | 440 | Reject routes with AS_SET or AS_CONFED_SET types |
5031d886 | 441 | ------------------------------------------------ |
f0c81afe DA |
442 | |
443 | .. index:: [no] bgp reject-as-sets | |
444 | .. clicmd:: [no] bgp reject-as-sets | |
445 | ||
446 | This command enables rejection of incoming and outgoing routes having AS_SET or AS_CONFED_SET type. | |
447 | ||
835e9c5d DA |
448 | Disable checking if nexthop is connected on EBGP sessions |
449 | --------------------------------------------------------- | |
450 | ||
451 | .. index:: [no] bgp disable-ebgp-connected-route-check | |
452 | .. clicmd:: [no] bgp disable-ebgp-connected-route-check | |
453 | ||
454 | This command is used to disable the connection verification process for EBGP peering sessions | |
455 | that are reachable by a single hop but are configured on a loopback interface or otherwise | |
456 | configured with a non-directly connected IP address. | |
457 | ||
0efdf0fe | 458 | .. _bgp-route-flap-dampening: |
42fc5d26 | 459 | |
8fcedbd2 QY |
460 | Route Flap Dampening |
461 | -------------------- | |
42fc5d26 | 462 | |
c1a54c05 QY |
463 | .. clicmd:: bgp dampening (1-45) (1-20000) (1-20000) (1-255) |
464 | ||
c1a54c05 | 465 | This command enables BGP route-flap dampening and specifies dampening parameters. |
42fc5d26 | 466 | |
c1a54c05 QY |
467 | half-life |
468 | Half-life time for the penalty | |
42fc5d26 | 469 | |
c1a54c05 QY |
470 | reuse-threshold |
471 | Value to start reusing a route | |
42fc5d26 | 472 | |
c1a54c05 QY |
473 | suppress-threshold |
474 | Value to start suppressing a route | |
42fc5d26 | 475 | |
c1a54c05 QY |
476 | max-suppress |
477 | Maximum duration to suppress a stable route | |
42fc5d26 | 478 | |
c1a54c05 QY |
479 | The route-flap damping algorithm is compatible with :rfc:`2439`. The use of |
480 | this command is not recommended nowadays. | |
42fc5d26 | 481 | |
319a7d06 DA |
482 | At the moment, route-flap dampening is not working per VRF and is working only |
483 | for IPv4 unicast and multicast. | |
484 | ||
c1a54c05 | 485 | .. seealso:: |
8fcedbd2 | 486 | https://www.ripe.net/publications/docs/ripe-378 |
42fc5d26 | 487 | |
0efdf0fe | 488 | .. _bgp-med: |
42fc5d26 | 489 | |
8fcedbd2 QY |
490 | Multi-Exit Discriminator |
491 | ------------------------ | |
42fc5d26 | 492 | |
8fcedbd2 | 493 | The BGP :abbr:`MED (Multi-Exit Discriminator)` attribute has properties which |
c1a54c05 QY |
494 | can cause subtle convergence problems in BGP. These properties and problems |
495 | have proven to be hard to understand, at least historically, and may still not | |
496 | be widely understood. The following attempts to collect together and present | |
497 | what is known about MED, to help operators and FRR users in designing and | |
498 | configuring their networks. | |
42fc5d26 | 499 | |
07a17e6d QY |
500 | The BGP :abbr:`MED` attribute is intended to allow one AS to indicate its |
501 | preferences for its ingress points to another AS. The MED attribute will not be | |
502 | propagated on to another AS by the receiving AS - it is 'non-transitive' in the | |
503 | BGP sense. | |
42fc5d26 | 504 | |
c1a54c05 QY |
505 | E.g., if AS X and AS Y have 2 different BGP peering points, then AS X might set |
506 | a MED of 100 on routes advertised at one and a MED of 200 at the other. When AS | |
507 | Y selects between otherwise equal routes to or via AS X, AS Y should prefer to | |
508 | take the path via the lower MED peering of 100 with AS X. Setting the MED | |
509 | allows an AS to influence the routing taken to it within another, neighbouring | |
510 | AS. | |
42fc5d26 QY |
511 | |
512 | In this use of MED it is not really meaningful to compare the MED value on | |
c1a54c05 QY |
513 | routes where the next AS on the paths differs. E.g., if AS Y also had a route |
514 | for some destination via AS Z in addition to the routes from AS X, and AS Z had | |
515 | also set a MED, it wouldn't make sense for AS Y to compare AS Z's MED values to | |
516 | those of AS X. The MED values have been set by different administrators, with | |
517 | different frames of reference. | |
42fc5d26 QY |
518 | |
519 | The default behaviour of BGP therefore is to not compare MED values across | |
dc1046f7 | 520 | routes received from different neighbouring ASes. In FRR this is done by |
c1a54c05 QY |
521 | comparing the neighbouring, left-most AS in the received AS_PATHs of the routes |
522 | and only comparing MED if those are the same. | |
523 | ||
524 | Unfortunately, this behaviour of MED, of sometimes being compared across routes | |
525 | and sometimes not, depending on the properties of those other routes, means MED | |
526 | can cause the order of preference over all the routes to be undefined. That is, | |
527 | given routes A, B, and C, if A is preferred to B, and B is preferred to C, then | |
528 | a well-defined order should mean the preference is transitive (in the sense of | |
013f9762 | 529 | orders [#med-transitivity-rant]_) and that A would be preferred to C. |
42fc5d26 | 530 | |
c3c5a71f QY |
531 | However, when MED is involved this need not be the case. With MED it is |
532 | possible that C is actually preferred over A. So A is preferred to B, B is | |
533 | preferred to C, but C is preferred to A. This can be true even where BGP | |
c1a54c05 QY |
534 | defines a deterministic 'most preferred' route out of the full set of A,B,C. |
535 | With MED, for any given set of routes there may be a deterministically | |
536 | preferred route, but there need not be any way to arrange them into any order | |
537 | of preference. With unmodified MED, the order of preference of routes literally | |
538 | becomes undefined. | |
42fc5d26 | 539 | |
c3c5a71f | 540 | That MED can induce non-transitive preferences over routes can cause issues. |
c1a54c05 QY |
541 | Firstly, it may be perceived to cause routing table churn locally at speakers; |
542 | secondly, and more seriously, it may cause routing instability in iBGP | |
543 | topologies, where sets of speakers continually oscillate between different | |
544 | paths. | |
42fc5d26 | 545 | |
c3c5a71f | 546 | The first issue arises from how speakers often implement routing decisions. |
c1a54c05 QY |
547 | Though BGP defines a selection process that will deterministically select the |
548 | same route as best at any given speaker, even with MED, that process requires | |
549 | evaluating all routes together. For performance and ease of implementation | |
550 | reasons, many implementations evaluate route preferences in a pair-wise fashion | |
551 | instead. Given there is no well-defined order when MED is involved, the best | |
552 | route that will be chosen becomes subject to implementation details, such as | |
553 | the order the routes are stored in. That may be (locally) non-deterministic, | |
554 | e.g.: it may be the order the routes were received in. | |
42fc5d26 QY |
555 | |
556 | This indeterminism may be considered undesirable, though it need not cause | |
c1a54c05 QY |
557 | problems. It may mean additional routing churn is perceived, as sometimes more |
558 | updates may be produced than at other times in reaction to some event . | |
42fc5d26 QY |
559 | |
560 | This first issue can be fixed with a more deterministic route selection that | |
c3c5a71f | 561 | ensures routes are ordered by the neighbouring AS during selection. |
9e146a81 | 562 | :clicmd:`bgp deterministic-med`. This may reduce the number of updates as routes |
c1a54c05 QY |
563 | are received, and may in some cases reduce routing churn. Though, it could |
564 | equally deterministically produce the largest possible set of updates in | |
565 | response to the most common sequence of received updates. | |
42fc5d26 QY |
566 | |
567 | A deterministic order of evaluation tends to imply an additional overhead of | |
c3c5a71f | 568 | sorting over any set of n routes to a destination. The implementation of |
dc1046f7 | 569 | deterministic MED in FRR scales significantly worse than most sorting |
c1a54c05 QY |
570 | algorithms at present, with the number of paths to a given destination. That |
571 | number is often low enough to not cause any issues, but where there are many | |
572 | paths, the deterministic comparison may quickly become increasingly expensive | |
573 | in terms of CPU. | |
574 | ||
575 | Deterministic local evaluation can *not* fix the second, more major, issue of | |
576 | MED however. Which is that the non-transitive preference of routes MED can | |
577 | cause may lead to routing instability or oscillation across multiple speakers | |
578 | in iBGP topologies. This can occur with full-mesh iBGP, but is particularly | |
579 | problematic in non-full-mesh iBGP topologies that further reduce the routing | |
580 | information known to each speaker. This has primarily been documented with iBGP | |
749afd7d RF |
581 | :ref:`route-reflection <bgp-route-reflector>` topologies. However, any |
582 | route-hiding technologies potentially could also exacerbate oscillation with MED. | |
c1a54c05 QY |
583 | |
584 | This second issue occurs where speakers each have only a subset of routes, and | |
585 | there are cycles in the preferences between different combinations of routes - | |
586 | as the undefined order of preference of MED allows - and the routes are | |
587 | distributed in a way that causes the BGP speakers to 'chase' those cycles. This | |
588 | can occur even if all speakers use a deterministic order of evaluation in route | |
589 | selection. | |
590 | ||
591 | E.g., speaker 4 in AS A might receive a route from speaker 2 in AS X, and from | |
592 | speaker 3 in AS Y; while speaker 5 in AS A might receive that route from | |
593 | speaker 1 in AS Y. AS Y might set a MED of 200 at speaker 1, and 100 at speaker | |
594 | 3. I.e, using ASN:ID:MED to label the speakers: | |
42fc5d26 QY |
595 | |
596 | :: | |
597 | ||
c1a54c05 QY |
598 | . |
599 | /---------------\\ | |
42fc5d26 | 600 | X:2------|--A:4-------A:5--|-Y:1:200 |
c1a54c05 QY |
601 | Y:3:100--|-/ | |
602 | \\---------------/ | |
c3c5a71f | 603 | |
42fc5d26 | 604 | |
42fc5d26 | 605 | |
c1a54c05 QY |
606 | Assuming all other metrics are equal (AS_PATH, ORIGIN, 0 IGP costs), then based |
607 | on the RFC4271 decision process speaker 4 will choose X:2 over Y:3:100, based | |
608 | on the lower ID of 2. Speaker 4 advertises X:2 to speaker 5. Speaker 5 will | |
609 | continue to prefer Y:1:200 based on the ID, and advertise this to speaker 4. | |
610 | Speaker 4 will now have the full set of routes, and the Y:1:200 it receives | |
611 | from 5 will beat X:2, but when speaker 4 compares Y:1:200 to Y:3:100 the MED | |
612 | check now becomes active as the ASes match, and now Y:3:100 is preferred. | |
613 | Speaker 4 therefore now advertises Y:3:100 to 5, which will also agrees that | |
614 | Y:3:100 is preferred to Y:1:200, and so withdraws the latter route from 4. | |
615 | Speaker 4 now has only X:2 and Y:3:100, and X:2 beats Y:3:100, and so speaker 4 | |
616 | implicitly updates its route to speaker 5 to X:2. Speaker 5 sees that Y:1:200 | |
617 | beats X:2 based on the ID, and advertises Y:1:200 to speaker 4, and the cycle | |
618 | continues. | |
42fc5d26 QY |
619 | |
620 | The root cause is the lack of a clear order of preference caused by how MED | |
621 | sometimes is and sometimes is not compared, leading to this cycle in the | |
622 | preferences between the routes: | |
623 | ||
624 | :: | |
625 | ||
c1a54c05 QY |
626 | . |
627 | /---> X:2 ---beats---> Y:3:100 --\\ | |
628 | | | | |
629 | | | | |
630 | \\---beats--- Y:1:200 <---beats---/ | |
c3c5a71f | 631 | |
42fc5d26 | 632 | |
42fc5d26 QY |
633 | |
634 | This particular type of oscillation in full-mesh iBGP topologies can be | |
635 | avoided by speakers preferring already selected, external routes rather than | |
c1a54c05 QY |
636 | choosing to update to new a route based on a post-MED metric (e.g. router-ID), |
637 | at the cost of a non-deterministic selection process. FRR implements this, as | |
638 | do many other implementations, so long as it is not overridden by setting | |
9e146a81 | 639 | :clicmd:`bgp bestpath compare-routerid`, and see also |
8fcedbd2 | 640 | :ref:`bgp-route-selection`. |
42fc5d26 QY |
641 | |
642 | However, more complex and insidious cycles of oscillation are possible with | |
c3c5a71f | 643 | iBGP route-reflection, which are not so easily avoided. These have been |
c1a54c05 QY |
644 | documented in various places. See, e.g.: |
645 | ||
646 | - [bgp-route-osci-cond]_ | |
647 | - [stable-flexible-ibgp]_ | |
648 | - [ibgp-correctness]_ | |
649 | ||
650 | for concrete examples and further references. | |
651 | ||
652 | There is as of this writing *no* known way to use MED for its original purpose; | |
653 | *and* reduce routing information in iBGP topologies; *and* be sure to avoid the | |
654 | instability problems of MED due the non-transitive routing preferences it can | |
655 | induce; in general on arbitrary networks. | |
656 | ||
657 | There may be iBGP topology specific ways to reduce the instability risks, even | |
658 | while using MED, e.g.: by constraining the reflection topology and by tuning | |
013f9762 | 659 | IGP costs between route-reflector clusters, see :rfc:`3345` for details. In the |
c1a54c05 QY |
660 | near future, the Add-Path extension to BGP may also solve MED oscillation while |
661 | still allowing MED to be used as intended, by distributing "best-paths per | |
662 | neighbour AS". This would be at the cost of distributing at least as many | |
663 | routes to all speakers as a full-mesh iBGP would, if not more, while also | |
664 | imposing similar CPU overheads as the "Deterministic MED" feature at each | |
665 | Add-Path reflector. | |
42fc5d26 QY |
666 | |
667 | More generally, the instability problems that MED can introduce on more | |
668 | complex, non-full-mesh, iBGP topologies may be avoided either by: | |
669 | ||
013f9762 | 670 | - Setting :clicmd:`bgp always-compare-med`, however this allows MED to be compared |
42fc5d26 QY |
671 | across values set by different neighbour ASes, which may not produce |
672 | coherent desirable results, of itself. | |
4b44467c | 673 | - Effectively ignoring MED by setting MED to the same value (e.g.: 0) using |
013f9762 QY |
674 | :clicmd:`set metric METRIC` on all received routes, in combination with |
675 | setting :clicmd:`bgp always-compare-med` on all speakers. This is the simplest | |
42fc5d26 QY |
676 | and most performant way to avoid MED oscillation issues, where an AS is happy |
677 | not to allow neighbours to inject this problematic metric. | |
678 | ||
42fc5d26 QY |
679 | As MED is evaluated after the AS_PATH length check, another possible use for |
680 | MED is for intra-AS steering of routes with equal AS_PATH length, as an | |
c1a54c05 QY |
681 | extension of the last case above. As MED is evaluated before IGP metric, this |
682 | can allow cold-potato routing to be implemented to send traffic to preferred | |
683 | hand-offs with neighbours, rather than the closest hand-off according to the | |
684 | IGP metric. | |
685 | ||
686 | Note that even if action is taken to address the MED non-transitivity issues, | |
687 | other oscillations may still be possible. E.g., on IGP cost if iBGP and IGP | |
688 | topologies are at cross-purposes with each other - see the Flavel and Roughan | |
689 | paper above for an example. Hence the guideline that the iBGP topology should | |
690 | follow the IGP topology. | |
691 | ||
c3c5a71f | 692 | .. index:: bgp deterministic-med |
29adcd50 | 693 | .. clicmd:: bgp deterministic-med |
42fc5d26 | 694 | |
c1a54c05 QY |
695 | Carry out route-selection in way that produces deterministic answers |
696 | locally, even in the face of MED and the lack of a well-defined order of | |
697 | preference it can induce on routes. Without this option the preferred route | |
698 | with MED may be determined largely by the order that routes were received | |
699 | in. | |
42fc5d26 | 700 | |
c1a54c05 QY |
701 | Setting this option will have a performance cost that may be noticeable when |
702 | there are many routes for each destination. Currently in FRR it is | |
703 | implemented in a way that scales poorly as the number of routes per | |
704 | destination increases. | |
42fc5d26 | 705 | |
c1a54c05 | 706 | The default is that this option is not set. |
42fc5d26 QY |
707 | |
708 | Note that there are other sources of indeterminism in the route selection | |
709 | process, specifically, the preference for older and already selected routes | |
8fcedbd2 | 710 | from eBGP peers, :ref:`bgp-route-selection`. |
42fc5d26 | 711 | |
c3c5a71f | 712 | .. index:: bgp always-compare-med |
29adcd50 | 713 | .. clicmd:: bgp always-compare-med |
42fc5d26 | 714 | |
c1a54c05 QY |
715 | Always compare the MED on routes, even when they were received from |
716 | different neighbouring ASes. Setting this option makes the order of | |
717 | preference of routes more defined, and should eliminate MED induced | |
718 | oscillations. | |
42fc5d26 | 719 | |
c1a54c05 | 720 | If using this option, it may also be desirable to use |
9e146a81 | 721 | :clicmd:`set metric METRIC` to set MED to 0 on routes received from external |
c1a54c05 | 722 | neighbours. |
42fc5d26 | 723 | |
9e146a81 QY |
724 | This option can be used, together with :clicmd:`set metric METRIC` to use |
725 | MED as an intra-AS metric to steer equal-length AS_PATH routes to, e.g., | |
726 | desired exit points. | |
42fc5d26 | 727 | |
efcb2ebb | 728 | |
729 | .. _bgp-graceful-restart: | |
730 | ||
731 | Graceful Restart | |
732 | ---------------- | |
733 | ||
734 | BGP graceful restart functionality as defined in | |
735 | `RFC-4724 <https://tools.ietf.org/html/rfc4724/>`_ defines the mechanisms that | |
736 | allows BGP speaker to continue to forward data packets along known routes | |
737 | while the routing protocol information is being restored. | |
738 | ||
739 | ||
740 | Usually, when BGP on a router restarts, all the BGP peers detect that the | |
741 | session went down and then came up. This "down/up" transition results in a | |
742 | "routing flap" and causes BGP route re-computation, generation of BGP routing | |
743 | updates, and unnecessary churn to the forwarding tables. | |
744 | ||
745 | The following functionality is provided by graceful restart: | |
746 | ||
747 | 1. The feature allows the restarting router to indicate to the helping peer the | |
748 | routes it can preserve in its forwarding plane during control plane restart | |
749 | by sending graceful restart capability in the OPEN message sent during | |
750 | session establishment. | |
751 | 2. The feature allows helping router to advertise to all other peers the routes | |
752 | received from the restarting router which are preserved in the forwarding | |
753 | plane of the restarting router during control plane restart. | |
754 | ||
755 | ||
756 | :: | |
757 | ||
758 | ||
759 | ||
760 | (R1)-----------------------------------------------------------------(R2) | |
761 | ||
762 | 1. BGP Graceful Restart Capability exchanged between R1 & R2. | |
763 | ||
764 | <---------------------------------------------------------------------> | |
765 | ||
766 | 2. Kill BGP Process at R1. | |
767 | ||
768 | ----------------------------------------------------------------------> | |
769 | ||
770 | 3. R2 Detects the above BGP Restart & verifies BGP Restarting | |
771 | Capability of R1. | |
772 | ||
773 | 4. Start BGP Process at R1. | |
774 | ||
775 | 5. Re-establish the BGP session between R1 & R2. | |
776 | ||
777 | <---------------------------------------------------------------------> | |
778 | ||
779 | 6. R2 Send initial route updates, followed by End-Of-Rib. | |
780 | ||
781 | <---------------------------------------------------------------------- | |
782 | ||
783 | 7. R1 was waiting for End-Of-Rib from R2 & which has been received | |
784 | now. | |
785 | ||
786 | 8. R1 now runs BGP Best-Path algorithm. Send Initial BGP Update, | |
787 | followed by End-Of Rib | |
788 | ||
789 | <---------------------------------------------------------------------> | |
790 | ||
791 | ||
792 | .. _bgp-end-of-rib-message: | |
793 | ||
794 | End-of-RIB (EOR) message | |
795 | ^^^^^^^^^^^^^^^^^^^^^^^^ | |
796 | ||
797 | An UPDATE message with no reachable Network Layer Reachability Information | |
798 | (NLRI) and empty withdrawn NLRI is specified as the End-of-RIB marker that can | |
799 | be used by a BGP speaker to indicate to its peer the completion of the initial | |
800 | routing update after the session is established. | |
801 | ||
802 | For the IPv4 unicast address family, the End-of-RIB marker is an UPDATE message | |
803 | with the minimum length. For any other address family, it is an UPDATE message | |
804 | that contains only the MP_UNREACH_NLRI attribute with no withdrawn routes for | |
805 | that <AFI, SAFI>. | |
806 | ||
807 | Although the End-of-RIB marker is specified for the purpose of BGP graceful | |
808 | restart, it is noted that the generation of such a marker upon completion of | |
809 | the initial update would be useful for routing convergence in general, and thus | |
810 | the practice is recommended. | |
811 | ||
812 | .. _bgp-route-selection-deferral-timer: | |
813 | ||
814 | Route Selection Deferral Timer | |
815 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
816 | ||
817 | Specifies the time the restarting router defers the route selection process | |
818 | after restart. | |
819 | ||
820 | Restarting Router : The usage of route election deferral timer is specified | |
821 | in https://tools.ietf.org/html/rfc4724#section-4.1 | |
822 | ||
823 | Once the session between the Restarting Speaker and the Receiving Speaker is | |
824 | re-established, the Restarting Speaker will receive and process BGP messages | |
825 | from its peers. | |
826 | ||
827 | However, it MUST defer route selection for an address family until it either. | |
828 | ||
829 | 1. Receives the End-of-RIB marker from all its peers (excluding the ones with | |
830 | the "Restart State" bit set in the received capability and excluding the ones | |
831 | that do not advertise the graceful restart capability). | |
832 | 2. The Selection_Deferral_Timer timeout. | |
833 | ||
834 | .. index:: bgp graceful-restart select-defer-time (0-3600) | |
835 | .. clicmd:: bgp graceful-restart select-defer-time (0-3600) | |
836 | ||
837 | This is command, will set deferral time to value specified. | |
838 | ||
839 | ||
840 | .. index:: bgp graceful-restart rib-stale-time (1-3600) | |
841 | .. clicmd:: bgp graceful-restart rib-stale-time (1-3600) | |
842 | ||
843 | This is command, will set the time for which stale routes are kept in RIB. | |
844 | ||
845 | .. _bgp-per-peer-graceful-restart: | |
846 | ||
847 | BGP Per Peer Graceful Restart | |
848 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
849 | ||
850 | Ability to enable and disable graceful restart, helper and no GR at all mode | |
851 | functionality at peer level. | |
852 | ||
853 | So bgp graceful restart can be enabled at modes global BGP level or at per | |
854 | peer level. There are two FSM, one for BGP GR global mode and other for peer | |
855 | per GR. | |
856 | ||
857 | Default global mode is helper and default peer per mode is inherit from global. | |
858 | If per peer mode is configured, the GR mode of this particular peer will | |
859 | override the global mode. | |
860 | ||
2ba1fe69 | 861 | .. _bgp-GR-global-mode-cmd: |
efcb2ebb | 862 | |
863 | BGP GR Global Mode Commands | |
864 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
865 | ||
866 | .. index:: bgp graceful-restart | |
867 | .. clicmd:: bgp graceful-restart | |
868 | ||
869 | This command will enable BGP graceful restart ifunctionality at the global | |
870 | level. | |
871 | ||
872 | .. index:: bgp graceful-restart disable | |
873 | .. clicmd:: bgp graceful-restart disable | |
874 | ||
875 | This command will disable both the functionality graceful restart and helper | |
876 | mode. | |
877 | ||
878 | ||
879 | .. _bgp-GR-peer-mode-cmd: | |
880 | ||
881 | BGP GR Peer Mode Commands | |
882 | ^^^^^^^^^^^^^^^^^^^^^^^^^ | |
883 | ||
884 | .. index:: neighbor A.B.C.D graceful-restart | |
885 | .. clicmd:: neighbor A.B.C.D graceful-restart | |
886 | ||
887 | This command will enable BGP graceful restart ifunctionality at the peer | |
888 | level. | |
889 | ||
890 | .. index:: neighbor A.B.C.D graceful-restart-helper | |
891 | .. clicmd:: neighbor A.B.C.D graceful-restart-helper | |
892 | ||
893 | This command will enable BGP graceful restart helper only functionality | |
894 | at the peer level. | |
895 | ||
896 | .. index:: neighbor A.B.C.D graceful-restart-disable | |
897 | .. clicmd:: neighbor A.B.C.D graceful-restart-disable | |
898 | ||
899 | This command will disable the entire BGP graceful restart functionality | |
900 | at the peer level. | |
901 | ||
902 | ||
0efdf0fe | 903 | .. _bgp-network: |
42fc5d26 | 904 | |
8fcedbd2 QY |
905 | Networks |
906 | -------- | |
42fc5d26 | 907 | |
c1a54c05 QY |
908 | .. index:: network A.B.C.D/M |
909 | .. clicmd:: network A.B.C.D/M | |
42fc5d26 | 910 | |
9eb95b3b | 911 | This command adds the announcement network. |
c3c5a71f | 912 | |
9eb95b3b QY |
913 | .. code-block:: frr |
914 | ||
915 | router bgp 1 | |
916 | address-family ipv4 unicast | |
917 | network 10.0.0.0/8 | |
918 | exit-address-family | |
42fc5d26 | 919 | |
c1a54c05 QY |
920 | This configuration example says that network 10.0.0.0/8 will be |
921 | announced to all neighbors. Some vendors' routers don't advertise | |
922 | routes if they aren't present in their IGP routing tables; `bgpd` | |
923 | doesn't care about IGP routes when announcing its routes. | |
c3c5a71f | 924 | |
c1a54c05 QY |
925 | .. index:: no network A.B.C.D/M |
926 | .. clicmd:: no network A.B.C.D/M | |
42fc5d26 | 927 | |
f990a416 DS |
928 | .. index:: [no] bgp network import-check |
929 | .. clicmd:: [no] bgp network import-check | |
930 | ||
931 | This configuration modifies the behavior of the network statement. | |
932 | If you have this configured the underlying network must exist in | |
933 | the rib. If you have the [no] form configured then BGP will not | |
934 | check for the networks existence in the rib. For versions 7.3 and | |
935 | before frr defaults for datacenter were the network must exist, | |
936 | traditional did not check for existence. For versions 7.4 and beyond | |
937 | both traditional and datacenter the network must exist. | |
938 | ||
8fcedbd2 | 939 | .. _bgp-route-aggregation: |
42fc5d26 QY |
940 | |
941 | Route Aggregation | |
942 | ----------------- | |
943 | ||
5101fece | 944 | .. _bgp-route-aggregation-ipv4: |
945 | ||
946 | Route Aggregation-IPv4 Address Family | |
947 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
948 | ||
c1a54c05 QY |
949 | .. index:: aggregate-address A.B.C.D/M |
950 | .. clicmd:: aggregate-address A.B.C.D/M | |
c3c5a71f | 951 | |
c1a54c05 | 952 | This command specifies an aggregate address. |
42fc5d26 | 953 | |
ac2201bb DA |
954 | .. index:: aggregate-address A.B.C.D/M route-map NAME |
955 | .. clicmd:: aggregate-address A.B.C.D/M route-map NAME | |
956 | ||
957 | Apply a route-map for an aggregated prefix. | |
958 | ||
a87d2ef7 DA |
959 | .. index:: aggregate-address A.B.C.D/M origin <egp|igp|incomplete> |
960 | .. clicmd:: aggregate-address A.B.C.D/M origin <egp|igp|incomplete> | |
961 | ||
962 | Override ORIGIN for an aggregated prefix. | |
963 | ||
c1a54c05 QY |
964 | .. index:: aggregate-address A.B.C.D/M as-set |
965 | .. clicmd:: aggregate-address A.B.C.D/M as-set | |
42fc5d26 | 966 | |
c1a54c05 QY |
967 | This command specifies an aggregate address. Resulting routes include |
968 | AS set. | |
42fc5d26 | 969 | |
c1a54c05 QY |
970 | .. index:: aggregate-address A.B.C.D/M summary-only |
971 | .. clicmd:: aggregate-address A.B.C.D/M summary-only | |
c3c5a71f | 972 | |
d1e7591e | 973 | This command specifies an aggregate address. Aggregated routes will |
b91bf5bd | 974 | not be announced. |
42fc5d26 | 975 | |
c1a54c05 QY |
976 | .. index:: no aggregate-address A.B.C.D/M |
977 | .. clicmd:: no aggregate-address A.B.C.D/M | |
ac2201bb | 978 | |
5101fece | 979 | This command removes an aggregate address. |
980 | ||
981 | ||
ac2201bb | 982 | This configuration example setup the aggregate-address under |
5101fece | 983 | ipv4 address-family. |
984 | ||
985 | .. code-block:: frr | |
986 | ||
987 | router bgp 1 | |
988 | address-family ipv4 unicast | |
989 | aggregate-address 10.0.0.0/8 | |
990 | aggregate-address 20.0.0.0/8 as-set | |
991 | aggregate-address 40.0.0.0/8 summary-only | |
ac2201bb | 992 | aggregate-address 50.0.0.0/8 route-map aggr-rmap |
5101fece | 993 | exit-address-family |
994 | ||
995 | ||
996 | .. _bgp-route-aggregation-ipv6: | |
997 | ||
998 | Route Aggregation-IPv6 Address Family | |
999 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
1000 | ||
1001 | .. index:: aggregate-address X:X::X:X/M | |
1002 | .. clicmd:: aggregate-address X:X::X:X/M | |
1003 | ||
1004 | This command specifies an aggregate address. | |
1005 | ||
ac2201bb DA |
1006 | .. index:: aggregate-address X:X::X:X/M route-map NAME |
1007 | .. clicmd:: aggregate-address X:X::X:X/M route-map NAME | |
1008 | ||
1009 | Apply a route-map for an aggregated prefix. | |
1010 | ||
a87d2ef7 DA |
1011 | .. index:: aggregate-address X:X::X:X/M origin <egp|igp|incomplete> |
1012 | .. clicmd:: aggregate-address X:X::X:X/M origin <egp|igp|incomplete> | |
1013 | ||
1014 | Override ORIGIN for an aggregated prefix. | |
1015 | ||
5101fece | 1016 | .. index:: aggregate-address X:X::X:X/M as-set |
1017 | .. clicmd:: aggregate-address X:X::X:X/M as-set | |
1018 | ||
1019 | This command specifies an aggregate address. Resulting routes include | |
1020 | AS set. | |
1021 | ||
1022 | .. index:: aggregate-address X:X::X:X/M summary-only | |
1023 | .. clicmd:: aggregate-address X:X::X:X/M summary-only | |
1024 | ||
1025 | This command specifies an aggregate address. Aggregated routes will | |
b91bf5bd | 1026 | not be announced. |
5101fece | 1027 | |
1028 | .. index:: no aggregate-address X:X::X:X/M | |
1029 | .. clicmd:: no aggregate-address X:X::X:X/M | |
1030 | ||
1031 | This command removes an aggregate address. | |
1032 | ||
1033 | ||
ac2201bb DA |
1034 | This configuration example setup the aggregate-address under |
1035 | ipv6 address-family. | |
5101fece | 1036 | |
1037 | .. code-block:: frr | |
1038 | ||
1039 | router bgp 1 | |
1040 | address-family ipv6 unicast | |
1041 | aggregate-address 10::0/64 | |
ac2201bb DA |
1042 | aggregate-address 20::0/64 as-set |
1043 | aggregate-address 40::0/64 summary-only | |
1044 | aggregate-address 50::0/64 route-map aggr-rmap | |
5101fece | 1045 | exit-address-family |
c3c5a71f | 1046 | |
8fcedbd2 | 1047 | .. _bgp-redistribute-to-bgp: |
42fc5d26 | 1048 | |
8fcedbd2 QY |
1049 | Redistribution |
1050 | -------------- | |
42fc5d26 | 1051 | |
c3c5a71f | 1052 | .. index:: redistribute kernel |
29adcd50 | 1053 | .. clicmd:: redistribute kernel |
42fc5d26 | 1054 | |
c1a54c05 | 1055 | Redistribute kernel route to BGP process. |
42fc5d26 | 1056 | |
c3c5a71f | 1057 | .. index:: redistribute static |
29adcd50 | 1058 | .. clicmd:: redistribute static |
42fc5d26 | 1059 | |
c1a54c05 | 1060 | Redistribute static route to BGP process. |
42fc5d26 | 1061 | |
c3c5a71f | 1062 | .. index:: redistribute connected |
29adcd50 | 1063 | .. clicmd:: redistribute connected |
42fc5d26 | 1064 | |
c1a54c05 | 1065 | Redistribute connected route to BGP process. |
42fc5d26 | 1066 | |
c3c5a71f | 1067 | .. index:: redistribute rip |
29adcd50 | 1068 | .. clicmd:: redistribute rip |
42fc5d26 | 1069 | |
c1a54c05 | 1070 | Redistribute RIP route to BGP process. |
42fc5d26 | 1071 | |
c3c5a71f | 1072 | .. index:: redistribute ospf |
29adcd50 | 1073 | .. clicmd:: redistribute ospf |
42fc5d26 | 1074 | |
c1a54c05 | 1075 | Redistribute OSPF route to BGP process. |
42fc5d26 | 1076 | |
99ad55e0 DA |
1077 | .. index:: redistribute vnc |
1078 | .. clicmd:: redistribute vnc | |
42fc5d26 | 1079 | |
c1a54c05 | 1080 | Redistribute VNC routes to BGP process. |
42fc5d26 | 1081 | |
245d354f DA |
1082 | .. index:: redistribute vnc-direct |
1083 | .. clicmd:: redistribute vnc-direct | |
1084 | ||
1085 | Redistribute VNC direct (not via zebra) routes to BGP process. | |
1086 | ||
c1a54c05 QY |
1087 | .. index:: update-delay MAX-DELAY |
1088 | .. clicmd:: update-delay MAX-DELAY | |
c3c5a71f | 1089 | |
c1a54c05 QY |
1090 | .. index:: update-delay MAX-DELAY ESTABLISH-WAIT |
1091 | .. clicmd:: update-delay MAX-DELAY ESTABLISH-WAIT | |
c3c5a71f | 1092 | |
c1a54c05 QY |
1093 | This feature is used to enable read-only mode on BGP process restart or when |
1094 | BGP process is cleared using 'clear ip bgp \*'. When applicable, read-only | |
1095 | mode would begin as soon as the first peer reaches Established status and a | |
1096 | timer for max-delay seconds is started. | |
42fc5d26 | 1097 | |
c1a54c05 QY |
1098 | During this mode BGP doesn't run any best-path or generate any updates to its |
1099 | peers. This mode continues until: | |
42fc5d26 | 1100 | |
c1a54c05 QY |
1101 | 1. All the configured peers, except the shutdown peers, have sent explicit EOR |
1102 | (End-Of-RIB) or an implicit-EOR. The first keep-alive after BGP has reached | |
1103 | Established is considered an implicit-EOR. | |
1104 | If the establish-wait optional value is given, then BGP will wait for | |
d1e7591e | 1105 | peers to reach established from the beginning of the update-delay till the |
c1a54c05 QY |
1106 | establish-wait period is over, i.e. the minimum set of established peers for |
1107 | which EOR is expected would be peers established during the establish-wait | |
1108 | window, not necessarily all the configured neighbors. | |
1109 | 2. max-delay period is over. | |
42fc5d26 | 1110 | |
c1a54c05 QY |
1111 | On hitting any of the above two conditions, BGP resumes the decision process |
1112 | and generates updates to its peers. | |
42fc5d26 | 1113 | |
c1a54c05 | 1114 | Default max-delay is 0, i.e. the feature is off by default. |
c3c5a71f | 1115 | |
c1a54c05 QY |
1116 | .. index:: table-map ROUTE-MAP-NAME |
1117 | .. clicmd:: table-map ROUTE-MAP-NAME | |
42fc5d26 | 1118 | |
c1a54c05 QY |
1119 | This feature is used to apply a route-map on route updates from BGP to |
1120 | Zebra. All the applicable match operations are allowed, such as match on | |
1121 | prefix, next-hop, communities, etc. Set operations for this attach-point are | |
1122 | limited to metric and next-hop only. Any operation of this feature does not | |
1123 | affect BGPs internal RIB. | |
42fc5d26 | 1124 | |
c1a54c05 QY |
1125 | Supported for ipv4 and ipv6 address families. It works on multi-paths as |
1126 | well, however, metric setting is based on the best-path only. | |
42fc5d26 | 1127 | |
8fcedbd2 | 1128 | .. _bgp-peers: |
42fc5d26 | 1129 | |
8fcedbd2 QY |
1130 | Peers |
1131 | ----- | |
42fc5d26 | 1132 | |
8fcedbd2 | 1133 | .. _bgp-defining-peers: |
42fc5d26 | 1134 | |
8fcedbd2 QY |
1135 | Defining Peers |
1136 | ^^^^^^^^^^^^^^ | |
42fc5d26 | 1137 | |
c1a54c05 QY |
1138 | .. index:: neighbor PEER remote-as ASN |
1139 | .. clicmd:: neighbor PEER remote-as ASN | |
42fc5d26 | 1140 | |
c1a54c05 | 1141 | Creates a new neighbor whose remote-as is ASN. PEER can be an IPv4 address |
9eb95b3b | 1142 | or an IPv6 address or an interface to use for the connection. |
76bd1499 | 1143 | |
9eb95b3b QY |
1144 | .. code-block:: frr |
1145 | ||
1146 | router bgp 1 | |
1147 | neighbor 10.0.0.1 remote-as 2 | |
76bd1499 | 1148 | |
c1a54c05 | 1149 | In this case my router, in AS-1, is trying to peer with AS-2 at 10.0.0.1. |
76bd1499 | 1150 | |
c1a54c05 | 1151 | This command must be the first command used when configuring a neighbor. If |
9eb95b3b | 1152 | the remote-as is not specified, *bgpd* will complain like this: :: |
76bd1499 | 1153 | |
c1a54c05 | 1154 | can't find neighbor 10.0.0.1 |
c3c5a71f | 1155 | |
5413757f DS |
1156 | .. index:: neighbor PEER remote-as internal |
1157 | .. clicmd:: neighbor PEER remote-as internal | |
1158 | ||
1159 | Create a peer as you would when you specify an ASN, except that if the | |
1160 | peers ASN is different than mine as specified under the :clicmd:`router bgp ASN` | |
1161 | command the connection will be denied. | |
1162 | ||
1163 | .. index:: neighbor PEER remote-as external | |
1164 | .. clicmd:: neighbor PEER remote-as external | |
1165 | ||
1166 | Create a peer as you would when you specify an ASN, except that if the | |
1167 | peers ASN is the same as mine as specified under the :clicmd:`router bgp ASN` | |
1168 | command the connection will be denied. | |
42fc5d26 | 1169 | |
d7b9898c DA |
1170 | .. index:: [no] bgp listen range <A.B.C.D/M|X:X::X:X/M> peer-group PGNAME |
1171 | .. clicmd:: [no] bgp listen range <A.B.C.D/M|X:X::X:X/M> peer-group PGNAME | |
d79e0e08 QY |
1172 | |
1173 | Accept connections from any peers in the specified prefix. Configuration | |
1174 | from the specified peer-group is used to configure these peers. | |
1175 | ||
1176 | .. note:: | |
1177 | ||
1178 | When using BGP listen ranges, if the associated peer group has TCP MD5 | |
1179 | authentication configured, your kernel must support this on prefixes. On | |
1180 | Linux, this support was added in kernel version 4.14. If your kernel does | |
1181 | not support this feature you will get a warning in the log file, and the | |
1182 | listen range will only accept connections from peers without MD5 configured. | |
1183 | ||
1184 | Additionally, we have observed that when using this option at scale (several | |
1185 | hundred peers) the kernel may hit its option memory limit. In this situation | |
1186 | you will see error messages like: | |
1187 | ||
1188 | ``bgpd: sockopt_tcp_signature: setsockopt(23): Cannot allocate memory`` | |
1189 | ||
1190 | In this case you need to increase the value of the sysctl | |
1191 | ``net.core.optmem_max`` to allow the kernel to allocate the necessary option | |
1192 | memory. | |
1193 | ||
8fcedbd2 | 1194 | .. _bgp-configuring-peers: |
42fc5d26 | 1195 | |
8fcedbd2 QY |
1196 | Configuring Peers |
1197 | ^^^^^^^^^^^^^^^^^ | |
42fc5d26 | 1198 | |
c0868e8b QY |
1199 | .. index:: [no] neighbor PEER shutdown |
1200 | .. clicmd:: [no] neighbor PEER shutdown | |
c3c5a71f | 1201 | |
c1a54c05 QY |
1202 | Shutdown the peer. We can delete the neighbor's configuration by |
1203 | ``no neighbor PEER remote-as ASN`` but all configuration of the neighbor | |
1204 | will be deleted. When you want to preserve the configuration, but want to | |
1205 | drop the BGP peer, use this syntax. | |
c3c5a71f | 1206 | |
c0868e8b QY |
1207 | .. index:: [no] neighbor PEER disable-connected-check |
1208 | .. clicmd:: [no] neighbor PEER disable-connected-check | |
c3c5a71f | 1209 | |
c0868e8b QY |
1210 | Allow peerings between directly connected eBGP peers using loopback |
1211 | addresses. | |
c3c5a71f | 1212 | |
c0868e8b QY |
1213 | .. index:: [no] neighbor PEER ebgp-multihop |
1214 | .. clicmd:: [no] neighbor PEER ebgp-multihop | |
42fc5d26 | 1215 | |
c0868e8b QY |
1216 | .. index:: [no] neighbor PEER description ... |
1217 | .. clicmd:: [no] neighbor PEER description ... | |
42fc5d26 | 1218 | |
c1a54c05 | 1219 | Set description of the peer. |
42fc5d26 | 1220 | |
c0868e8b QY |
1221 | .. index:: [no] neighbor PEER version VERSION |
1222 | .. clicmd:: [no] neighbor PEER version VERSION | |
42fc5d26 | 1223 | |
4da7fda3 QY |
1224 | Set up the neighbor's BGP version. `version` can be `4`, `4+` or `4-`. BGP |
1225 | version `4` is the default value used for BGP peering. BGP version `4+` | |
1226 | means that the neighbor supports Multiprotocol Extensions for BGP-4. BGP | |
1227 | version `4-` is similar but the neighbor speaks the old Internet-Draft | |
1228 | revision 00's Multiprotocol Extensions for BGP-4. Some routing software is | |
1229 | still using this version. | |
42fc5d26 | 1230 | |
c0868e8b QY |
1231 | .. index:: [no] neighbor PEER interface IFNAME |
1232 | .. clicmd:: [no] neighbor PEER interface IFNAME | |
42fc5d26 | 1233 | |
c1a54c05 QY |
1234 | When you connect to a BGP peer over an IPv6 link-local address, you have to |
1235 | specify the IFNAME of the interface used for the connection. To specify | |
1236 | IPv4 session addresses, see the ``neighbor PEER update-source`` command | |
1237 | below. | |
42fc5d26 | 1238 | |
c1a54c05 QY |
1239 | This command is deprecated and may be removed in a future release. Its use |
1240 | should be avoided. | |
42fc5d26 | 1241 | |
c0868e8b QY |
1242 | .. index:: [no] neighbor PEER next-hop-self [all] |
1243 | .. clicmd:: [no] neighbor PEER next-hop-self [all] | |
42fc5d26 | 1244 | |
c1a54c05 QY |
1245 | This command specifies an announced route's nexthop as being equivalent to |
1246 | the address of the bgp router if it is learned via eBGP. If the optional | |
d1e7591e | 1247 | keyword `all` is specified the modification is done also for routes learned |
c1a54c05 | 1248 | via iBGP. |
42fc5d26 | 1249 | |
8b0d734b | 1250 | .. index:: neighbor PEER attribute-unchanged [{as-path|next-hop|med}] |
1251 | .. clicmd:: neighbor PEER attribute-unchanged [{as-path|next-hop|med}] | |
1252 | ||
1253 | This command specifies attributes to be left unchanged for advertisements | |
1254 | sent to a peer. Use this to leave the next-hop unchanged in ipv6 | |
1255 | configurations, as the route-map directive to leave the next-hop unchanged | |
1256 | is only available for ipv4. | |
1257 | ||
c0868e8b QY |
1258 | .. index:: [no] neighbor PEER update-source <IFNAME|ADDRESS> |
1259 | .. clicmd:: [no] neighbor PEER update-source <IFNAME|ADDRESS> | |
42fc5d26 | 1260 | |
c1a54c05 QY |
1261 | Specify the IPv4 source address to use for the :abbr:`BGP` session to this |
1262 | neighbour, may be specified as either an IPv4 address directly or as an | |
1263 | interface name (in which case the *zebra* daemon MUST be running in order | |
9eb95b3b QY |
1264 | for *bgpd* to be able to retrieve interface state). |
1265 | ||
1266 | .. code-block:: frr | |
42fc5d26 | 1267 | |
c1a54c05 QY |
1268 | router bgp 64555 |
1269 | neighbor foo update-source 192.168.0.1 | |
1270 | neighbor bar update-source lo0 | |
42fc5d26 | 1271 | |
42fc5d26 | 1272 | |
c0868e8b QY |
1273 | .. index:: [no] neighbor PEER default-originate |
1274 | .. clicmd:: [no] neighbor PEER default-originate | |
42fc5d26 | 1275 | |
4da7fda3 QY |
1276 | *bgpd*'s default is to not announce the default route (0.0.0.0/0) even if it |
1277 | is in routing table. When you want to announce default routes to the peer, | |
1278 | use this command. | |
42fc5d26 | 1279 | |
c1a54c05 QY |
1280 | .. index:: neighbor PEER port PORT |
1281 | .. clicmd:: neighbor PEER port PORT | |
42fc5d26 | 1282 | |
e7c105a7 DS |
1283 | .. index:: [no] neighbor PEER password PASSWORD |
1284 | .. clicmd:: [no] neighbor PEER password PASSWORD | |
1285 | ||
1286 | Set a MD5 password to be used with the tcp socket that is being used | |
1287 | to connect to the remote peer. Please note if you are using this | |
1288 | command with a large number of peers on linux you should consider | |
1289 | modifying the `net.core.optmem_max` sysctl to a larger value to | |
1290 | avoid out of memory errors from the linux kernel. | |
1291 | ||
c1a54c05 QY |
1292 | .. index:: neighbor PEER send-community |
1293 | .. clicmd:: neighbor PEER send-community | |
42fc5d26 | 1294 | |
c0868e8b QY |
1295 | .. index:: [no] neighbor PEER weight WEIGHT |
1296 | .. clicmd:: [no] neighbor PEER weight WEIGHT | |
42fc5d26 | 1297 | |
c1a54c05 | 1298 | This command specifies a default `weight` value for the neighbor's routes. |
42fc5d26 | 1299 | |
c0868e8b QY |
1300 | .. index:: [no] neighbor PEER maximum-prefix NUMBER |
1301 | .. clicmd:: [no] neighbor PEER maximum-prefix NUMBER | |
42fc5d26 | 1302 | |
886026c8 QY |
1303 | Sets a maximum number of prefixes we can receive from a given peer. If this |
1304 | number is exceeded, the BGP session will be destroyed. | |
1305 | ||
1306 | In practice, it is generally preferable to use a prefix-list to limit what | |
1307 | prefixes are received from the peer instead of using this knob. Tearing down | |
1308 | the BGP session when a limit is exceeded is far more destructive than merely | |
1309 | rejecting undesired prefixes. The prefix-list method is also much more | |
1310 | granular and offers much smarter matching criterion than number of received | |
1311 | prefixes, making it more suited to implementing policy. | |
1312 | ||
edf98aa3 DA |
1313 | .. index:: [no] neighbor PEER maximum-prefix-out NUMBER |
1314 | .. clicmd:: [no] neighbor PEER maximum-prefix-out NUMBER | |
1315 | ||
1316 | Sets a maximum number of prefixes we can send to a given peer. | |
1317 | ||
886026c8 QY |
1318 | .. index:: [no] neighbor PEER local-as AS-NUMBER [no-prepend] [replace-as] |
1319 | .. clicmd:: [no] neighbor PEER local-as AS-NUMBER [no-prepend] [replace-as] | |
42fc5d26 | 1320 | |
c1a54c05 QY |
1321 | Specify an alternate AS for this BGP process when interacting with the |
1322 | specified peer. With no modifiers, the specified local-as is prepended to | |
1323 | the received AS_PATH when receiving routing updates from the peer, and | |
1324 | prepended to the outgoing AS_PATH (after the process local AS) when | |
1325 | transmitting local routes to the peer. | |
42fc5d26 | 1326 | |
c1a54c05 QY |
1327 | If the no-prepend attribute is specified, then the supplied local-as is not |
1328 | prepended to the received AS_PATH. | |
c3c5a71f | 1329 | |
c1a54c05 QY |
1330 | If the replace-as attribute is specified, then only the supplied local-as is |
1331 | prepended to the AS_PATH when transmitting local-route updates to this peer. | |
c3c5a71f | 1332 | |
c1a54c05 | 1333 | Note that replace-as can only be specified if no-prepend is. |
c3c5a71f | 1334 | |
c1a54c05 | 1335 | This command is only allowed for eBGP peers. |
c3c5a71f | 1336 | |
c0868e8b QY |
1337 | .. index:: [no] neighbor PEER ttl-security hops NUMBER |
1338 | .. clicmd:: [no] neighbor PEER ttl-security hops NUMBER | |
c3c5a71f | 1339 | |
c1a54c05 QY |
1340 | This command enforces Generalized TTL Security Mechanism (GTSM), as |
1341 | specified in RFC 5082. With this command, only neighbors that are the | |
1342 | specified number of hops away will be allowed to become neighbors. This | |
d1e7591e | 1343 | command is mutually exclusive with *ebgp-multihop*. |
42fc5d26 | 1344 | |
19f2b5e8 DS |
1345 | .. index:: [no] neighbor PEER capability extended-nexthop |
1346 | .. clicmd:: [no] neighbor PEER capability extended-nexthop | |
1347 | ||
1348 | Allow bgp to negotiate the extended-nexthop capability with it's peer. | |
1349 | If you are peering over a v6 LL address then this capability is turned | |
1350 | on automatically. If you are peering over a v6 Global Address then | |
1351 | turning on this command will allow BGP to install v4 routes with | |
1352 | v6 nexthops if you do not have v4 configured on interfaces. | |
1353 | ||
eb938189 DS |
1354 | .. index:: [no] bgp fast-external-failover |
1355 | .. clicmd:: [no] bgp fast-external-failover | |
1356 | ||
1357 | This command causes bgp to not take down ebgp peers immediately | |
1358 | when a link flaps. `bgp fast-external-failover` is the default | |
1359 | and will not be displayed as part of a `show run`. The no form | |
1360 | of the command turns off this ability. | |
1361 | ||
bc132029 DS |
1362 | .. index:: [no] bgp default ipv4-unicast |
1363 | .. clicmd:: [no] bgp default ipv4-unicast | |
1364 | ||
1365 | This command allows the user to specify that v4 peering is turned | |
1366 | on by default or not. This command defaults to on and is not displayed. | |
1367 | The `no bgp default ipv4-unicast` form of the command is displayed. | |
1368 | ||
e10dda57 DS |
1369 | .. index:: [no] neighbor PEER advertisement-interval (0-600) |
1370 | .. clicmd:: [no] neighbor PEER advertisement-interval (0-600) | |
1371 | ||
1372 | Setup the minimum route advertisement interval(mrai) for the | |
1373 | peer in question. This number is between 0 and 600 seconds, | |
1374 | with the default advertisement interval being 0. | |
1375 | ||
8fcedbd2 | 1376 | .. _bgp-peer-filtering: |
42fc5d26 | 1377 | |
8fcedbd2 QY |
1378 | Peer Filtering |
1379 | ^^^^^^^^^^^^^^ | |
42fc5d26 | 1380 | |
c1a54c05 QY |
1381 | .. index:: neighbor PEER distribute-list NAME [in|out] |
1382 | .. clicmd:: neighbor PEER distribute-list NAME [in|out] | |
42fc5d26 | 1383 | |
c1a54c05 QY |
1384 | This command specifies a distribute-list for the peer. `direct` is |
1385 | ``in`` or ``out``. | |
42fc5d26 | 1386 | |
c3c5a71f | 1387 | .. index:: neighbor PEER prefix-list NAME [in|out] |
29adcd50 | 1388 | .. clicmd:: neighbor PEER prefix-list NAME [in|out] |
42fc5d26 | 1389 | |
c1a54c05 | 1390 | .. index:: neighbor PEER filter-list NAME [in|out] |
29adcd50 | 1391 | .. clicmd:: neighbor PEER filter-list NAME [in|out] |
42fc5d26 | 1392 | |
c1a54c05 QY |
1393 | .. index:: neighbor PEER route-map NAME [in|out] |
1394 | .. clicmd:: neighbor PEER route-map NAME [in|out] | |
42fc5d26 | 1395 | |
c1a54c05 | 1396 | Apply a route-map on the neighbor. `direct` must be `in` or `out`. |
42fc5d26 | 1397 | |
c3c5a71f | 1398 | .. index:: bgp route-reflector allow-outbound-policy |
29adcd50 | 1399 | .. clicmd:: bgp route-reflector allow-outbound-policy |
42fc5d26 | 1400 | |
c1a54c05 QY |
1401 | By default, attribute modification via route-map policy out is not reflected |
1402 | on reflected routes. This option allows the modifications to be reflected as | |
1403 | well. Once enabled, it affects all reflected routes. | |
42fc5d26 | 1404 | |
583a9fd4 RZ |
1405 | .. index:: [no] neighbor PEER sender-as-path-loop-detection |
1406 | .. clicmd:: [no] neighbor PEER sender-as-path-loop-detection | |
1407 | ||
1408 | Enable the detection of sender side AS path loops and filter the | |
1409 | bad routes before they are sent. | |
1410 | ||
1411 | This setting is disabled by default. | |
1412 | ||
0efdf0fe | 1413 | .. _bgp-peer-group: |
42fc5d26 | 1414 | |
8fcedbd2 QY |
1415 | Peer Groups |
1416 | ^^^^^^^^^^^ | |
42fc5d26 | 1417 | |
199ad5c4 LB |
1418 | Peer groups are used to help improve scaling by generating the same |
1419 | update information to all members of a peer group. Note that this means | |
1420 | that the routes generated by a member of a peer group will be sent back | |
1421 | to that originating peer with the originator identifier attribute set to | |
1422 | indicated the originating peer. All peers not associated with a | |
1423 | specific peer group are treated as belonging to a default peer group, | |
1424 | and will share updates. | |
1425 | ||
c1a54c05 QY |
1426 | .. index:: neighbor WORD peer-group |
1427 | .. clicmd:: neighbor WORD peer-group | |
42fc5d26 | 1428 | |
c1a54c05 | 1429 | This command defines a new peer group. |
42fc5d26 | 1430 | |
d7b9898c DA |
1431 | .. index:: neighbor PEER peer-group PGNAME |
1432 | .. clicmd:: neighbor PEER peer-group PGNAME | |
c3c5a71f | 1433 | |
c1a54c05 | 1434 | This command bind specific peer to peer group WORD. |
42fc5d26 | 1435 | |
199ad5c4 LB |
1436 | .. index:: neighbor PEER solo |
1437 | .. clicmd:: neighbor PEER solo | |
1438 | ||
1439 | This command is used to indicate that routes advertised by the peer | |
1440 | should not be reflected back to the peer. This command only is only | |
1441 | meaningful when there is a single peer defined in the peer-group. | |
1442 | ||
8fcedbd2 QY |
1443 | Capability Negotiation |
1444 | ^^^^^^^^^^^^^^^^^^^^^^ | |
42fc5d26 | 1445 | |
8fcedbd2 QY |
1446 | .. index:: neighbor PEER strict-capability-match |
1447 | .. clicmd:: neighbor PEER strict-capability-match | |
42fc5d26 | 1448 | |
8fcedbd2 QY |
1449 | .. index:: no neighbor PEER strict-capability-match |
1450 | .. clicmd:: no neighbor PEER strict-capability-match | |
c1a54c05 | 1451 | |
8fcedbd2 QY |
1452 | Strictly compares remote capabilities and local capabilities. If |
1453 | capabilities are different, send Unsupported Capability error then reset | |
1454 | connection. | |
42fc5d26 | 1455 | |
8fcedbd2 QY |
1456 | You may want to disable sending Capability Negotiation OPEN message optional |
1457 | parameter to the peer when remote peer does not implement Capability | |
1458 | Negotiation. Please use *dont-capability-negotiate* command to disable the | |
1459 | feature. | |
42fc5d26 | 1460 | |
7cdc9530 DS |
1461 | .. index:: [no] neighbor PEER dont-capability-negotiate |
1462 | .. clicmd:: [no] neighbor PEER dont-capability-negotiate | |
42fc5d26 | 1463 | |
8fcedbd2 QY |
1464 | Suppress sending Capability Negotiation as OPEN message optional parameter |
1465 | to the peer. This command only affects the peer is configured other than | |
1466 | IPv4 unicast configuration. | |
42fc5d26 | 1467 | |
8fcedbd2 QY |
1468 | When remote peer does not have capability negotiation feature, remote peer |
1469 | will not send any capabilities at all. In that case, bgp configures the peer | |
1470 | with configured capabilities. | |
42fc5d26 | 1471 | |
8fcedbd2 QY |
1472 | You may prefer locally configured capabilities more than the negotiated |
1473 | capabilities even though remote peer sends capabilities. If the peer is | |
1474 | configured by *override-capability*, *bgpd* ignores received capabilities | |
1475 | then override negotiated capabilities with configured values. | |
42fc5d26 | 1476 | |
7cdc9530 DS |
1477 | Additionally the operator should be reminded that this feature fundamentally |
1478 | disables the ability to use widely deployed BGP features. BGP unnumbered, | |
1479 | hostname support, AS4, Addpath, Route Refresh, ORF, Dynamic Capabilities, | |
1480 | and graceful restart. | |
1481 | ||
8fcedbd2 QY |
1482 | .. index:: neighbor PEER override-capability |
1483 | .. clicmd:: neighbor PEER override-capability | |
42fc5d26 | 1484 | |
8fcedbd2 QY |
1485 | .. index:: no neighbor PEER override-capability |
1486 | .. clicmd:: no neighbor PEER override-capability | |
c1a54c05 | 1487 | |
8fcedbd2 QY |
1488 | Override the result of Capability Negotiation with local configuration. |
1489 | Ignore remote peer's capability value. | |
42fc5d26 | 1490 | |
8fcedbd2 | 1491 | .. _bgp-as-path-access-lists: |
42fc5d26 | 1492 | |
8fcedbd2 QY |
1493 | AS Path Access Lists |
1494 | -------------------- | |
42fc5d26 QY |
1495 | |
1496 | AS path access list is user defined AS path. | |
1497 | ||
a64e0ee5 DA |
1498 | .. index:: bgp as-path access-list WORD permit|deny LINE |
1499 | .. clicmd:: bgp as-path access-list WORD permit|deny LINE | |
42fc5d26 | 1500 | |
c1a54c05 | 1501 | This command defines a new AS path access list. |
42fc5d26 | 1502 | |
a64e0ee5 DA |
1503 | .. index:: no bgp as-path access-list WORD |
1504 | .. clicmd:: no bgp as-path access-list WORD | |
42fc5d26 | 1505 | |
a64e0ee5 DA |
1506 | .. index:: no bgp as-path access-list WORD permit|deny LINE |
1507 | .. clicmd:: no bgp as-path access-list WORD permit|deny LINE | |
42fc5d26 | 1508 | |
125cec1a DA |
1509 | .. _bgp-bogon-filter-example: |
1510 | ||
1511 | Bogon ASN filter policy configuration example | |
1512 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
1513 | ||
1514 | .. code-block:: frr | |
1515 | ||
1516 | bgp as-path access-list 99 permit _0_ | |
1517 | bgp as-path access-list 99 permit _23456_ | |
1518 | bgp as-path access-list 99 permit _1310[0-6][0-9]_|_13107[0-1]_ | |
1519 | ||
8fcedbd2 | 1520 | .. _bgp-using-as-path-in-route-map: |
42fc5d26 QY |
1521 | |
1522 | Using AS Path in Route Map | |
1523 | -------------------------- | |
1524 | ||
eb1f303d DS |
1525 | .. index:: [no] match as-path WORD |
1526 | .. clicmd:: [no] match as-path WORD | |
42fc5d26 | 1527 | |
eb1f303d DS |
1528 | For a given as-path, WORD, match it on the BGP as-path given for the prefix |
1529 | and if it matches do normal route-map actions. The no form of the command | |
1530 | removes this match from the route-map. | |
42fc5d26 | 1531 | |
eb1f303d DS |
1532 | .. index:: [no] set as-path prepend AS-PATH |
1533 | .. clicmd:: [no] set as-path prepend AS-PATH | |
42fc5d26 | 1534 | |
eb1f303d DS |
1535 | Prepend the given string of AS numbers to the AS_PATH of the BGP path's NLRI. |
1536 | The no form of this command removes this set operation from the route-map. | |
42fc5d26 | 1537 | |
eb1f303d DS |
1538 | .. index:: [no] set as-path prepend last-as NUM |
1539 | .. clicmd:: [no] set as-path prepend last-as NUM | |
c1a54c05 QY |
1540 | |
1541 | Prepend the existing last AS number (the leftmost ASN) to the AS_PATH. | |
eb1f303d | 1542 | The no form of this command removes this set operation from the route-map. |
42fc5d26 | 1543 | |
0efdf0fe | 1544 | .. _bgp-communities-attribute: |
42fc5d26 | 1545 | |
8fcedbd2 QY |
1546 | Communities Attribute |
1547 | --------------------- | |
42fc5d26 | 1548 | |
8fcedbd2 | 1549 | The BGP communities attribute is widely used for implementing policy routing. |
c1a54c05 QY |
1550 | Network operators can manipulate BGP communities attribute based on their |
1551 | network policy. BGP communities attribute is defined in :rfc:`1997` and | |
1552 | :rfc:`1998`. It is an optional transitive attribute, therefore local policy can | |
1553 | travel through different autonomous system. | |
1554 | ||
8fcedbd2 QY |
1555 | The communities attribute is a set of communities values. Each community value |
1556 | is 4 octet long. The following format is used to define the community value. | |
c1a54c05 | 1557 | |
8fcedbd2 | 1558 | ``AS:VAL`` |
c1a54c05 QY |
1559 | This format represents 4 octet communities value. ``AS`` is high order 2 |
1560 | octet in digit format. ``VAL`` is low order 2 octet in digit format. This | |
1561 | format is useful to define AS oriented policy value. For example, | |
1562 | ``7675:80`` can be used when AS 7675 wants to pass local policy value 80 to | |
1563 | neighboring peer. | |
1564 | ||
8fcedbd2 QY |
1565 | ``internet`` |
1566 | ``internet`` represents well-known communities value 0. | |
c1a54c05 | 1567 | |
cae770d3 C |
1568 | ``graceful-shutdown`` |
1569 | ``graceful-shutdown`` represents well-known communities value | |
1570 | ``GRACEFUL_SHUTDOWN`` ``0xFFFF0000`` ``65535:0``. :rfc:`8326` implements | |
1571 | the purpose Graceful BGP Session Shutdown to reduce the amount of | |
56f0bea7 | 1572 | lost traffic when taking BGP sessions down for maintenance. The use |
cae770d3 C |
1573 | of the community needs to be supported from your peers side to |
1574 | actually have any effect. | |
1575 | ||
1576 | ``accept-own`` | |
1577 | ``accept-own`` represents well-known communities value ``ACCEPT_OWN`` | |
1578 | ``0xFFFF0001`` ``65535:1``. :rfc:`7611` implements a way to signal | |
1579 | to a router to accept routes with a local nexthop address. This | |
1580 | can be the case when doing policing and having traffic having a | |
1581 | nexthop located in another VRF but still local interface to the | |
1582 | router. It is recommended to read the RFC for full details. | |
1583 | ||
1584 | ``route-filter-translated-v4`` | |
1585 | ``route-filter-translated-v4`` represents well-known communities value | |
1586 | ``ROUTE_FILTER_TRANSLATED_v4`` ``0xFFFF0002`` ``65535:2``. | |
1587 | ||
1588 | ``route-filter-v4`` | |
1589 | ``route-filter-v4`` represents well-known communities value | |
1590 | ``ROUTE_FILTER_v4`` ``0xFFFF0003`` ``65535:3``. | |
1591 | ||
1592 | ``route-filter-translated-v6`` | |
1593 | ``route-filter-translated-v6`` represents well-known communities value | |
1594 | ``ROUTE_FILTER_TRANSLATED_v6`` ``0xFFFF0004`` ``65535:4``. | |
1595 | ||
1596 | ``route-filter-v6`` | |
1597 | ``route-filter-v6`` represents well-known communities value | |
1598 | ``ROUTE_FILTER_v6`` ``0xFFFF0005`` ``65535:5``. | |
1599 | ||
1600 | ``llgr-stale`` | |
1601 | ``llgr-stale`` represents well-known communities value ``LLGR_STALE`` | |
1602 | ``0xFFFF0006`` ``65535:6``. | |
56f0bea7 | 1603 | Assigned and intended only for use with routers supporting the |
cae770d3 | 1604 | Long-lived Graceful Restart Capability as described in |
49606d58 | 1605 | [Draft-IETF-uttaro-idr-bgp-persistence]_. |
56f0bea7 | 1606 | Routers receiving routes with this community may (depending on |
cae770d3 C |
1607 | implementation) choose allow to reject or modify routes on the |
1608 | presence or absence of this community. | |
1609 | ||
1610 | ``no-llgr`` | |
1611 | ``no-llgr`` represents well-known communities value ``NO_LLGR`` | |
1612 | ``0xFFFF0007`` ``65535:7``. | |
56f0bea7 | 1613 | Assigned and intended only for use with routers supporting the |
cae770d3 | 1614 | Long-lived Graceful Restart Capability as described in |
49606d58 | 1615 | [Draft-IETF-uttaro-idr-bgp-persistence]_. |
56f0bea7 | 1616 | Routers receiving routes with this community may (depending on |
cae770d3 C |
1617 | implementation) choose allow to reject or modify routes on the |
1618 | presence or absence of this community. | |
1619 | ||
1620 | ``accept-own-nexthop`` | |
1621 | ``accept-own-nexthop`` represents well-known communities value | |
1622 | ``accept-own-nexthop`` ``0xFFFF0008`` ``65535:8``. | |
49606d58 | 1623 | [Draft-IETF-agrewal-idr-accept-own-nexthop]_ describes |
cae770d3 C |
1624 | how to tag and label VPN routes to be able to send traffic between VRFs |
1625 | via an internal layer 2 domain on the same PE device. Refer to | |
49606d58 | 1626 | [Draft-IETF-agrewal-idr-accept-own-nexthop]_ for full details. |
cae770d3 C |
1627 | |
1628 | ``blackhole`` | |
1629 | ``blackhole`` represents well-known communities value ``BLACKHOLE`` | |
1630 | ``0xFFFF029A`` ``65535:666``. :rfc:`7999` documents sending prefixes to | |
1631 | EBGP peers and upstream for the purpose of blackholing traffic. | |
1632 | Prefixes tagged with the this community should normally not be | |
1633 | re-advertised from neighbors of the originating network. It is | |
1634 | recommended upon receiving prefixes tagged with this community to | |
1635 | add ``NO_EXPORT`` and ``NO_ADVERTISE``. | |
1636 | ||
8fcedbd2 | 1637 | ``no-export`` |
c1a54c05 QY |
1638 | ``no-export`` represents well-known communities value ``NO_EXPORT`` |
1639 | ``0xFFFFFF01``. All routes carry this value must not be advertised to | |
1640 | outside a BGP confederation boundary. If neighboring BGP peer is part of BGP | |
1641 | confederation, the peer is considered as inside a BGP confederation | |
1642 | boundary, so the route will be announced to the peer. | |
1643 | ||
8fcedbd2 | 1644 | ``no-advertise`` |
c1a54c05 QY |
1645 | ``no-advertise`` represents well-known communities value ``NO_ADVERTISE`` |
1646 | ``0xFFFFFF02``. All routes carry this value must not be advertise to other | |
1647 | BGP peers. | |
1648 | ||
8fcedbd2 | 1649 | ``local-AS`` |
c1a54c05 QY |
1650 | ``local-AS`` represents well-known communities value ``NO_EXPORT_SUBCONFED`` |
1651 | ``0xFFFFFF03``. All routes carry this value must not be advertised to | |
1652 | external BGP peers. Even if the neighboring router is part of confederation, | |
1653 | it is considered as external BGP peer, so the route will not be announced to | |
1654 | the peer. | |
1655 | ||
cae770d3 C |
1656 | ``no-peer`` |
1657 | ``no-peer`` represents well-known communities value ``NOPEER`` | |
1658 | ``0xFFFFFF04`` ``65535:65284``. :rfc:`3765` is used to communicate to | |
1659 | another network how the originating network want the prefix propagated. | |
1660 | ||
aa9eafa4 QY |
1661 | When the communities attribute is received duplicate community values in the |
1662 | attribute are ignored and value is sorted in numerical order. | |
42fc5d26 | 1663 | |
49606d58 PG |
1664 | .. [Draft-IETF-uttaro-idr-bgp-persistence] <https://tools.ietf.org/id/draft-uttaro-idr-bgp-persistence-04.txt> |
1665 | .. [Draft-IETF-agrewal-idr-accept-own-nexthop] <https://tools.ietf.org/id/draft-agrewal-idr-accept-own-nexthop-00.txt> | |
1666 | ||
0efdf0fe | 1667 | .. _bgp-community-lists: |
42fc5d26 | 1668 | |
8fcedbd2 QY |
1669 | Community Lists |
1670 | ^^^^^^^^^^^^^^^ | |
aa9eafa4 QY |
1671 | Community lists are user defined lists of community attribute values. These |
1672 | lists can be used for matching or manipulating the communities attribute in | |
1673 | UPDATE messages. | |
42fc5d26 | 1674 | |
aa9eafa4 | 1675 | There are two types of community list: |
c1a54c05 | 1676 | |
aa9eafa4 | 1677 | standard |
56f0bea7 | 1678 | This type accepts an explicit value for the attribute. |
aa9eafa4 QY |
1679 | |
1680 | expanded | |
1681 | This type accepts a regular expression. Because the regex must be | |
1682 | interpreted on each use expanded community lists are slower than standard | |
1683 | lists. | |
42fc5d26 | 1684 | |
a64e0ee5 DA |
1685 | .. index:: bgp community-list standard NAME permit|deny COMMUNITY |
1686 | .. clicmd:: bgp community-list standard NAME permit|deny COMMUNITY | |
42fc5d26 | 1687 | |
aa9eafa4 QY |
1688 | This command defines a new standard community list. ``COMMUNITY`` is |
1689 | communities value. The ``COMMUNITY`` is compiled into community structure. | |
1690 | We can define multiple community list under same name. In that case match | |
1691 | will happen user defined order. Once the community list matches to | |
1692 | communities attribute in BGP updates it return permit or deny by the | |
1693 | community list definition. When there is no matched entry, deny will be | |
1694 | returned. When ``COMMUNITY`` is empty it matches to any routes. | |
42fc5d26 | 1695 | |
a64e0ee5 DA |
1696 | .. index:: bgp community-list expanded NAME permit|deny COMMUNITY |
1697 | .. clicmd:: bgp community-list expanded NAME permit|deny COMMUNITY | |
42fc5d26 | 1698 | |
aa9eafa4 QY |
1699 | This command defines a new expanded community list. ``COMMUNITY`` is a |
1700 | string expression of communities attribute. ``COMMUNITY`` can be a regular | |
1701 | expression (:ref:`bgp-regular-expressions`) to match the communities | |
47f47873 PG |
1702 | attribute in BGP updates. The expanded community is only used to filter, |
1703 | not `set` actions. | |
42fc5d26 | 1704 | |
aa9eafa4 QY |
1705 | .. deprecated:: 5.0 |
1706 | It is recommended to use the more explicit versions of this command. | |
42fc5d26 | 1707 | |
a64e0ee5 DA |
1708 | .. index:: bgp community-list NAME permit|deny COMMUNITY |
1709 | .. clicmd:: bgp community-list NAME permit|deny COMMUNITY | |
aa9eafa4 QY |
1710 | |
1711 | When the community list type is not specified, the community list type is | |
1712 | automatically detected. If ``COMMUNITY`` can be compiled into communities | |
1713 | attribute, the community list is defined as a standard community list. | |
1714 | Otherwise it is defined as an expanded community list. This feature is left | |
1715 | for backward compatibility. Use of this feature is not recommended. | |
42fc5d26 | 1716 | |
42fc5d26 | 1717 | |
a64e0ee5 DA |
1718 | .. index:: no bgp community-list [standard|expanded] NAME |
1719 | .. clicmd:: no bgp community-list [standard|expanded] NAME | |
42fc5d26 | 1720 | |
aa9eafa4 QY |
1721 | Deletes the community list specified by ``NAME``. All community lists share |
1722 | the same namespace, so it's not necessary to specify ``standard`` or | |
1723 | ``expanded``; these modifiers are purely aesthetic. | |
42fc5d26 | 1724 | |
a64e0ee5 DA |
1725 | .. index:: show bgp community-list [NAME] |
1726 | .. clicmd:: show bgp community-list [NAME] | |
42fc5d26 | 1727 | |
aa9eafa4 QY |
1728 | Displays community list information. When ``NAME`` is specified the |
1729 | specified community list's information is shown. | |
c3c5a71f | 1730 | |
c1a54c05 | 1731 | :: |
76bd1499 | 1732 | |
a64e0ee5 | 1733 | # show bgp community-list |
c1a54c05 QY |
1734 | Named Community standard list CLIST |
1735 | permit 7675:80 7675:100 no-export | |
1736 | deny internet | |
1737 | Named Community expanded list EXPAND | |
1738 | permit : | |
76bd1499 | 1739 | |
a64e0ee5 | 1740 | # show bgp community-list CLIST |
c1a54c05 QY |
1741 | Named Community standard list CLIST |
1742 | permit 7675:80 7675:100 no-export | |
1743 | deny internet | |
42fc5d26 | 1744 | |
42fc5d26 | 1745 | |
8fcedbd2 | 1746 | .. _bgp-numbered-community-lists: |
42fc5d26 | 1747 | |
8fcedbd2 QY |
1748 | Numbered Community Lists |
1749 | ^^^^^^^^^^^^^^^^^^^^^^^^ | |
42fc5d26 QY |
1750 | |
1751 | When number is used for BGP community list name, the number has | |
c3c5a71f QY |
1752 | special meanings. Community list number in the range from 1 and 99 is |
1753 | standard community list. Community list number in the range from 100 | |
1754 | to 199 is expanded community list. These community lists are called | |
1755 | as numbered community lists. On the other hand normal community lists | |
42fc5d26 QY |
1756 | is called as named community lists. |
1757 | ||
a64e0ee5 DA |
1758 | .. index:: bgp community-list (1-99) permit|deny COMMUNITY |
1759 | .. clicmd:: bgp community-list (1-99) permit|deny COMMUNITY | |
42fc5d26 | 1760 | |
aa9eafa4 QY |
1761 | This command defines a new community list. The argument to (1-99) defines |
1762 | the list identifier. | |
42fc5d26 | 1763 | |
a64e0ee5 DA |
1764 | .. index:: bgp community-list (100-199) permit|deny COMMUNITY |
1765 | .. clicmd:: bgp community-list (100-199) permit|deny COMMUNITY | |
42fc5d26 | 1766 | |
aa9eafa4 QY |
1767 | This command defines a new expanded community list. The argument to |
1768 | (100-199) defines the list identifier. | |
42fc5d26 | 1769 | |
8fcedbd2 | 1770 | .. _bgp-using-communities-in-route-map: |
42fc5d26 | 1771 | |
8fcedbd2 QY |
1772 | Using Communities in Route Maps |
1773 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
42fc5d26 | 1774 | |
aa9eafa4 QY |
1775 | In :ref:`route-map` we can match on or set the BGP communities attribute. Using |
1776 | this feature network operator can implement their network policy based on BGP | |
1777 | communities attribute. | |
42fc5d26 | 1778 | |
b91bf5bd | 1779 | The following commands can be used in route maps: |
42fc5d26 | 1780 | |
aa9eafa4 QY |
1781 | .. index:: match community WORD exact-match [exact-match] |
1782 | .. clicmd:: match community WORD exact-match [exact-match] | |
42fc5d26 | 1783 | |
c1a54c05 QY |
1784 | This command perform match to BGP updates using community list WORD. When |
1785 | the one of BGP communities value match to the one of communities value in | |
d1e7591e | 1786 | community list, it is match. When `exact-match` keyword is specified, match |
c1a54c05 QY |
1787 | happen only when BGP updates have completely same communities value |
1788 | specified in the community list. | |
42fc5d26 | 1789 | |
aa9eafa4 QY |
1790 | .. index:: set community <none|COMMUNITY> additive |
1791 | .. clicmd:: set community <none|COMMUNITY> additive | |
42fc5d26 | 1792 | |
aa9eafa4 QY |
1793 | This command sets the community value in BGP updates. If the attribute is |
1794 | already configured, the newly provided value replaces the old one unless the | |
1795 | ``additive`` keyword is specified, in which case the new value is appended | |
1796 | to the existing value. | |
42fc5d26 | 1797 | |
aa9eafa4 QY |
1798 | If ``none`` is specified as the community value, the communities attribute |
1799 | is not sent. | |
42fc5d26 | 1800 | |
47f47873 PG |
1801 | It is not possible to set an expanded community list. |
1802 | ||
c1a54c05 | 1803 | .. index:: set comm-list WORD delete |
29adcd50 | 1804 | .. clicmd:: set comm-list WORD delete |
c1a54c05 | 1805 | |
aa9eafa4 QY |
1806 | This command remove communities value from BGP communities attribute. The |
1807 | ``word`` is community list name. When BGP route's communities value matches | |
1808 | to the community list ``word``, the communities value is removed. When all | |
1809 | of communities value is removed eventually, the BGP update's communities | |
1810 | attribute is completely removed. | |
42fc5d26 | 1811 | |
8fcedbd2 | 1812 | .. _bgp-communities-example: |
c1a54c05 | 1813 | |
8fcedbd2 QY |
1814 | Example Configuration |
1815 | ^^^^^^^^^^^^^^^^^^^^^ | |
9eb95b3b | 1816 | |
8fcedbd2 QY |
1817 | The following configuration is exemplary of the most typical usage of BGP |
1818 | communities attribute. In the example, AS 7675 provides an upstream Internet | |
1819 | connection to AS 100. When the following configuration exists in AS 7675, the | |
1820 | network operator of AS 100 can set local preference in AS 7675 network by | |
1821 | setting BGP communities attribute to the updates. | |
9eb95b3b QY |
1822 | |
1823 | .. code-block:: frr | |
c1a54c05 QY |
1824 | |
1825 | router bgp 7675 | |
1826 | neighbor 192.168.0.1 remote-as 100 | |
1827 | address-family ipv4 unicast | |
1828 | neighbor 192.168.0.1 route-map RMAP in | |
1829 | exit-address-family | |
1830 | ! | |
a64e0ee5 DA |
1831 | bgp community-list 70 permit 7675:70 |
1832 | bgp community-list 70 deny | |
1833 | bgp community-list 80 permit 7675:80 | |
1834 | bgp community-list 80 deny | |
1835 | bgp community-list 90 permit 7675:90 | |
1836 | bgp community-list 90 deny | |
c1a54c05 QY |
1837 | ! |
1838 | route-map RMAP permit 10 | |
1839 | match community 70 | |
1840 | set local-preference 70 | |
1841 | ! | |
1842 | route-map RMAP permit 20 | |
1843 | match community 80 | |
1844 | set local-preference 80 | |
1845 | ! | |
1846 | route-map RMAP permit 30 | |
1847 | match community 90 | |
1848 | set local-preference 90 | |
c3c5a71f | 1849 | |
42fc5d26 | 1850 | |
8fcedbd2 QY |
1851 | The following configuration announces ``10.0.0.0/8`` from AS 100 to AS 7675. |
1852 | The route has communities value ``7675:80`` so when above configuration exists | |
1853 | in AS 7675, the announced routes' local preference value will be set to 80. | |
9eb95b3b QY |
1854 | |
1855 | .. code-block:: frr | |
c1a54c05 QY |
1856 | |
1857 | router bgp 100 | |
1858 | network 10.0.0.0/8 | |
1859 | neighbor 192.168.0.2 remote-as 7675 | |
1860 | address-family ipv4 unicast | |
1861 | neighbor 192.168.0.2 route-map RMAP out | |
1862 | exit-address-family | |
1863 | ! | |
1864 | ip prefix-list PLIST permit 10.0.0.0/8 | |
1865 | ! | |
1866 | route-map RMAP permit 10 | |
1867 | match ip address prefix-list PLIST | |
1868 | set community 7675:80 | |
c3c5a71f | 1869 | |
42fc5d26 | 1870 | |
8fcedbd2 QY |
1871 | The following configuration is an example of BGP route filtering using |
1872 | communities attribute. This configuration only permit BGP routes which has BGP | |
1873 | communities value ``0:80`` or ``0:90``. The network operator can set special | |
1874 | internal communities value at BGP border router, then limit the BGP route | |
1875 | announcements into the internal network. | |
9eb95b3b QY |
1876 | |
1877 | .. code-block:: frr | |
42fc5d26 | 1878 | |
c1a54c05 QY |
1879 | router bgp 7675 |
1880 | neighbor 192.168.0.1 remote-as 100 | |
1881 | address-family ipv4 unicast | |
1882 | neighbor 192.168.0.1 route-map RMAP in | |
1883 | exit-address-family | |
1884 | ! | |
a64e0ee5 | 1885 | bgp community-list 1 permit 0:80 0:90 |
c1a54c05 QY |
1886 | ! |
1887 | route-map RMAP permit in | |
1888 | match community 1 | |
c3c5a71f | 1889 | |
42fc5d26 | 1890 | |
8fcedbd2 QY |
1891 | The following example filters BGP routes which have a community value of |
1892 | ``1:1``. When there is no match community-list returns ``deny``. To avoid | |
1893 | filtering all routes, a ``permit`` line is set at the end of the | |
1894 | community-list. | |
9eb95b3b QY |
1895 | |
1896 | .. code-block:: frr | |
42fc5d26 | 1897 | |
c1a54c05 QY |
1898 | router bgp 7675 |
1899 | neighbor 192.168.0.1 remote-as 100 | |
1900 | address-family ipv4 unicast | |
1901 | neighbor 192.168.0.1 route-map RMAP in | |
1902 | exit-address-family | |
1903 | ! | |
a64e0ee5 DA |
1904 | bgp community-list standard FILTER deny 1:1 |
1905 | bgp community-list standard FILTER permit | |
c1a54c05 QY |
1906 | ! |
1907 | route-map RMAP permit 10 | |
1908 | match community FILTER | |
c3c5a71f | 1909 | |
42fc5d26 | 1910 | |
8fcedbd2 QY |
1911 | The communities value keyword ``internet`` has special meanings in standard |
1912 | community lists. In the below example ``internet`` matches all BGP routes even | |
1913 | if the route does not have communities attribute at all. So community list | |
1914 | ``INTERNET`` is the same as ``FILTER`` in the previous example. | |
9eb95b3b QY |
1915 | |
1916 | .. code-block:: frr | |
42fc5d26 | 1917 | |
a64e0ee5 DA |
1918 | bgp community-list standard INTERNET deny 1:1 |
1919 | bgp community-list standard INTERNET permit internet | |
c3c5a71f | 1920 | |
42fc5d26 | 1921 | |
8fcedbd2 QY |
1922 | The following configuration is an example of communities value deletion. With |
1923 | this configuration the community values ``100:1`` and ``100:2`` are removed | |
1924 | from BGP updates. For communities value deletion, only ``permit`` | |
1925 | community-list is used. ``deny`` community-list is ignored. | |
9eb95b3b QY |
1926 | |
1927 | .. code-block:: frr | |
42fc5d26 | 1928 | |
c1a54c05 QY |
1929 | router bgp 7675 |
1930 | neighbor 192.168.0.1 remote-as 100 | |
1931 | address-family ipv4 unicast | |
1932 | neighbor 192.168.0.1 route-map RMAP in | |
1933 | exit-address-family | |
1934 | ! | |
a64e0ee5 | 1935 | bgp community-list standard DEL permit 100:1 100:2 |
c1a54c05 QY |
1936 | ! |
1937 | route-map RMAP permit 10 | |
1938 | set comm-list DEL delete | |
c3c5a71f | 1939 | |
42fc5d26 | 1940 | |
0efdf0fe | 1941 | .. _bgp-extended-communities-attribute: |
42fc5d26 | 1942 | |
8fcedbd2 QY |
1943 | Extended Communities Attribute |
1944 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
42fc5d26 | 1945 | |
c1a54c05 QY |
1946 | BGP extended communities attribute is introduced with MPLS VPN/BGP technology. |
1947 | MPLS VPN/BGP expands capability of network infrastructure to provide VPN | |
1948 | functionality. At the same time it requires a new framework for policy routing. | |
1949 | With BGP Extended Communities Attribute we can use Route Target or Site of | |
1950 | Origin for implementing network policy for MPLS VPN/BGP. | |
42fc5d26 | 1951 | |
c1a54c05 QY |
1952 | BGP Extended Communities Attribute is similar to BGP Communities Attribute. It |
1953 | is an optional transitive attribute. BGP Extended Communities Attribute can | |
1954 | carry multiple Extended Community value. Each Extended Community value is | |
1955 | eight octet length. | |
42fc5d26 | 1956 | |
c1a54c05 QY |
1957 | BGP Extended Communities Attribute provides an extended range compared with BGP |
1958 | Communities Attribute. Adding to that there is a type field in each value to | |
1959 | provides community space structure. | |
42fc5d26 | 1960 | |
c1a54c05 QY |
1961 | There are two format to define Extended Community value. One is AS based format |
1962 | the other is IP address based format. | |
42fc5d26 | 1963 | |
8fcedbd2 QY |
1964 | ``AS:VAL`` |
1965 | This is a format to define AS based Extended Community value. ``AS`` part | |
1966 | is 2 octets Global Administrator subfield in Extended Community value. | |
1967 | ``VAL`` part is 4 octets Local Administrator subfield. ``7675:100`` | |
1968 | represents AS 7675 policy value 100. | |
42fc5d26 | 1969 | |
8fcedbd2 | 1970 | ``IP-Address:VAL`` |
c1a54c05 | 1971 | This is a format to define IP address based Extended Community value. |
8fcedbd2 QY |
1972 | ``IP-Address`` part is 4 octets Global Administrator subfield. ``VAL`` part |
1973 | is 2 octets Local Administrator subfield. | |
42fc5d26 | 1974 | |
0efdf0fe | 1975 | .. _bgp-extended-community-lists: |
42fc5d26 | 1976 | |
8fcedbd2 QY |
1977 | Extended Community Lists |
1978 | ^^^^^^^^^^^^^^^^^^^^^^^^ | |
42fc5d26 | 1979 | |
a64e0ee5 DA |
1980 | .. index:: bgp extcommunity-list standard NAME permit|deny EXTCOMMUNITY |
1981 | .. clicmd:: bgp extcommunity-list standard NAME permit|deny EXTCOMMUNITY | |
42fc5d26 | 1982 | |
4da7fda3 QY |
1983 | This command defines a new standard extcommunity-list. `extcommunity` is |
1984 | extended communities value. The `extcommunity` is compiled into extended | |
1985 | community structure. We can define multiple extcommunity-list under same | |
1986 | name. In that case match will happen user defined order. Once the | |
1987 | extcommunity-list matches to extended communities attribute in BGP updates | |
1988 | it return permit or deny based upon the extcommunity-list definition. When | |
1989 | there is no matched entry, deny will be returned. When `extcommunity` is | |
1990 | empty it matches to any routes. | |
42fc5d26 | 1991 | |
a64e0ee5 DA |
1992 | .. index:: bgp extcommunity-list expanded NAME permit|deny LINE |
1993 | .. clicmd:: bgp extcommunity-list expanded NAME permit|deny LINE | |
42fc5d26 | 1994 | |
4da7fda3 QY |
1995 | This command defines a new expanded extcommunity-list. `line` is a string |
1996 | expression of extended communities attribute. `line` can be a regular | |
1997 | expression (:ref:`bgp-regular-expressions`) to match an extended communities | |
1998 | attribute in BGP updates. | |
42fc5d26 | 1999 | |
a64e0ee5 DA |
2000 | .. index:: no bgp extcommunity-list NAME |
2001 | .. clicmd:: no bgp extcommunity-list NAME | |
42fc5d26 | 2002 | |
a64e0ee5 DA |
2003 | .. index:: no bgp extcommunity-list standard NAME |
2004 | .. clicmd:: no bgp extcommunity-list standard NAME | |
42fc5d26 | 2005 | |
a64e0ee5 DA |
2006 | .. index:: no bgp extcommunity-list expanded NAME |
2007 | .. clicmd:: no bgp extcommunity-list expanded NAME | |
42fc5d26 | 2008 | |
4da7fda3 QY |
2009 | These commands delete extended community lists specified by `name`. All of |
2010 | extended community lists shares a single name space. So extended community | |
d1e7591e | 2011 | lists can be removed simply specifying the name. |
42fc5d26 | 2012 | |
a64e0ee5 DA |
2013 | .. index:: show bgp extcommunity-list |
2014 | .. clicmd:: show bgp extcommunity-list | |
42fc5d26 | 2015 | |
a64e0ee5 DA |
2016 | .. index:: show bgp extcommunity-list NAME |
2017 | .. clicmd:: show bgp extcommunity-list NAME | |
c1a54c05 | 2018 | |
4da7fda3 | 2019 | This command displays current extcommunity-list information. When `name` is |
9eb95b3b | 2020 | specified the community list's information is shown.:: |
42fc5d26 | 2021 | |
a64e0ee5 | 2022 | # show bgp extcommunity-list |
c3c5a71f | 2023 | |
42fc5d26 | 2024 | |
0efdf0fe | 2025 | .. _bgp-extended-communities-in-route-map: |
42fc5d26 QY |
2026 | |
2027 | BGP Extended Communities in Route Map | |
8fcedbd2 | 2028 | """"""""""""""""""""""""""""""""""""" |
42fc5d26 | 2029 | |
c3c5a71f | 2030 | .. index:: match extcommunity WORD |
29adcd50 | 2031 | .. clicmd:: match extcommunity WORD |
42fc5d26 | 2032 | |
c1a54c05 | 2033 | .. index:: set extcommunity rt EXTCOMMUNITY |
29adcd50 | 2034 | .. clicmd:: set extcommunity rt EXTCOMMUNITY |
42fc5d26 | 2035 | |
c1a54c05 | 2036 | This command set Route Target value. |
42fc5d26 | 2037 | |
c1a54c05 | 2038 | .. index:: set extcommunity soo EXTCOMMUNITY |
29adcd50 | 2039 | .. clicmd:: set extcommunity soo EXTCOMMUNITY |
c1a54c05 QY |
2040 | |
2041 | This command set Site of Origin value. | |
42fc5d26 | 2042 | |
ed647ed2 | 2043 | .. index:: set extcommunity bandwidth <(1-25600) | cumulative | num-multipaths> [non-transitive] |
2044 | .. clicmd:: set extcommunity bandwidth <(1-25600) | cumulative | num-multipaths> [non-transitive] | |
2045 | ||
2046 | This command sets the BGP link-bandwidth extended community for the prefix | |
2047 | (best path) for which it is applied. The link-bandwidth can be specified as | |
2048 | an ``explicit value`` (specified in Mbps), or the router can be told to use | |
2049 | the ``cumulative bandwidth`` of all multipaths for the prefix or to compute | |
2050 | it based on the ``number of multipaths``. The link bandwidth extended | |
2051 | community is encoded as ``transitive`` unless the set command explicitly | |
2052 | configures it as ``non-transitive``. | |
2053 | ||
2054 | .. seealso:: :ref:`wecmp_linkbw` | |
47f47873 PG |
2055 | |
2056 | Note that the extended expanded community is only used for `match` rule, not for | |
2057 | `set` actions. | |
2058 | ||
0efdf0fe | 2059 | .. _bgp-large-communities-attribute: |
42fc5d26 | 2060 | |
8fcedbd2 QY |
2061 | Large Communities Attribute |
2062 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
42fc5d26 QY |
2063 | |
2064 | The BGP Large Communities attribute was introduced in Feb 2017 with | |
c1a54c05 | 2065 | :rfc:`8092`. |
42fc5d26 | 2066 | |
8fcedbd2 QY |
2067 | The BGP Large Communities Attribute is similar to the BGP Communities Attribute |
2068 | except that it has 3 components instead of two and each of which are 4 octets | |
2069 | in length. Large Communities bring additional functionality and convenience | |
2070 | over traditional communities, specifically the fact that the ``GLOBAL`` part | |
2071 | below is now 4 octets wide allowing seamless use in networks using 4-byte ASNs. | |
2072 | ||
2073 | ``GLOBAL:LOCAL1:LOCAL2`` | |
2074 | This is the format to define Large Community values. Referencing :rfc:`8195` | |
2075 | the values are commonly referred to as follows: | |
2076 | ||
2077 | - The ``GLOBAL`` part is a 4 octet Global Administrator field, commonly used | |
2078 | as the operators AS number. | |
2079 | - The ``LOCAL1`` part is a 4 octet Local Data Part 1 subfield referred to as | |
2080 | a function. | |
2081 | - The ``LOCAL2`` part is a 4 octet Local Data Part 2 field and referred to | |
2082 | as the parameter subfield. | |
2083 | ||
2084 | As an example, ``65551:1:10`` represents AS 65551 function 1 and parameter | |
2085 | 10. The referenced RFC above gives some guidelines on recommended usage. | |
42fc5d26 | 2086 | |
0efdf0fe | 2087 | .. _bgp-large-community-lists: |
42fc5d26 | 2088 | |
8fcedbd2 QY |
2089 | Large Community Lists |
2090 | """"""""""""""""""""" | |
42fc5d26 QY |
2091 | |
2092 | Two types of large community lists are supported, namely `standard` and | |
2093 | `expanded`. | |
2094 | ||
a64e0ee5 DA |
2095 | .. index:: bgp large-community-list standard NAME permit|deny LARGE-COMMUNITY |
2096 | .. clicmd:: bgp large-community-list standard NAME permit|deny LARGE-COMMUNITY | |
42fc5d26 | 2097 | |
4da7fda3 QY |
2098 | This command defines a new standard large-community-list. `large-community` |
2099 | is the Large Community value. We can add multiple large communities under | |
2100 | same name. In that case the match will happen in the user defined order. | |
2101 | Once the large-community-list matches the Large Communities attribute in BGP | |
2102 | updates it will return permit or deny based upon the large-community-list | |
2103 | definition. When there is no matched entry, a deny will be returned. When | |
2104 | `large-community` is empty it matches any routes. | |
42fc5d26 | 2105 | |
a64e0ee5 DA |
2106 | .. index:: bgp large-community-list expanded NAME permit|deny LINE |
2107 | .. clicmd:: bgp large-community-list expanded NAME permit|deny LINE | |
42fc5d26 | 2108 | |
4da7fda3 QY |
2109 | This command defines a new expanded large-community-list. Where `line` is a |
2110 | string matching expression, it will be compared to the entire Large | |
2111 | Communities attribute as a string, with each large-community in order from | |
2112 | lowest to highest. `line` can also be a regular expression which matches | |
2113 | this Large Community attribute. | |
42fc5d26 | 2114 | |
a64e0ee5 DA |
2115 | .. index:: no bgp large-community-list NAME |
2116 | .. clicmd:: no bgp large-community-list NAME | |
42fc5d26 | 2117 | |
a64e0ee5 DA |
2118 | .. index:: no bgp large-community-list standard NAME |
2119 | .. clicmd:: no bgp large-community-list standard NAME | |
42fc5d26 | 2120 | |
a64e0ee5 DA |
2121 | .. index:: no bgp large-community-list expanded NAME |
2122 | .. clicmd:: no bgp large-community-list expanded NAME | |
42fc5d26 | 2123 | |
4da7fda3 QY |
2124 | These commands delete Large Community lists specified by `name`. All Large |
2125 | Community lists share a single namespace. This means Large Community lists | |
2126 | can be removed by simply specifying the name. | |
42fc5d26 | 2127 | |
a64e0ee5 DA |
2128 | .. index:: show bgp large-community-list |
2129 | .. clicmd:: show bgp large-community-list | |
42fc5d26 | 2130 | |
a64e0ee5 DA |
2131 | .. index:: show bgp large-community-list NAME |
2132 | .. clicmd:: show bgp large-community-list NAME | |
42fc5d26 | 2133 | |
c1a54c05 QY |
2134 | This command display current large-community-list information. When |
2135 | `name` is specified the community list information is shown. | |
42fc5d26 | 2136 | |
c1a54c05 | 2137 | .. index:: show ip bgp large-community-info |
29adcd50 | 2138 | .. clicmd:: show ip bgp large-community-info |
c1a54c05 QY |
2139 | |
2140 | This command displays the current large communities in use. | |
42fc5d26 | 2141 | |
0efdf0fe | 2142 | .. _bgp-large-communities-in-route-map: |
42fc5d26 | 2143 | |
8fcedbd2 QY |
2144 | Large Communities in Route Map |
2145 | """""""""""""""""""""""""""""" | |
42fc5d26 | 2146 | |
03ff9a14 | 2147 | .. index:: match large-community LINE [exact-match] |
2148 | .. clicmd:: match large-community LINE [exact-match] | |
42fc5d26 | 2149 | |
4da7fda3 QY |
2150 | Where `line` can be a simple string to match, or a regular expression. It |
2151 | is very important to note that this match occurs on the entire | |
c1a54c05 | 2152 | large-community string as a whole, where each large-community is ordered |
03ff9a14 | 2153 | from lowest to highest. When `exact-match` keyword is specified, match |
2154 | happen only when BGP updates have completely same large communities value | |
2155 | specified in the large community list. | |
42fc5d26 | 2156 | |
c1a54c05 | 2157 | .. index:: set large-community LARGE-COMMUNITY |
29adcd50 | 2158 | .. clicmd:: set large-community LARGE-COMMUNITY |
42fc5d26 | 2159 | |
c1a54c05 | 2160 | .. index:: set large-community LARGE-COMMUNITY LARGE-COMMUNITY |
29adcd50 | 2161 | .. clicmd:: set large-community LARGE-COMMUNITY LARGE-COMMUNITY |
42fc5d26 | 2162 | |
c1a54c05 | 2163 | .. index:: set large-community LARGE-COMMUNITY additive |
29adcd50 | 2164 | .. clicmd:: set large-community LARGE-COMMUNITY additive |
c1a54c05 QY |
2165 | |
2166 | These commands are used for setting large-community values. The first | |
2167 | command will overwrite any large-communities currently present. | |
2168 | The second specifies two large-communities, which overwrites the current | |
2169 | large-community list. The third will add a large-community value without | |
2170 | overwriting other values. Multiple large-community values can be specified. | |
42fc5d26 | 2171 | |
47f47873 PG |
2172 | Note that the large expanded community is only used for `match` rule, not for |
2173 | `set` actions. | |
b572f826 | 2174 | |
c8a5e5e1 | 2175 | .. _bgp-l3vpn-vrfs: |
b572f826 | 2176 | |
c8a5e5e1 QY |
2177 | L3VPN VRFs |
2178 | ---------- | |
b572f826 | 2179 | |
c8a5e5e1 QY |
2180 | *bgpd* supports :abbr:`L3VPN (Layer 3 Virtual Private Networks)` :abbr:`VRFs |
2181 | (Virtual Routing and Forwarding)` for IPv4 :rfc:`4364` and IPv6 :rfc:`4659`. | |
2182 | L3VPN routes, and their associated VRF MPLS labels, can be distributed to VPN | |
2183 | SAFI neighbors in the *default*, i.e., non VRF, BGP instance. VRF MPLS labels | |
2184 | are reached using *core* MPLS labels which are distributed using LDP or BGP | |
2185 | labeled unicast. *bgpd* also supports inter-VRF route leaking. | |
b572f826 | 2186 | |
b572f826 | 2187 | |
c8a5e5e1 | 2188 | .. _bgp-vrf-route-leaking: |
8fcedbd2 QY |
2189 | |
2190 | VRF Route Leaking | |
c8a5e5e1 | 2191 | ----------------- |
8fcedbd2 QY |
2192 | |
2193 | BGP routes may be leaked (i.e. copied) between a unicast VRF RIB and the VPN | |
f90115c5 LB |
2194 | SAFI RIB of the default VRF for use in MPLS-based L3VPNs. Unicast routes may |
2195 | also be leaked between any VRFs (including the unicast RIB of the default BGP | |
2196 | instanced). A shortcut syntax is also available for specifying leaking from one | |
2197 | VRF to another VRF using the default instance's VPN RIB as the intemediary. A | |
2198 | common application of the VRF-VRF feature is to connect a customer's private | |
8fcedbd2 QY |
2199 | routing domain to a provider's VPN service. Leaking is configured from the |
2200 | point of view of an individual VRF: ``import`` refers to routes leaked from VPN | |
2201 | to a unicast VRF, whereas ``export`` refers to routes leaked from a unicast VRF | |
2202 | to VPN. | |
2203 | ||
2204 | Required parameters | |
c8a5e5e1 | 2205 | ^^^^^^^^^^^^^^^^^^^ |
b572f826 | 2206 | |
4da7fda3 QY |
2207 | Routes exported from a unicast VRF to the VPN RIB must be augmented by two |
2208 | parameters: | |
2209 | ||
2210 | - an :abbr:`RD (Route Distinguisher)` | |
2211 | - an :abbr:`RTLIST (Route-target List)` | |
2212 | ||
2213 | Configuration for these exported routes must, at a minimum, specify these two | |
2214 | parameters. | |
2215 | ||
2216 | Routes imported from the VPN RIB to a unicast VRF are selected according to | |
2217 | their RTLISTs. Routes whose RTLIST contains at least one route-target in | |
2218 | common with the configured import RTLIST are leaked. Configuration for these | |
2219 | imported routes must specify an RTLIST to be matched. | |
2220 | ||
2221 | The RD, which carries no semantic value, is intended to make the route unique | |
2222 | in the VPN RIB among all routes of its prefix that originate from all the | |
2223 | customers and sites that are attached to the provider's VPN service. | |
2224 | Accordingly, each site of each customer is typically assigned an RD that is | |
2225 | unique across the entire provider network. | |
2226 | ||
2227 | The RTLIST is a set of route-target extended community values whose purpose is | |
2228 | to specify route-leaking policy. Typically, a customer is assigned a single | |
2229 | route-target value for import and export to be used at all customer sites. This | |
2230 | configuration specifies a simple topology wherein a customer has a single | |
2231 | routing domain which is shared across all its sites. More complex routing | |
2232 | topologies are possible through use of additional route-targets to augment the | |
2233 | leaking of sets of routes in various ways. | |
b572f826 | 2234 | |
e967a1d0 DS |
2235 | When using the shortcut syntax for vrf-to-vrf leaking, the RD and RT are |
2236 | auto-derived. | |
fb3d9f3e | 2237 | |
8fcedbd2 | 2238 | General configuration |
c8a5e5e1 | 2239 | ^^^^^^^^^^^^^^^^^^^^^ |
b572f826 | 2240 | |
f90115c5 | 2241 | Configuration of route leaking between a unicast VRF RIB and the VPN SAFI RIB |
4da7fda3 QY |
2242 | of the default VRF is accomplished via commands in the context of a VRF |
2243 | address-family: | |
b572f826 PZ |
2244 | |
2245 | .. index:: rd vpn export AS:NN|IP:nn | |
2246 | .. clicmd:: rd vpn export AS:NN|IP:nn | |
2247 | ||
4da7fda3 QY |
2248 | Specifies the route distinguisher to be added to a route exported from the |
2249 | current unicast VRF to VPN. | |
b572f826 PZ |
2250 | |
2251 | .. index:: no rd vpn export [AS:NN|IP:nn] | |
2252 | .. clicmd:: no rd vpn export [AS:NN|IP:nn] | |
2253 | ||
2254 | Deletes any previously-configured export route distinguisher. | |
2255 | ||
2256 | .. index:: rt vpn import|export|both RTLIST... | |
2257 | .. clicmd:: rt vpn import|export|both RTLIST... | |
2258 | ||
4da7fda3 QY |
2259 | Specifies the route-target list to be attached to a route (export) or the |
2260 | route-target list to match against (import) when exporting/importing between | |
2261 | the current unicast VRF and VPN. | |
b572f826 | 2262 | |
4da7fda3 QY |
2263 | The RTLIST is a space-separated list of route-targets, which are BGP |
2264 | extended community values as described in | |
b572f826 PZ |
2265 | :ref:`bgp-extended-communities-attribute`. |
2266 | ||
2267 | .. index:: no rt vpn import|export|both [RTLIST...] | |
2268 | .. clicmd:: no rt vpn import|export|both [RTLIST...] | |
2269 | ||
2270 | Deletes any previously-configured import or export route-target list. | |
2271 | ||
e70e9f8e PZ |
2272 | .. index:: label vpn export (0..1048575)|auto |
2273 | .. clicmd:: label vpn export (0..1048575)|auto | |
b572f826 | 2274 | |
8a2124f7 | 2275 | Enables an MPLS label to be attached to a route exported from the current |
2276 | unicast VRF to VPN. If the value specified is ``auto``, the label value is | |
2277 | automatically assigned from a pool maintained by the Zebra daemon. If Zebra | |
2278 | is not running, or if this command is not configured, automatic label | |
2279 | assignment will not complete, which will block corresponding route export. | |
b572f826 | 2280 | |
e70e9f8e PZ |
2281 | .. index:: no label vpn export [(0..1048575)|auto] |
2282 | .. clicmd:: no label vpn export [(0..1048575)|auto] | |
b572f826 PZ |
2283 | |
2284 | Deletes any previously-configured export label. | |
2285 | ||
2286 | .. index:: nexthop vpn export A.B.C.D|X:X::X:X | |
2287 | .. clicmd:: nexthop vpn export A.B.C.D|X:X::X:X | |
2288 | ||
4da7fda3 QY |
2289 | Specifies an optional nexthop value to be assigned to a route exported from |
2290 | the current unicast VRF to VPN. If left unspecified, the nexthop will be set | |
2291 | to 0.0.0.0 or 0:0::0:0 (self). | |
b572f826 PZ |
2292 | |
2293 | .. index:: no nexthop vpn export [A.B.C.D|X:X::X:X] | |
2294 | .. clicmd:: no nexthop vpn export [A.B.C.D|X:X::X:X] | |
2295 | ||
2296 | Deletes any previously-configured export nexthop. | |
2297 | ||
2298 | .. index:: route-map vpn import|export MAP | |
2299 | .. clicmd:: route-map vpn import|export MAP | |
2300 | ||
4da7fda3 | 2301 | Specifies an optional route-map to be applied to routes imported or exported |
d1e7591e | 2302 | between the current unicast VRF and VPN. |
b572f826 PZ |
2303 | |
2304 | .. index:: no route-map vpn import|export [MAP] | |
2305 | .. clicmd:: no route-map vpn import|export [MAP] | |
2306 | ||
2307 | Deletes any previously-configured import or export route-map. | |
2308 | ||
2309 | .. index:: import|export vpn | |
2310 | .. clicmd:: import|export vpn | |
2311 | ||
d1e7591e | 2312 | Enables import or export of routes between the current unicast VRF and VPN. |
b572f826 PZ |
2313 | |
2314 | .. index:: no import|export vpn | |
2315 | .. clicmd:: no import|export vpn | |
2316 | ||
d1e7591e | 2317 | Disables import or export of routes between the current unicast VRF and VPN. |
b572f826 | 2318 | |
fb3d9f3e DS |
2319 | .. index:: import vrf VRFNAME |
2320 | .. clicmd:: import vrf VRFNAME | |
2321 | ||
e967a1d0 DS |
2322 | Shortcut syntax for specifying automatic leaking from vrf VRFNAME to |
2323 | the current VRF using the VPN RIB as intermediary. The RD and RT | |
2324 | are auto derived and should not be specified explicitly for either the | |
2325 | source or destination VRF's. | |
2326 | ||
2327 | This shortcut syntax mode is not compatible with the explicit | |
2328 | `import vpn` and `export vpn` statements for the two VRF's involved. | |
2329 | The CLI will disallow attempts to configure incompatible leaking | |
2330 | modes. | |
fb3d9f3e DS |
2331 | |
2332 | .. index:: no import vrf VRFNAME | |
2333 | .. clicmd:: no import vrf VRFNAME | |
2334 | ||
e967a1d0 DS |
2335 | Disables automatic leaking from vrf VRFNAME to the current VRF using |
2336 | the VPN RIB as intermediary. | |
b572f826 | 2337 | |
42fc5d26 | 2338 | |
b6c34e85 CS |
2339 | .. _bgp-evpn: |
2340 | ||
2341 | Ethernet Virtual Network - EVPN | |
2342 | ------------------------------- | |
2343 | ||
2344 | .. _bgp-evpn-advertise-pip: | |
2345 | ||
2346 | EVPN advertise-PIP | |
2347 | ^^^^^^^^^^^^^^^^^^ | |
2348 | ||
2349 | In a EVPN symmetric routing MLAG deployment, all EVPN routes advertised | |
2350 | with anycast-IP as next-hop IP and anycast MAC as the Router MAC (RMAC - in | |
2351 | BGP EVPN Extended-Community). | |
2352 | EVPN picks up the next-hop IP from the VxLAN interface's local tunnel IP and | |
2353 | the RMAC is obtained from the MAC of the L3VNI's SVI interface. | |
2354 | Note: Next-hop IP is used for EVPN routes whether symmetric routing is | |
2355 | deployed or not but the RMAC is only relevant for symmetric routing scenario. | |
2356 | ||
2357 | Current behavior is not ideal for Prefix (type-5) and self (type-2) | |
2358 | routes. This is because the traffic from remote VTEPs routed sub optimally | |
2359 | if they land on the system where the route does not belong. | |
2360 | ||
2361 | The advertise-pip feature advertises Prefix (type-5) and self (type-2) | |
2362 | routes with system's individual (primary) IP as the next-hop and individual | |
2363 | (system) MAC as Router-MAC (RMAC), while leaving the behavior unchanged for | |
2364 | other EVPN routes. | |
2365 | ||
2366 | To support this feature there needs to have ability to co-exist a | |
2367 | (system-MAC, system-IP) pair with a (anycast-MAC, anycast-IP) pair with the | |
2368 | ability to terminate VxLAN-encapsulated packets received for either pair on | |
2369 | the same L3VNI (i.e associated VLAN). This capability is need per tenant | |
2370 | VRF instance. | |
2371 | ||
2372 | To derive the system-MAC and the anycast MAC, there needs to have a | |
2373 | separate/additional MAC-VLAN interface corresponding to L3VNI’s SVI. | |
2374 | The SVI interface’s MAC address can be interpreted as system-MAC | |
2375 | and MAC-VLAN interface's MAC as anycast MAC. | |
2376 | ||
2377 | To derive system-IP and anycast-IP, the default BGP instance's router-id is used | |
2378 | as system-IP and the VxLAN interface’s local tunnel IP as the anycast-IP. | |
2379 | ||
2380 | User has an option to configure the system-IP and/or system-MAC value if the | |
2381 | auto derived value is not preferred. | |
2382 | ||
2383 | Note: By default, advertise-pip feature is enabled and user has an option to | |
2384 | disable the feature via configuration CLI. Once the feature is disable under | |
2385 | bgp vrf instance or MAC-VLAN interface is not configured, all the routes follow | |
2386 | the same behavior of using same next-hop and RMAC values. | |
2387 | ||
2388 | .. index:: [no] advertise-pip [ip <addr> [mac <addr>]] | |
2389 | .. clicmd:: [no] advertise-pip [ip <addr> [mac <addr>]] | |
2390 | ||
2391 | Enables or disables advertise-pip feature, specifiy system-IP and/or system-MAC | |
2392 | parameters. | |
2393 | ||
8fcedbd2 | 2394 | .. _bgp-cisco-compatibility: |
42fc5d26 | 2395 | |
8fcedbd2 QY |
2396 | Cisco Compatibility |
2397 | ------------------- | |
42fc5d26 | 2398 | |
8fcedbd2 QY |
2399 | FRR has commands that change some configuration syntax and default behavior to |
2400 | behave more closely to Cisco conventions. These are deprecated and will be | |
2401 | removed in a future version of FRR. | |
42fc5d26 | 2402 | |
8fcedbd2 QY |
2403 | .. deprecated:: 5.0 |
2404 | Please transition to using the FRR specific syntax for your configuration. | |
42fc5d26 | 2405 | |
8fcedbd2 QY |
2406 | .. index:: bgp config-type cisco |
2407 | .. clicmd:: bgp config-type cisco | |
42fc5d26 | 2408 | |
8fcedbd2 | 2409 | Cisco compatible BGP configuration output. |
42fc5d26 | 2410 | |
8fcedbd2 | 2411 | When this configuration line is specified: |
c1a54c05 | 2412 | |
8fcedbd2 QY |
2413 | - ``no synchronization`` is displayed. This command does nothing and is for |
2414 | display purposes only. | |
2415 | - ``no auto-summary`` is displayed. | |
2416 | - The ``network`` and ``aggregate-address`` arguments are displayed as: | |
42fc5d26 | 2417 | |
8fcedbd2 | 2418 | :: |
42fc5d26 | 2419 | |
8fcedbd2 | 2420 | A.B.C.D M.M.M.M |
42fc5d26 | 2421 | |
8fcedbd2 QY |
2422 | FRR: network 10.0.0.0/8 |
2423 | Cisco: network 10.0.0.0 | |
42fc5d26 | 2424 | |
8fcedbd2 QY |
2425 | FRR: aggregate-address 192.168.0.0/24 |
2426 | Cisco: aggregate-address 192.168.0.0 255.255.255.0 | |
42fc5d26 | 2427 | |
8fcedbd2 QY |
2428 | Community attribute handling is also different. If no configuration is |
2429 | specified community attribute and extended community attribute are sent to | |
2430 | the neighbor. If a user manually disables the feature, the community | |
2431 | attribute is not sent to the neighbor. When ``bgp config-type cisco`` is | |
2432 | specified, the community attribute is not sent to the neighbor by default. | |
2433 | To send the community attribute user has to specify | |
2434 | :clicmd:`neighbor A.B.C.D send-community` like so: | |
42fc5d26 | 2435 | |
8fcedbd2 | 2436 | .. code-block:: frr |
42fc5d26 | 2437 | |
8fcedbd2 QY |
2438 | ! |
2439 | router bgp 1 | |
2440 | neighbor 10.0.0.1 remote-as 1 | |
2441 | address-family ipv4 unicast | |
2442 | no neighbor 10.0.0.1 send-community | |
2443 | exit-address-family | |
2444 | ! | |
2445 | router bgp 1 | |
2446 | neighbor 10.0.0.1 remote-as 1 | |
2447 | address-family ipv4 unicast | |
2448 | neighbor 10.0.0.1 send-community | |
2449 | exit-address-family | |
2450 | ! | |
42fc5d26 | 2451 | |
8fcedbd2 QY |
2452 | .. deprecated:: 5.0 |
2453 | Please transition to using the FRR specific syntax for your configuration. | |
2454 | ||
2455 | .. index:: bgp config-type zebra | |
2456 | .. clicmd:: bgp config-type zebra | |
2457 | ||
2458 | FRR style BGP configuration. This is the default. | |
2459 | ||
2460 | .. _bgp-debugging: | |
2461 | ||
2462 | Debugging | |
2463 | --------- | |
42fc5d26 | 2464 | |
c1a54c05 | 2465 | .. index:: show debug |
29adcd50 | 2466 | .. clicmd:: show debug |
42fc5d26 | 2467 | |
8fcedbd2 | 2468 | Show all enabled debugs. |
42fc5d26 | 2469 | |
54422b46 DS |
2470 | .. index:: show bgp listeners |
2471 | .. clicmd:: show bgp listeners | |
2472 | ||
2473 | Display Listen sockets and the vrf that created them. Useful for debugging of when | |
2474 | listen is not working and this is considered a developer debug statement. | |
2475 | ||
53b758f3 PG |
2476 | .. index:: [no] debug bgp neighbor-events |
2477 | .. clicmd:: [no] debug bgp neighbor-events | |
42fc5d26 | 2478 | |
8fcedbd2 QY |
2479 | Enable or disable debugging for neighbor events. This provides general |
2480 | information on BGP events such as peer connection / disconnection, session | |
2481 | establishment / teardown, and capability negotiation. | |
42fc5d26 | 2482 | |
53b758f3 PG |
2483 | .. index:: [no] debug bgp updates |
2484 | .. clicmd:: [no] debug bgp updates | |
42fc5d26 | 2485 | |
8fcedbd2 QY |
2486 | Enable or disable debugging for BGP updates. This provides information on |
2487 | BGP UPDATE messages transmitted and received between local and remote | |
2488 | instances. | |
42fc5d26 | 2489 | |
53b758f3 PG |
2490 | .. index:: [no] debug bgp keepalives |
2491 | .. clicmd:: [no] debug bgp keepalives | |
42fc5d26 | 2492 | |
8fcedbd2 QY |
2493 | Enable or disable debugging for BGP keepalives. This provides information on |
2494 | BGP KEEPALIVE messages transmitted and received between local and remote | |
2495 | instances. | |
c1a54c05 | 2496 | |
8fcedbd2 QY |
2497 | .. index:: [no] debug bgp bestpath <A.B.C.D/M|X:X::X:X/M> |
2498 | .. clicmd:: [no] debug bgp bestpath <A.B.C.D/M|X:X::X:X/M> | |
42fc5d26 | 2499 | |
8fcedbd2 | 2500 | Enable or disable debugging for bestpath selection on the specified prefix. |
42fc5d26 | 2501 | |
8fcedbd2 QY |
2502 | .. index:: [no] debug bgp nht |
2503 | .. clicmd:: [no] debug bgp nht | |
4da7fda3 | 2504 | |
8fcedbd2 | 2505 | Enable or disable debugging of BGP nexthop tracking. |
4da7fda3 | 2506 | |
8fcedbd2 QY |
2507 | .. index:: [no] debug bgp update-groups |
2508 | .. clicmd:: [no] debug bgp update-groups | |
4b44467c | 2509 | |
8fcedbd2 QY |
2510 | Enable or disable debugging of dynamic update groups. This provides general |
2511 | information on group creation, deletion, join and prune events. | |
4b44467c | 2512 | |
8fcedbd2 QY |
2513 | .. index:: [no] debug bgp zebra |
2514 | .. clicmd:: [no] debug bgp zebra | |
42fc5d26 | 2515 | |
8fcedbd2 | 2516 | Enable or disable debugging of communications between *bgpd* and *zebra*. |
c3c5a71f | 2517 | |
8fcedbd2 QY |
2518 | Dumping Messages and Routing Tables |
2519 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
42fc5d26 | 2520 | |
8fcedbd2 QY |
2521 | .. index:: dump bgp all PATH [INTERVAL] |
2522 | .. clicmd:: dump bgp all PATH [INTERVAL] | |
42fc5d26 | 2523 | |
8fcedbd2 QY |
2524 | .. index:: dump bgp all-et PATH [INTERVAL] |
2525 | .. clicmd:: dump bgp all-et PATH [INTERVAL] | |
c3c5a71f | 2526 | |
8fcedbd2 QY |
2527 | .. index:: no dump bgp all [PATH] [INTERVAL] |
2528 | .. clicmd:: no dump bgp all [PATH] [INTERVAL] | |
42fc5d26 | 2529 | |
8fcedbd2 QY |
2530 | Dump all BGP packet and events to `path` file. |
2531 | If `interval` is set, a new file will be created for echo `interval` of | |
2532 | seconds. The path `path` can be set with date and time formatting | |
2533 | (strftime). The type ‘all-et’ enables support for Extended Timestamp Header | |
2534 | (:ref:`packet-binary-dump-format`). | |
c3c5a71f | 2535 | |
8fcedbd2 QY |
2536 | .. index:: dump bgp updates PATH [INTERVAL] |
2537 | .. clicmd:: dump bgp updates PATH [INTERVAL] | |
42fc5d26 | 2538 | |
8fcedbd2 QY |
2539 | .. index:: dump bgp updates-et PATH [INTERVAL] |
2540 | .. clicmd:: dump bgp updates-et PATH [INTERVAL] | |
42fc5d26 | 2541 | |
8fcedbd2 QY |
2542 | .. index:: no dump bgp updates [PATH] [INTERVAL] |
2543 | .. clicmd:: no dump bgp updates [PATH] [INTERVAL] | |
42fc5d26 | 2544 | |
8fcedbd2 QY |
2545 | Dump only BGP updates messages to `path` file. |
2546 | If `interval` is set, a new file will be created for echo `interval` of | |
2547 | seconds. The path `path` can be set with date and time formatting | |
2548 | (strftime). The type ‘updates-et’ enables support for Extended Timestamp | |
2549 | Header (:ref:`packet-binary-dump-format`). | |
42fc5d26 | 2550 | |
8fcedbd2 QY |
2551 | .. index:: dump bgp routes-mrt PATH |
2552 | .. clicmd:: dump bgp routes-mrt PATH | |
c3c5a71f | 2553 | |
8fcedbd2 QY |
2554 | .. index:: dump bgp routes-mrt PATH INTERVAL |
2555 | .. clicmd:: dump bgp routes-mrt PATH INTERVAL | |
42fc5d26 | 2556 | |
8fcedbd2 QY |
2557 | .. index:: no dump bgp route-mrt [PATH] [INTERVAL] |
2558 | .. clicmd:: no dump bgp route-mrt [PATH] [INTERVAL] | |
42fc5d26 | 2559 | |
8fcedbd2 QY |
2560 | Dump whole BGP routing table to `path`. This is heavy process. The path |
2561 | `path` can be set with date and time formatting (strftime). If `interval` is | |
2562 | set, a new file will be created for echo `interval` of seconds. | |
42fc5d26 | 2563 | |
8fcedbd2 | 2564 | Note: the interval variable can also be set using hours and minutes: 04h20m00. |
42fc5d26 | 2565 | |
c3c5a71f | 2566 | |
8fcedbd2 | 2567 | .. _bgp-other-commands: |
42fc5d26 | 2568 | |
8fcedbd2 QY |
2569 | Other BGP Commands |
2570 | ------------------ | |
42fc5d26 | 2571 | |
e312b6c6 QY |
2572 | The following are available in the top level *enable* mode: |
2573 | ||
dc912615 DS |
2574 | .. index:: clear bgp \* |
2575 | .. clicmd:: clear bgp \* | |
2576 | ||
2577 | Clear all peers. | |
2578 | ||
8fcedbd2 QY |
2579 | .. index:: clear bgp ipv4|ipv6 \* |
2580 | .. clicmd:: clear bgp ipv4|ipv6 \* | |
42fc5d26 | 2581 | |
dc912615 DS |
2582 | Clear all peers with this address-family activated. |
2583 | ||
2584 | .. index:: clear bgp ipv4|ipv6 unicast \* | |
2585 | .. clicmd:: clear bgp ipv4|ipv6 unicast \* | |
2586 | ||
2587 | Clear all peers with this address-family and sub-address-family activated. | |
42fc5d26 | 2588 | |
8fcedbd2 QY |
2589 | .. index:: clear bgp ipv4|ipv6 PEER |
2590 | .. clicmd:: clear bgp ipv4|ipv6 PEER | |
42fc5d26 | 2591 | |
dc912615 DS |
2592 | Clear peers with address of X.X.X.X and this address-family activated. |
2593 | ||
2594 | .. index:: clear bgp ipv4|ipv6 unicast PEER | |
2595 | .. clicmd:: clear bgp ipv4|ipv6 unicast PEER | |
2596 | ||
2597 | Clear peer with address of X.X.X.X and this address-family and sub-address-family activated. | |
2598 | ||
2599 | .. index:: clear bgp ipv4|ipv6 PEER soft|in|out | |
2600 | .. clicmd:: clear bgp ipv4|ipv6 PEER soft|in|out | |
2601 | ||
2602 | Clear peer using soft reconfiguration in this address-family. | |
42fc5d26 | 2603 | |
dc912615 DS |
2604 | .. index:: clear bgp ipv4|ipv6 unicast PEER soft|in|out |
2605 | .. clicmd:: clear bgp ipv4|ipv6 unicast PEER soft|in|out | |
42fc5d26 | 2606 | |
dc912615 | 2607 | Clear peer using soft reconfiguration in this address-family and sub-address-family. |
42fc5d26 | 2608 | |
e312b6c6 QY |
2609 | The following are available in the ``router bgp`` mode: |
2610 | ||
2611 | .. index:: write-quanta (1-64) | |
2612 | .. clicmd:: write-quanta (1-64) | |
2613 | ||
2614 | BGP message Tx I/O is vectored. This means that multiple packets are written | |
2615 | to the peer socket at the same time each I/O cycle, in order to minimize | |
2616 | system call overhead. This value controls how many are written at a time. | |
2617 | Under certain load conditions, reducing this value could make peer traffic | |
2618 | less 'bursty'. In practice, leave this settings on the default (64) unless | |
2619 | you truly know what you are doing. | |
2620 | ||
2621 | .. index:: read-quanta (1-10) | |
dad83b67 | 2622 | .. clicmd:: read-quanta (1-10) |
e312b6c6 QY |
2623 | |
2624 | Unlike Tx, BGP Rx traffic is not vectored. Packets are read off the wire one | |
2625 | at a time in a loop. This setting controls how many iterations the loop runs | |
2626 | for. As with write-quanta, it is best to leave this setting on the default. | |
42fc5d26 | 2627 | |
8fcedbd2 | 2628 | .. _bgp-displaying-bgp-information: |
42fc5d26 | 2629 | |
8fcedbd2 QY |
2630 | Displaying BGP Information |
2631 | ========================== | |
42fc5d26 | 2632 | |
e6f59415 PG |
2633 | The following four commands display the IPv6 and IPv4 routing tables, depending |
2634 | on whether or not the ``ip`` keyword is used. | |
2635 | Actually, :clicmd:`show ip bgp` command was used on older `Quagga` routing | |
2636 | daemon project, while :clicmd:`show bgp` command is the new format. The choice | |
2637 | has been done to keep old format with IPv4 routing table, while new format | |
2638 | displays IPv6 routing table. | |
2639 | ||
8fcedbd2 QY |
2640 | .. index:: show ip bgp |
2641 | .. clicmd:: show ip bgp | |
42fc5d26 | 2642 | |
8fcedbd2 QY |
2643 | .. index:: show ip bgp A.B.C.D |
2644 | .. clicmd:: show ip bgp A.B.C.D | |
c1a54c05 | 2645 | |
e6f59415 PG |
2646 | .. index:: show bgp |
2647 | .. clicmd:: show bgp | |
2648 | ||
2649 | .. index:: show bgp X:X::X:X | |
2650 | .. clicmd:: show bgp X:X::X:X | |
42fc5d26 | 2651 | |
8fcedbd2 | 2652 | These commands display BGP routes. When no route is specified, the default |
e6f59415 | 2653 | is to display all BGP routes. |
42fc5d26 | 2654 | |
8fcedbd2 | 2655 | :: |
c1a54c05 | 2656 | |
8fcedbd2 QY |
2657 | BGP table version is 0, local router ID is 10.1.1.1 |
2658 | Status codes: s suppressed, d damped, h history, * valid, > best, i - internal | |
2659 | Origin codes: i - IGP, e - EGP, ? - incomplete | |
42fc5d26 | 2660 | |
8fcedbd2 QY |
2661 | Network Next Hop Metric LocPrf Weight Path |
2662 | \*> 1.1.1.1/32 0.0.0.0 0 32768 i | |
42fc5d26 | 2663 | |
8fcedbd2 | 2664 | Total number of prefixes 1 |
4da7fda3 | 2665 | |
e6f59415 PG |
2666 | Some other commands provide additional options for filtering the output. |
2667 | ||
2668 | .. index:: show [ip] bgp regexp LINE | |
2669 | .. clicmd:: show [ip] bgp regexp LINE | |
42fc5d26 | 2670 | |
8fcedbd2 QY |
2671 | This command displays BGP routes using AS path regular expression |
2672 | (:ref:`bgp-regular-expressions`). | |
42fc5d26 | 2673 | |
e6f59415 PG |
2674 | .. index:: show [ip] bgp summary |
2675 | .. clicmd:: show [ip] bgp summary | |
42fc5d26 | 2676 | |
8fcedbd2 | 2677 | Show a bgp peer summary for the specified address family. |
42fc5d26 | 2678 | |
e6f59415 PG |
2679 | The old command structure :clicmd:`show ip bgp` may be removed in the future |
2680 | and should no longer be used. In order to reach the other BGP routing tables | |
2681 | other than the IPv6 routing table given by :clicmd:`show bgp`, the new command | |
2682 | structure is extended with :clicmd:`show bgp [afi] [safi]`. | |
2683 | ||
2684 | .. index:: show bgp [afi] [safi] | |
2685 | .. clicmd:: show bgp [afi] [safi] | |
2686 | ||
2687 | .. index:: show bgp <ipv4|ipv6> <unicast|multicast|vpn|labeled-unicast> | |
2688 | .. clicmd:: show bgp <ipv4|ipv6> <unicast|multicast|vpn|labeled-unicast> | |
2689 | ||
2690 | These commands display BGP routes for the specific routing table indicated by | |
2691 | the selected afi and the selected safi. If no afi and no safi value is given, | |
6cfd16ad TA |
2692 | the command falls back to the default IPv6 routing table. |
2693 | For EVPN prefixes, you can display the full BGP table for this AFI/SAFI | |
2694 | using the standard `show bgp [afi] [safi]` syntax. | |
2695 | ||
2696 | .. index:: show bgp l2vpn evpn route [type <macip|2|multicast|3|es|4|prefix|5>] | |
2697 | .. clicmd:: show bgp l2vpn evpn route [type <macip|2|multicast|3|es|4|prefix|5>] | |
2698 | ||
2699 | Additionally, you can also filter this output by route type. | |
e6f59415 PG |
2700 | |
2701 | .. index:: show bgp [afi] [safi] summary | |
2702 | .. clicmd:: show bgp [afi] [safi] summary | |
2703 | ||
2704 | Show a bgp peer summary for the specified address family, and subsequent | |
2705 | address-family. | |
2706 | ||
3577f1c5 DD |
2707 | .. index:: show bgp [afi] [safi] summary failed [json] |
2708 | .. clicmd:: show bgp [afi] [safi] summary failed [json] | |
2709 | ||
2710 | Show a bgp peer summary for peers that are not succesfully exchanging routes | |
2711 | for the specified address family, and subsequent address-family. | |
2712 | ||
e6f59415 PG |
2713 | .. index:: show bgp [afi] [safi] neighbor [PEER] |
2714 | .. clicmd:: show bgp [afi] [safi] neighbor [PEER] | |
9eb95b3b | 2715 | |
e6f59415 PG |
2716 | This command shows information on a specific BGP peer of the relevant |
2717 | afi and safi selected. | |
c1a54c05 | 2718 | |
e6f59415 PG |
2719 | .. index:: show bgp [afi] [safi] dampening dampened-paths |
2720 | .. clicmd:: show bgp [afi] [safi] dampening dampened-paths | |
42fc5d26 | 2721 | |
e6f59415 PG |
2722 | Display paths suppressed due to dampening of the selected afi and safi |
2723 | selected. | |
42fc5d26 | 2724 | |
e6f59415 PG |
2725 | .. index:: show bgp [afi] [safi] dampening flap-statistics |
2726 | .. clicmd:: show bgp [afi] [safi] dampening flap-statistics | |
c1a54c05 | 2727 | |
e6f59415 | 2728 | Display flap statistics of routes of the selected afi and safi selected. |
42fc5d26 | 2729 | |
620e23e8 PG |
2730 | .. index:: show bgp [afi] [safi] statistics |
2731 | .. clicmd:: show bgp [afi] [safi] statistics | |
2732 | ||
2733 | Display statistics of routes of the selected afi and safi. | |
2734 | ||
2735 | .. index:: show bgp statistics-all | |
2736 | .. clicmd:: show bgp statistics-all | |
2737 | ||
2738 | Display statistics of routes of all the afi and safi. | |
2739 | ||
8fcedbd2 | 2740 | .. _bgp-display-routes-by-community: |
42fc5d26 | 2741 | |
8fcedbd2 QY |
2742 | Displaying Routes by Community Attribute |
2743 | ---------------------------------------- | |
42fc5d26 | 2744 | |
8fcedbd2 QY |
2745 | The following commands allow displaying routes based on their community |
2746 | attribute. | |
42fc5d26 | 2747 | |
8fcedbd2 QY |
2748 | .. index:: show [ip] bgp <ipv4|ipv6> community |
2749 | .. clicmd:: show [ip] bgp <ipv4|ipv6> community | |
42fc5d26 | 2750 | |
8fcedbd2 QY |
2751 | .. index:: show [ip] bgp <ipv4|ipv6> community COMMUNITY |
2752 | .. clicmd:: show [ip] bgp <ipv4|ipv6> community COMMUNITY | |
42fc5d26 | 2753 | |
8fcedbd2 QY |
2754 | .. index:: show [ip] bgp <ipv4|ipv6> community COMMUNITY exact-match |
2755 | .. clicmd:: show [ip] bgp <ipv4|ipv6> community COMMUNITY exact-match | |
76bd1499 | 2756 | |
8fcedbd2 QY |
2757 | These commands display BGP routes which have the community attribute. |
2758 | attribute. When ``COMMUNITY`` is specified, BGP routes that match that | |
2759 | community are displayed. When `exact-match` is specified, it display only | |
2760 | routes that have an exact match. | |
c3c5a71f | 2761 | |
8fcedbd2 QY |
2762 | .. index:: show [ip] bgp <ipv4|ipv6> community-list WORD |
2763 | .. clicmd:: show [ip] bgp <ipv4|ipv6> community-list WORD | |
42fc5d26 | 2764 | |
8fcedbd2 QY |
2765 | .. index:: show [ip] bgp <ipv4|ipv6> community-list WORD exact-match |
2766 | .. clicmd:: show [ip] bgp <ipv4|ipv6> community-list WORD exact-match | |
42fc5d26 | 2767 | |
8fcedbd2 QY |
2768 | These commands display BGP routes for the address family specified that |
2769 | match the specified community list. When `exact-match` is specified, it | |
2770 | displays only routes that have an exact match. | |
42fc5d26 | 2771 | |
36a206db | 2772 | .. _bgp-display-routes-by-lcommunity: |
2773 | ||
2774 | Displaying Routes by Large Community Attribute | |
2775 | ---------------------------------------------- | |
2776 | ||
ac2201bb | 2777 | The following commands allow displaying routes based on their |
36a206db | 2778 | large community attribute. |
2779 | ||
2780 | .. index:: show [ip] bgp <ipv4|ipv6> large-community | |
2781 | .. clicmd:: show [ip] bgp <ipv4|ipv6> large-community | |
2782 | ||
2783 | .. index:: show [ip] bgp <ipv4|ipv6> large-community LARGE-COMMUNITY | |
2784 | .. clicmd:: show [ip] bgp <ipv4|ipv6> large-community LARGE-COMMUNITY | |
2785 | ||
2786 | .. index:: show [ip] bgp <ipv4|ipv6> large-community LARGE-COMMUNITY exact-match | |
2787 | .. clicmd:: show [ip] bgp <ipv4|ipv6> large-community LARGE-COMMUNITY exact-match | |
2788 | ||
2789 | .. index:: show [ip] bgp <ipv4|ipv6> large-community LARGE-COMMUNITY json | |
2790 | .. clicmd:: show [ip] bgp <ipv4|ipv6> large-community LARGE-COMMUNITY json | |
2791 | ||
2792 | These commands display BGP routes which have the large community attribute. | |
2793 | attribute. When ``LARGE-COMMUNITY`` is specified, BGP routes that match that | |
ac2201bb DA |
2794 | large community are displayed. When `exact-match` is specified, it display |
2795 | only routes that have an exact match. When `json` is specified, it display | |
36a206db | 2796 | routes in json format. |
2797 | ||
2798 | .. index:: show [ip] bgp <ipv4|ipv6> large-community-list WORD | |
2799 | .. clicmd:: show [ip] bgp <ipv4|ipv6> large-community-list WORD | |
2800 | ||
2801 | .. index:: show [ip] bgp <ipv4|ipv6> large-community-list WORD exact-match | |
2802 | .. clicmd:: show [ip] bgp <ipv4|ipv6> large-community-list WORD exact-match | |
2803 | ||
2804 | .. index:: show [ip] bgp <ipv4|ipv6> large-community-list WORD json | |
2805 | .. clicmd:: show [ip] bgp <ipv4|ipv6> large-community-list WORD json | |
2806 | ||
2807 | These commands display BGP routes for the address family specified that | |
ac2201bb DA |
2808 | match the specified large community list. When `exact-match` is specified, |
2809 | it displays only routes that have an exact match. When `json` is specified, | |
36a206db | 2810 | it display routes in json format. |
2811 | ||
8fcedbd2 | 2812 | .. _bgp-display-routes-by-as-path: |
42fc5d26 | 2813 | |
36a206db | 2814 | |
8fcedbd2 QY |
2815 | Displaying Routes by AS Path |
2816 | ---------------------------- | |
42fc5d26 | 2817 | |
8fcedbd2 QY |
2818 | .. index:: show bgp ipv4|ipv6 regexp LINE |
2819 | .. clicmd:: show bgp ipv4|ipv6 regexp LINE | |
76bd1499 | 2820 | |
8fcedbd2 QY |
2821 | This commands displays BGP routes that matches a regular |
2822 | expression `line` (:ref:`bgp-regular-expressions`). | |
2823 | ||
e6f59415 PG |
2824 | .. index:: show [ip] bgp ipv4 vpn |
2825 | .. clicmd:: show [ip] bgp ipv4 vpn | |
8fcedbd2 | 2826 | |
e6f59415 PG |
2827 | .. index:: show [ip] bgp ipv6 vpn |
2828 | .. clicmd:: show [ip] bgp ipv6 vpn | |
8fcedbd2 QY |
2829 | |
2830 | Print active IPV4 or IPV6 routes advertised via the VPN SAFI. | |
2831 | ||
2832 | .. index:: show bgp ipv4 vpn summary | |
2833 | .. clicmd:: show bgp ipv4 vpn summary | |
2834 | ||
2835 | .. index:: show bgp ipv6 vpn summary | |
2836 | .. clicmd:: show bgp ipv6 vpn summary | |
2837 | ||
2838 | Print a summary of neighbor connections for the specified AFI/SAFI combination. | |
2839 | ||
09d78f10 DS |
2840 | Displaying Update Group Information |
2841 | ----------------------------------- | |
2842 | ||
6c5be52a SR |
2843 | .. index:: show bgp update-groups SUBGROUP-ID [advertise-queue|advertised-routes|packet-queue] |
2844 | .. clicmd:: show bgp update-groups [advertise-queue|advertised-routes|packet-queue] | |
09d78f10 DS |
2845 | |
2846 | Display Information about each individual update-group being used. | |
2847 | If SUBGROUP-ID is specified only display about that particular group. If | |
2848 | advertise-queue is specified the list of routes that need to be sent | |
2849 | to the peers in the update-group is displayed, advertised-routes means | |
a64e0ee5 | 2850 | the list of routes we have sent to the peers in the update-group and |
09d78f10 DS |
2851 | packet-queue specifies the list of packets in the queue to be sent. |
2852 | ||
6c5be52a SR |
2853 | .. index:: show bgp update-groups statistics |
2854 | .. clicmd:: show bgp update-groups statistics | |
09d78f10 DS |
2855 | |
2856 | Display Information about update-group events in FRR. | |
8fcedbd2 QY |
2857 | |
2858 | .. _bgp-route-reflector: | |
2859 | ||
2860 | Route Reflector | |
2861 | =============== | |
2862 | ||
749afd7d RF |
2863 | BGP routers connected inside the same AS through BGP belong to an internal |
2864 | BGP session, or IBGP. In order to prevent routing table loops, IBGP does not | |
2865 | advertise IBGP-learned routes to other routers in the same session. As such, | |
2866 | IBGP requires a full mesh of all peers. For large networks, this quickly becomes | |
2867 | unscalable. Introducing route reflectors removes the need for the full-mesh. | |
8fcedbd2 | 2868 | |
749afd7d RF |
2869 | When route reflectors are configured, these will reflect the routes announced |
2870 | by the peers configured as clients. A route reflector client is configured | |
2871 | with: | |
8fcedbd2 QY |
2872 | |
2873 | .. index:: neighbor PEER route-reflector-client | |
2874 | .. clicmd:: neighbor PEER route-reflector-client | |
2875 | ||
2876 | .. index:: no neighbor PEER route-reflector-client | |
2877 | .. clicmd:: no neighbor PEER route-reflector-client | |
c3c5a71f | 2878 | |
749afd7d RF |
2879 | To avoid single points of failure, multiple route reflectors can be configured. |
2880 | ||
2881 | A cluster is a collection of route reflectors and their clients, and is used | |
2882 | by route reflectors to avoid looping. | |
2883 | ||
2884 | .. index:: bgp cluster-id A.B.C.D | |
2885 | .. clicmd:: bgp cluster-id A.B.C.D | |
42fc5d26 | 2886 | |
0efdf0fe | 2887 | .. _routing-policy: |
42fc5d26 | 2888 | |
8fcedbd2 QY |
2889 | Routing Policy |
2890 | ============== | |
42fc5d26 | 2891 | |
4da7fda3 | 2892 | You can set different routing policy for a peer. For example, you can set |
9eb95b3b QY |
2893 | different filter for a peer. |
2894 | ||
2895 | .. code-block:: frr | |
c1a54c05 | 2896 | |
c1a54c05 QY |
2897 | ! |
2898 | router bgp 1 view 1 | |
2899 | neighbor 10.0.0.1 remote-as 2 | |
2900 | address-family ipv4 unicast | |
2901 | neighbor 10.0.0.1 distribute-list 1 in | |
2902 | exit-address-family | |
2903 | ! | |
2904 | router bgp 1 view 2 | |
2905 | neighbor 10.0.0.1 remote-as 2 | |
2906 | address-family ipv4 unicast | |
2907 | neighbor 10.0.0.1 distribute-list 2 in | |
2908 | exit-address-family | |
c3c5a71f | 2909 | |
4da7fda3 QY |
2910 | This means BGP update from a peer 10.0.0.1 goes to both BGP view 1 and view 2. |
2911 | When the update is inserted into view 1, distribute-list 1 is applied. On the | |
2912 | other hand, when the update is inserted into view 2, distribute-list 2 is | |
2913 | applied. | |
42fc5d26 | 2914 | |
42fc5d26 | 2915 | |
0efdf0fe | 2916 | .. _bgp-regular-expressions: |
42fc5d26 QY |
2917 | |
2918 | BGP Regular Expressions | |
2919 | ======================= | |
2920 | ||
8fcedbd2 QY |
2921 | BGP regular expressions are based on :t:`POSIX 1003.2` regular expressions. The |
2922 | following description is just a quick subset of the POSIX regular expressions. | |
42fc5d26 QY |
2923 | |
2924 | ||
8fcedbd2 | 2925 | .\* |
c1a54c05 | 2926 | Matches any single character. |
42fc5d26 | 2927 | |
8fcedbd2 | 2928 | \* |
c1a54c05 | 2929 | Matches 0 or more occurrences of pattern. |
42fc5d26 | 2930 | |
8fcedbd2 | 2931 | \+ |
c1a54c05 | 2932 | Matches 1 or more occurrences of pattern. |
42fc5d26 QY |
2933 | |
2934 | ? | |
c1a54c05 | 2935 | Match 0 or 1 occurrences of pattern. |
42fc5d26 QY |
2936 | |
2937 | ^ | |
c1a54c05 | 2938 | Matches the beginning of the line. |
42fc5d26 QY |
2939 | |
2940 | $ | |
c1a54c05 | 2941 | Matches the end of the line. |
42fc5d26 QY |
2942 | |
2943 | _ | |
8fcedbd2 QY |
2944 | The ``_`` character has special meanings in BGP regular expressions. It |
2945 | matches to space and comma , and AS set delimiter ``{`` and ``}`` and AS | |
2946 | confederation delimiter ``(`` and ``)``. And it also matches to the | |
2947 | beginning of the line and the end of the line. So ``_`` can be used for AS | |
2948 | value boundaries match. This character technically evaluates to | |
2949 | ``(^|[,{}()]|$)``. | |
42fc5d26 | 2950 | |
42fc5d26 | 2951 | |
c1a54c05 | 2952 | .. _bgp-configuration-examples: |
42fc5d26 | 2953 | |
8fcedbd2 QY |
2954 | Miscellaneous Configuration Examples |
2955 | ==================================== | |
42fc5d26 | 2956 | |
9eb95b3b QY |
2957 | Example of a session to an upstream, advertising only one prefix to it. |
2958 | ||
2959 | .. code-block:: frr | |
42fc5d26 | 2960 | |
c1a54c05 QY |
2961 | router bgp 64512 |
2962 | bgp router-id 10.236.87.1 | |
2963 | neighbor upstream peer-group | |
2964 | neighbor upstream remote-as 64515 | |
2965 | neighbor upstream capability dynamic | |
2966 | neighbor 10.1.1.1 peer-group upstream | |
2967 | neighbor 10.1.1.1 description ACME ISP | |
c3c5a71f | 2968 | |
c1a54c05 QY |
2969 | address-family ipv4 unicast |
2970 | network 10.236.87.0/24 | |
2971 | neighbor upstream prefix-list pl-allowed-adv out | |
2972 | exit-address-family | |
2973 | ! | |
2974 | ip prefix-list pl-allowed-adv seq 5 permit 82.195.133.0/25 | |
2975 | ip prefix-list pl-allowed-adv seq 10 deny any | |
42fc5d26 | 2976 | |
aa9eafa4 QY |
2977 | A more complex example including upstream, peer and customer sessions |
2978 | advertising global prefixes and NO_EXPORT prefixes and providing actions for | |
2979 | customer routes based on community values. Extensive use is made of route-maps | |
2980 | and the 'call' feature to support selective advertising of prefixes. This | |
2981 | example is intended as guidance only, it has NOT been tested and almost | |
2982 | certainly contains silly mistakes, if not serious flaws. | |
42fc5d26 | 2983 | |
9eb95b3b | 2984 | .. code-block:: frr |
42fc5d26 | 2985 | |
c1a54c05 QY |
2986 | router bgp 64512 |
2987 | bgp router-id 10.236.87.1 | |
2988 | neighbor upstream capability dynamic | |
2989 | neighbor cust capability dynamic | |
2990 | neighbor peer capability dynamic | |
2991 | neighbor 10.1.1.1 remote-as 64515 | |
2992 | neighbor 10.1.1.1 peer-group upstream | |
2993 | neighbor 10.2.1.1 remote-as 64516 | |
2994 | neighbor 10.2.1.1 peer-group upstream | |
2995 | neighbor 10.3.1.1 remote-as 64517 | |
2996 | neighbor 10.3.1.1 peer-group cust-default | |
2997 | neighbor 10.3.1.1 description customer1 | |
2998 | neighbor 10.4.1.1 remote-as 64518 | |
2999 | neighbor 10.4.1.1 peer-group cust | |
3000 | neighbor 10.4.1.1 description customer2 | |
3001 | neighbor 10.5.1.1 remote-as 64519 | |
3002 | neighbor 10.5.1.1 peer-group peer | |
3003 | neighbor 10.5.1.1 description peer AS 1 | |
3004 | neighbor 10.6.1.1 remote-as 64520 | |
3005 | neighbor 10.6.1.1 peer-group peer | |
3006 | neighbor 10.6.1.1 description peer AS 2 | |
3007 | ||
3008 | address-family ipv4 unicast | |
3009 | network 10.123.456.0/24 | |
3010 | network 10.123.456.128/25 route-map rm-no-export | |
3011 | neighbor upstream route-map rm-upstream-out out | |
3012 | neighbor cust route-map rm-cust-in in | |
3013 | neighbor cust route-map rm-cust-out out | |
3014 | neighbor cust send-community both | |
3015 | neighbor peer route-map rm-peer-in in | |
3016 | neighbor peer route-map rm-peer-out out | |
3017 | neighbor peer send-community both | |
3018 | neighbor 10.3.1.1 prefix-list pl-cust1-network in | |
3019 | neighbor 10.4.1.1 prefix-list pl-cust2-network in | |
3020 | neighbor 10.5.1.1 prefix-list pl-peer1-network in | |
3021 | neighbor 10.6.1.1 prefix-list pl-peer2-network in | |
3022 | exit-address-family | |
3023 | ! | |
3024 | ip prefix-list pl-default permit 0.0.0.0/0 | |
3025 | ! | |
3026 | ip prefix-list pl-upstream-peers permit 10.1.1.1/32 | |
3027 | ip prefix-list pl-upstream-peers permit 10.2.1.1/32 | |
3028 | ! | |
3029 | ip prefix-list pl-cust1-network permit 10.3.1.0/24 | |
3030 | ip prefix-list pl-cust1-network permit 10.3.2.0/24 | |
3031 | ! | |
3032 | ip prefix-list pl-cust2-network permit 10.4.1.0/24 | |
3033 | ! | |
3034 | ip prefix-list pl-peer1-network permit 10.5.1.0/24 | |
3035 | ip prefix-list pl-peer1-network permit 10.5.2.0/24 | |
3036 | ip prefix-list pl-peer1-network permit 192.168.0.0/24 | |
3037 | ! | |
3038 | ip prefix-list pl-peer2-network permit 10.6.1.0/24 | |
3039 | ip prefix-list pl-peer2-network permit 10.6.2.0/24 | |
3040 | ip prefix-list pl-peer2-network permit 192.168.1.0/24 | |
3041 | ip prefix-list pl-peer2-network permit 192.168.2.0/24 | |
3042 | ip prefix-list pl-peer2-network permit 172.16.1/24 | |
3043 | ! | |
9b6fddd4 DS |
3044 | bgp as-path access-list asp-own-as permit ^$ |
3045 | bgp as-path access-list asp-own-as permit _64512_ | |
c1a54c05 QY |
3046 | ! |
3047 | ! ################################################################# | |
3048 | ! Match communities we provide actions for, on routes receives from | |
3049 | ! customers. Communities values of <our-ASN>:X, with X, have actions: | |
3050 | ! | |
3051 | ! 100 - blackhole the prefix | |
3052 | ! 200 - set no_export | |
3053 | ! 300 - advertise only to other customers | |
3054 | ! 400 - advertise only to upstreams | |
3055 | ! 500 - set no_export when advertising to upstreams | |
3056 | ! 2X00 - set local_preference to X00 | |
3057 | ! | |
3058 | ! blackhole the prefix of the route | |
a64e0ee5 | 3059 | bgp community-list standard cm-blackhole permit 64512:100 |
c1a54c05 QY |
3060 | ! |
3061 | ! set no-export community before advertising | |
a64e0ee5 | 3062 | bgp community-list standard cm-set-no-export permit 64512:200 |
c1a54c05 QY |
3063 | ! |
3064 | ! advertise only to other customers | |
a64e0ee5 | 3065 | bgp community-list standard cm-cust-only permit 64512:300 |
c1a54c05 QY |
3066 | ! |
3067 | ! advertise only to upstreams | |
a64e0ee5 | 3068 | bgp community-list standard cm-upstream-only permit 64512:400 |
c1a54c05 QY |
3069 | ! |
3070 | ! advertise to upstreams with no-export | |
a64e0ee5 | 3071 | bgp community-list standard cm-upstream-noexport permit 64512:500 |
c1a54c05 QY |
3072 | ! |
3073 | ! set local-pref to least significant 3 digits of the community | |
a64e0ee5 DA |
3074 | bgp community-list standard cm-prefmod-100 permit 64512:2100 |
3075 | bgp community-list standard cm-prefmod-200 permit 64512:2200 | |
3076 | bgp community-list standard cm-prefmod-300 permit 64512:2300 | |
3077 | bgp community-list standard cm-prefmod-400 permit 64512:2400 | |
3078 | bgp community-list expanded cme-prefmod-range permit 64512:2... | |
c1a54c05 QY |
3079 | ! |
3080 | ! Informational communities | |
3081 | ! | |
3082 | ! 3000 - learned from upstream | |
3083 | ! 3100 - learned from customer | |
3084 | ! 3200 - learned from peer | |
3085 | ! | |
a64e0ee5 DA |
3086 | bgp community-list standard cm-learnt-upstream permit 64512:3000 |
3087 | bgp community-list standard cm-learnt-cust permit 64512:3100 | |
3088 | bgp community-list standard cm-learnt-peer permit 64512:3200 | |
c1a54c05 QY |
3089 | ! |
3090 | ! ################################################################### | |
3091 | ! Utility route-maps | |
3092 | ! | |
3093 | ! These utility route-maps generally should not used to permit/deny | |
3094 | ! routes, i.e. they do not have meaning as filters, and hence probably | |
3095 | ! should be used with 'on-match next'. These all finish with an empty | |
3096 | ! permit entry so as not interfere with processing in the caller. | |
3097 | ! | |
3098 | route-map rm-no-export permit 10 | |
3099 | set community additive no-export | |
3100 | route-map rm-no-export permit 20 | |
3101 | ! | |
3102 | route-map rm-blackhole permit 10 | |
f6aa36f5 | 3103 | description blackhole, up-pref and ensure it cannot escape this AS |
c1a54c05 QY |
3104 | set ip next-hop 127.0.0.1 |
3105 | set local-preference 10 | |
3106 | set community additive no-export | |
3107 | route-map rm-blackhole permit 20 | |
3108 | ! | |
3109 | ! Set local-pref as requested | |
3110 | route-map rm-prefmod permit 10 | |
3111 | match community cm-prefmod-100 | |
3112 | set local-preference 100 | |
3113 | route-map rm-prefmod permit 20 | |
3114 | match community cm-prefmod-200 | |
3115 | set local-preference 200 | |
3116 | route-map rm-prefmod permit 30 | |
3117 | match community cm-prefmod-300 | |
3118 | set local-preference 300 | |
3119 | route-map rm-prefmod permit 40 | |
3120 | match community cm-prefmod-400 | |
3121 | set local-preference 400 | |
3122 | route-map rm-prefmod permit 50 | |
3123 | ! | |
3124 | ! Community actions to take on receipt of route. | |
3125 | route-map rm-community-in permit 10 | |
3126 | description check for blackholing, no point continuing if it matches. | |
3127 | match community cm-blackhole | |
3128 | call rm-blackhole | |
3129 | route-map rm-community-in permit 20 | |
3130 | match community cm-set-no-export | |
3131 | call rm-no-export | |
3132 | on-match next | |
3133 | route-map rm-community-in permit 30 | |
3134 | match community cme-prefmod-range | |
3135 | call rm-prefmod | |
3136 | route-map rm-community-in permit 40 | |
3137 | ! | |
3138 | ! ##################################################################### | |
3139 | ! Community actions to take when advertising a route. | |
3140 | ! These are filtering route-maps, | |
3141 | ! | |
3142 | ! Deny customer routes to upstream with cust-only set. | |
3143 | route-map rm-community-filt-to-upstream deny 10 | |
3144 | match community cm-learnt-cust | |
3145 | match community cm-cust-only | |
3146 | route-map rm-community-filt-to-upstream permit 20 | |
3147 | ! | |
3148 | ! Deny customer routes to other customers with upstream-only set. | |
3149 | route-map rm-community-filt-to-cust deny 10 | |
3150 | match community cm-learnt-cust | |
3151 | match community cm-upstream-only | |
3152 | route-map rm-community-filt-to-cust permit 20 | |
3153 | ! | |
3154 | ! ################################################################### | |
3155 | ! The top-level route-maps applied to sessions. Further entries could | |
3156 | ! be added obviously.. | |
3157 | ! | |
3158 | ! Customers | |
3159 | route-map rm-cust-in permit 10 | |
3160 | call rm-community-in | |
3161 | on-match next | |
3162 | route-map rm-cust-in permit 20 | |
3163 | set community additive 64512:3100 | |
3164 | route-map rm-cust-in permit 30 | |
3165 | ! | |
3166 | route-map rm-cust-out permit 10 | |
3167 | call rm-community-filt-to-cust | |
3168 | on-match next | |
3169 | route-map rm-cust-out permit 20 | |
3170 | ! | |
3171 | ! Upstream transit ASes | |
3172 | route-map rm-upstream-out permit 10 | |
3173 | description filter customer prefixes which are marked cust-only | |
3174 | call rm-community-filt-to-upstream | |
3175 | on-match next | |
3176 | route-map rm-upstream-out permit 20 | |
3177 | description only customer routes are provided to upstreams/peers | |
3178 | match community cm-learnt-cust | |
3179 | ! | |
3180 | ! Peer ASes | |
3181 | ! outbound policy is same as for upstream | |
3182 | route-map rm-peer-out permit 10 | |
3183 | call rm-upstream-out | |
3184 | ! | |
3185 | route-map rm-peer-in permit 10 | |
3186 | set community additive 64512:3200 | |
c3c5a71f | 3187 | |
8fcedbd2 QY |
3188 | |
3189 | Example of how to set up a 6-Bone connection. | |
3190 | ||
3191 | .. code-block:: frr | |
3192 | ||
3193 | ! bgpd configuration | |
3194 | ! ================== | |
3195 | ! | |
3196 | ! MP-BGP configuration | |
3197 | ! | |
3198 | router bgp 7675 | |
3199 | bgp router-id 10.0.0.1 | |
3200 | neighbor 3ffe:1cfa:0:2:2a0:c9ff:fe9e:f56 remote-as `as-number` | |
3201 | ! | |
3202 | address-family ipv6 | |
3203 | network 3ffe:506::/32 | |
3204 | neighbor 3ffe:1cfa:0:2:2a0:c9ff:fe9e:f56 activate | |
3205 | neighbor 3ffe:1cfa:0:2:2a0:c9ff:fe9e:f56 route-map set-nexthop out | |
3206 | neighbor 3ffe:1cfa:0:2:2c0:4fff:fe68:a231 remote-as `as-number` | |
3207 | neighbor 3ffe:1cfa:0:2:2c0:4fff:fe68:a231 route-map set-nexthop out | |
3208 | exit-address-family | |
3209 | ! | |
3210 | ipv6 access-list all permit any | |
3211 | ! | |
3212 | ! Set output nexthop address. | |
3213 | ! | |
3214 | route-map set-nexthop permit 10 | |
3215 | match ipv6 address all | |
3216 | set ipv6 nexthop global 3ffe:1cfa:0:2:2c0:4fff:fe68:a225 | |
3217 | set ipv6 nexthop local fe80::2c0:4fff:fe68:a225 | |
3218 | ! | |
3219 | log file bgpd.log | |
3220 | ! | |
3221 | ||
3222 | ||
9e146a81 | 3223 | .. include:: routeserver.rst |
f3817860 QY |
3224 | |
3225 | .. include:: rpki.rst | |
c1a54c05 | 3226 | |
ed647ed2 | 3227 | .. include:: wecmp_linkbw.rst |
3228 | ||
00458d01 PG |
3229 | .. include:: flowspec.rst |
3230 | ||
d1e7591e | 3231 | .. [#med-transitivity-rant] For some set of objects to have an order, there *must* be some binary ordering relation that is defined for *every* combination of those objects, and that relation *must* be transitive. I.e.:, if the relation operator is <, and if a < b and b < c then that relation must carry over and it *must* be that a < c for the objects to have an order. The ordering relation may allow for equality, i.e. a < b and b < a may both be true and imply that a and b are equal in the order and not distinguished by it, in which case the set has a partial order. Otherwise, if there is an order, all the objects have a distinct place in the order and the set has a total order) |
c1a54c05 QY |
3232 | .. [bgp-route-osci-cond] McPherson, D. and Gill, V. and Walton, D., "Border Gateway Protocol (BGP) Persistent Route Oscillation Condition", IETF RFC3345 |
3233 | .. [stable-flexible-ibgp] Flavel, A. and M. Roughan, "Stable and flexible iBGP", ACM SIGCOMM 2009 | |
3234 | .. [ibgp-correctness] Griffin, T. and G. Wilfong, "On the correctness of IBGP configuration", ACM SIGCOMM 2002 |