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