paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1 | @c -*-texinfo-*- |
paul | 7190f4e | 2003-08-12 12:40:20 +0000 | [diff] [blame] | 2 | @c This is part of the Quagga Manual. |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 3 | @c @value{COPYRIGHT_STR} |
| 4 | @c See file quagga.texi for copying conditions. |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 5 | @node BGP |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6 | @chapter BGP |
| 7 | |
paul | aa5943f | 2005-11-04 21:53:59 +0000 | [diff] [blame] | 8 | @acronym{BGP} stands for a Border Gateway Protocol. The lastest BGP version |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9 | is 4. It is referred as BGP-4. BGP-4 is one of the Exterior Gateway |
| 10 | Protocols and de-fact standard of Inter Domain routing protocol. |
paul | aa5943f | 2005-11-04 21:53:59 +0000 | [diff] [blame] | 11 | BGP-4 is described in @cite{RFC1771, A Border Gateway Protocol |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 12 | 4 (BGP-4)}. |
| 13 | |
paul | aa5943f | 2005-11-04 21:53:59 +0000 | [diff] [blame] | 14 | Many extensions have been added to @cite{RFC1771}. @cite{RFC2858, |
| 15 | Multiprotocol Extensions for BGP-4} provides multiprotocol support to |
| 16 | BGP-4. |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 17 | |
| 18 | @menu |
| 19 | * Starting BGP:: |
| 20 | * BGP router:: |
| 21 | * BGP network:: |
| 22 | * BGP Peer:: |
| 23 | * BGP Peer Group:: |
| 24 | * BGP Address Family:: |
| 25 | * Autonomous System:: |
| 26 | * BGP Communities Attribute:: |
| 27 | * BGP Extended Communities Attribute:: |
| 28 | * Displaying BGP routes:: |
| 29 | * Capability Negotiation:: |
| 30 | * Route Reflector:: |
| 31 | * Route Server:: |
| 32 | * How to set up a 6-Bone connection:: |
| 33 | * Dump BGP packets and table:: |
paul | aa5943f | 2005-11-04 21:53:59 +0000 | [diff] [blame] | 34 | * BGP Configuration Examples:: |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 35 | @end menu |
| 36 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 37 | @node Starting BGP |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 38 | @section Starting BGP |
| 39 | |
| 40 | Default configuration file of @command{bgpd} is @file{bgpd.conf}. |
| 41 | @command{bgpd} searches the current directory first then |
| 42 | @value{INSTALL_PREFIX_ETC}/bgpd.conf. All of bgpd's command must be |
| 43 | configured in @file{bgpd.conf}. |
| 44 | |
| 45 | @command{bgpd} specific invocation options are described below. Common |
| 46 | options may also be specified (@pxref{Common Invocation Options}). |
| 47 | |
| 48 | @table @samp |
| 49 | @item -p @var{PORT} |
| 50 | @itemx --bgp_port=@var{PORT} |
| 51 | Set the bgp protocol's port number. |
| 52 | |
| 53 | @item -r |
| 54 | @itemx --retain |
| 55 | When program terminates, retain BGP routes added by zebra. |
| 56 | @end table |
| 57 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 58 | @node BGP router |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 59 | @section BGP router |
| 60 | |
| 61 | First of all you must configure BGP router with @command{router bgp} |
| 62 | command. To configure BGP router, you need AS number. AS number is an |
| 63 | identification of autonomous system. BGP protocol uses the AS number |
| 64 | for detecting whether the BGP connection is internal one or external one. |
| 65 | |
| 66 | @deffn Command {router bgp @var{asn}} {} |
| 67 | Enable a BGP protocol process with the specified @var{asn}. After |
| 68 | this statement you can input any @code{BGP Commands}. You can not |
| 69 | create different BGP process under different @var{asn} without |
| 70 | specifying @code{multiple-instance} (@pxref{Multiple instance}). |
| 71 | @end deffn |
| 72 | |
| 73 | @deffn Command {no router bgp @var{asn}} {} |
| 74 | Destroy a BGP protocol process with the specified @var{asn}. |
| 75 | @end deffn |
| 76 | |
| 77 | @deffn {BGP} {bgp router-id @var{A.B.C.D}} {} |
| 78 | This command specifies the router-ID. If @command{bgpd} connects to @command{zebra} it gets |
| 79 | interface and address information. In that case default router ID value |
| 80 | is selected as the largest IP Address of the interfaces. When |
| 81 | @code{router zebra} is not enabled @command{bgpd} can't get interface information |
| 82 | so @code{router-id} is set to 0.0.0.0. So please set router-id by hand. |
| 83 | @end deffn |
| 84 | |
| 85 | @menu |
| 86 | * BGP distance:: |
| 87 | * BGP decision process:: |
Alexandre Chappuis | c31e572 | 2011-09-11 16:54:11 +0400 | [diff] [blame] | 88 | * BGP route flap dampening:: |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 89 | @end menu |
| 90 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 91 | @node BGP distance |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 92 | @subsection BGP distance |
| 93 | |
| 94 | @deffn {BGP} {distance bgp <1-255> <1-255> <1-255>} {} |
| 95 | This command change distance value of BGP. Each argument is distance |
| 96 | value for external routes, internal routes and local routes. |
| 97 | @end deffn |
| 98 | |
| 99 | @deffn {BGP} {distance <1-255> @var{A.B.C.D/M}} {} |
| 100 | @deffnx {BGP} {distance <1-255> @var{A.B.C.D/M} @var{word}} {} |
| 101 | This command set distance value to |
| 102 | @end deffn |
| 103 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 104 | @node BGP decision process |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 105 | @subsection BGP decision process |
| 106 | |
| 107 | @table @asis |
| 108 | @item 1. Weight check |
| 109 | |
| 110 | @item 2. Local preference check. |
| 111 | |
| 112 | @item 3. Local route check. |
| 113 | |
| 114 | @item 4. AS path length check. |
| 115 | |
| 116 | @item 5. Origin check. |
| 117 | |
| 118 | @item 6. MED check. |
| 119 | @end table |
| 120 | |
hasso | 6811845 | 2005-04-08 15:40:36 +0000 | [diff] [blame] | 121 | @deffn {BGP} {bgp bestpath as-path confed} {} |
| 122 | This command specifies that the length of confederation path sets and |
| 123 | sequences should should be taken into account during the BGP best path |
| 124 | decision process. |
| 125 | @end deffn |
| 126 | |
Pradosh Mohapatra | 2fdd455 | 2013-09-07 07:02:36 +0000 | [diff] [blame] | 127 | @deffn {BGP} {bgp bestpath as-path multipath-relax} {} |
| 128 | This command specifies that BGP decision process should consider paths |
| 129 | of equal AS_PATH length candidates for multipath computation. Without |
| 130 | the knob, the entire AS_PATH must match for multipath computation. |
| 131 | @end deffn |
| 132 | |
Alexandre Chappuis | c31e572 | 2011-09-11 16:54:11 +0400 | [diff] [blame] | 133 | @node BGP route flap dampening |
| 134 | @subsection BGP route flap dampening |
| 135 | |
| 136 | @deffn {BGP} {bgp dampening @var{<1-45>} @var{<1-20000>} @var{<1-20000>} @var{<1-255>}} {} |
| 137 | This command enables BGP route-flap dampening and specifies dampening parameters. |
| 138 | |
| 139 | @table @asis |
| 140 | @item @asis{half-life} |
| 141 | Half-life time for the penalty |
| 142 | @item @asis{reuse-threshold} |
| 143 | Value to start reusing a route |
| 144 | @item @asis{suppress-threshold} |
| 145 | Value to start suppressing a route |
| 146 | @item @asis{max-suppress} |
| 147 | Maximum duration to suppress a stable route |
| 148 | @end table |
| 149 | |
| 150 | The route-flap damping algorithm is compatible with @cite{RFC2439}. The use of this command |
| 151 | is not recommended nowadays, see @uref{http://www.ripe.net/ripe/docs/ripe-378,,RIPE-378}. |
| 152 | @end deffn |
| 153 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 154 | @node BGP network |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 155 | @section BGP network |
| 156 | |
| 157 | @menu |
| 158 | * BGP route:: |
| 159 | * Route Aggregation:: |
| 160 | * Redistribute to BGP:: |
| 161 | @end menu |
| 162 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 163 | @node BGP route |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 164 | @subsection BGP route |
| 165 | |
| 166 | @deffn {BGP} {network @var{A.B.C.D/M}} {} |
| 167 | This command adds the announcement network. |
| 168 | @example |
| 169 | @group |
| 170 | router bgp 1 |
| 171 | network 10.0.0.0/8 |
| 172 | @end group |
| 173 | @end example |
| 174 | This configuration example says that network 10.0.0.0/8 will be |
| 175 | announced to all neighbors. Some vendors' routers don't advertise |
Paul Jakma | 4136717 | 2007-08-06 15:24:51 +0000 | [diff] [blame] | 176 | routes if they aren't present in their IGP routing tables; @code{bgpd} |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 177 | doesn't care about IGP routes when announcing its routes. |
| 178 | @end deffn |
| 179 | |
| 180 | @deffn {BGP} {no network @var{A.B.C.D/M}} {} |
| 181 | @end deffn |
| 182 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 183 | @node Route Aggregation |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 184 | @subsection Route Aggregation |
| 185 | |
| 186 | @deffn {BGP} {aggregate-address @var{A.B.C.D/M}} {} |
| 187 | This command specifies an aggregate address. |
| 188 | @end deffn |
| 189 | |
| 190 | @deffn {BGP} {aggregate-address @var{A.B.C.D/M} as-set} {} |
| 191 | This command specifies an aggregate address. Resulting routes inlucde |
| 192 | AS set. |
| 193 | @end deffn |
| 194 | |
| 195 | @deffn {BGP} {aggregate-address @var{A.B.C.D/M} summary-only} {} |
| 196 | This command specifies an aggregate address. Aggreated routes will |
| 197 | not be announce. |
| 198 | @end deffn |
| 199 | |
| 200 | @deffn {BGP} {no aggregate-address @var{A.B.C.D/M}} {} |
| 201 | @end deffn |
| 202 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 203 | @node Redistribute to BGP |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 204 | @subsection Redistribute to BGP |
| 205 | |
| 206 | @deffn {BGP} {redistribute kernel} {} |
| 207 | Redistribute kernel route to BGP process. |
| 208 | @end deffn |
| 209 | |
| 210 | @deffn {BGP} {redistribute static} {} |
| 211 | Redistribute static route to BGP process. |
| 212 | @end deffn |
| 213 | |
| 214 | @deffn {BGP} {redistribute connected} {} |
| 215 | Redistribute connected route to BGP process. |
| 216 | @end deffn |
| 217 | |
| 218 | @deffn {BGP} {redistribute rip} {} |
| 219 | Redistribute RIP route to BGP process. |
| 220 | @end deffn |
| 221 | |
| 222 | @deffn {BGP} {redistribute ospf} {} |
| 223 | Redistribute OSPF route to BGP process. |
| 224 | @end deffn |
| 225 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 226 | @node BGP Peer |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 227 | @section BGP Peer |
| 228 | |
| 229 | @menu |
| 230 | * Defining Peer:: |
| 231 | * BGP Peer commands:: |
| 232 | * Peer filtering:: |
| 233 | @end menu |
| 234 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 235 | @node Defining Peer |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 236 | @subsection Defining Peer |
| 237 | |
| 238 | @deffn {BGP} {neighbor @var{peer} remote-as @var{asn}} {} |
| 239 | Creates a new neighbor whose remote-as is @var{asn}. @var{peer} |
| 240 | can be an IPv4 address or an IPv6 address. |
| 241 | @example |
| 242 | @group |
| 243 | router bgp 1 |
| 244 | neighbor 10.0.0.1 remote-as 2 |
| 245 | @end group |
| 246 | @end example |
| 247 | In this case my router, in AS-1, is trying to peer with AS-2 at |
| 248 | 10.0.0.1. |
| 249 | |
| 250 | This command must be the first command used when configuring a neighbor. |
| 251 | If the remote-as is not specified, @command{bgpd} will complain like this: |
| 252 | @example |
| 253 | can't find neighbor 10.0.0.1 |
| 254 | @end example |
| 255 | @end deffn |
| 256 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 257 | @node BGP Peer commands |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 258 | @subsection BGP Peer commands |
| 259 | |
| 260 | In a @code{router bgp} clause there are neighbor specific configurations |
| 261 | required. |
| 262 | |
| 263 | @deffn {BGP} {neighbor @var{peer} shutdown} {} |
| 264 | @deffnx {BGP} {no neighbor @var{peer} shutdown} {} |
| 265 | Shutdown the peer. We can delete the neighbor's configuration by |
| 266 | @code{no neighbor @var{peer} remote-as @var{as-number}} but all |
| 267 | configuration of the neighbor will be deleted. When you want to |
| 268 | preserve the configuration, but want to drop the BGP peer, use this |
| 269 | syntax. |
| 270 | @end deffn |
| 271 | |
| 272 | @deffn {BGP} {neighbor @var{peer} ebgp-multihop} {} |
| 273 | @deffnx {BGP} {no neighbor @var{peer} ebgp-multihop} {} |
| 274 | @end deffn |
| 275 | |
| 276 | @deffn {BGP} {neighbor @var{peer} description ...} {} |
| 277 | @deffnx {BGP} {no neighbor @var{peer} description ...} {} |
| 278 | Set description of the peer. |
| 279 | @end deffn |
| 280 | |
| 281 | @deffn {BGP} {neighbor @var{peer} version @var{version}} {} |
| 282 | Set up the neighbor's BGP version. @var{version} can be @var{4}, |
| 283 | @var{4+} or @var{4-}. BGP version @var{4} is the default value used for |
| 284 | BGP peering. BGP version @var{4+} means that the neighbor supports |
| 285 | Multiprotocol Extensions for BGP-4. BGP version @var{4-} is similar but |
| 286 | the neighbor speaks the old Internet-Draft revision 00's Multiprotocol |
| 287 | Extensions for BGP-4. Some routing software is still using this |
| 288 | version. |
| 289 | @end deffn |
| 290 | |
| 291 | @deffn {BGP} {neighbor @var{peer} interface @var{ifname}} {} |
| 292 | @deffnx {BGP} {no neighbor @var{peer} interface @var{ifname}} {} |
Paul Jakma | 825cd49 | 2006-05-23 22:20:34 +0000 | [diff] [blame] | 293 | When you connect to a BGP peer over an IPv6 link-local address, you |
| 294 | have to specify the @var{ifname} of the interface used for the |
| 295 | connection. To specify IPv4 session addresses, see the |
| 296 | @code{neighbor @var{peer} update-source} command below. |
| 297 | |
| 298 | This command is deprecated and may be removed in a future release. Its |
| 299 | use should be avoided. |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 300 | @end deffn |
| 301 | |
| 302 | @deffn {BGP} {neighbor @var{peer} next-hop-self} {} |
| 303 | @deffnx {BGP} {no neighbor @var{peer} next-hop-self} {} |
| 304 | This command specifies an announced route's nexthop as being equivalent |
| 305 | to the address of the bgp router. |
| 306 | @end deffn |
| 307 | |
Paul Jakma | 466c965 | 2006-06-26 12:55:58 +0000 | [diff] [blame] | 308 | @deffn {BGP} {neighbor @var{peer} update-source @var{<ifname|address>}} {} |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 309 | @deffnx {BGP} {no neighbor @var{peer} update-source} {} |
Paul Jakma | 825cd49 | 2006-05-23 22:20:34 +0000 | [diff] [blame] | 310 | Specify the IPv4 source address to use for the @acronym{BGP} session to this |
| 311 | neighbour, may be specified as either an IPv4 address directly or |
| 312 | as an interface name (in which case the @command{zebra} daemon MUST be running |
| 313 | in order for @command{bgpd} to be able to retrieve interface state). |
| 314 | @example |
| 315 | @group |
| 316 | router bgp 64555 |
| 317 | neighbor foo update-source 192.168.0.1 |
| 318 | neighbor bar update-source lo0 |
| 319 | @end group |
| 320 | @end example |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 321 | @end deffn |
| 322 | |
| 323 | @deffn {BGP} {neighbor @var{peer} default-originate} {} |
| 324 | @deffnx {BGP} {no neighbor @var{peer} default-originate} {} |
| 325 | @command{bgpd}'s default is to not announce the default route (0.0.0.0/0) even it |
| 326 | is in routing table. When you want to announce default routes to the |
| 327 | peer, use this command. |
| 328 | @end deffn |
| 329 | |
| 330 | @deffn {BGP} {neighbor @var{peer} port @var{port}} {} |
| 331 | @deffnx {BGP} {neighbor @var{peer} port @var{port}} {} |
| 332 | @end deffn |
| 333 | |
| 334 | @deffn {BGP} {neighbor @var{peer} send-community} {} |
| 335 | @deffnx {BGP} {neighbor @var{peer} send-community} {} |
| 336 | @end deffn |
| 337 | |
| 338 | @deffn {BGP} {neighbor @var{peer} weight @var{weight}} {} |
| 339 | @deffnx {BGP} {no neighbor @var{peer} weight @var{weight}} {} |
| 340 | This command specifies a default @var{weight} value for the neighbor's |
| 341 | routes. |
| 342 | @end deffn |
| 343 | |
| 344 | @deffn {BGP} {neighbor @var{peer} maximum-prefix @var{number}} {} |
| 345 | @deffnx {BGP} {no neighbor @var{peer} maximum-prefix @var{number}} {} |
| 346 | @end deffn |
| 347 | |
Andrew Certain | 5aebb9c | 2012-11-07 23:50:09 +0000 | [diff] [blame] | 348 | @deffn {BGP} {neighbor @var{peer} local-as @var{as-number}} {} |
| 349 | @deffnx {BGP} {neighbor @var{peer} local-as @var{as-number} no-prepend} {} |
| 350 | @deffnx {BGP} {neighbor @var{peer} local-as @var{as-number} no-prepend replace-as} {} |
| 351 | @deffnx {BGP} {no neighbor @var{peer} local-as} {} |
| 352 | Specify an alternate AS for this BGP process when interacting with the |
| 353 | specified peer. With no modifiers, the specified local-as is prepended to |
| 354 | the received AS_PATH when receiving routing updates from the peer, and |
| 355 | prepended to the outgoing AS_PATH (after the process local AS) when |
| 356 | transmitting local routes to the peer. |
| 357 | |
| 358 | If the no-prepend attribute is specified, then the supplied local-as is not |
| 359 | prepended to the received AS_PATH. |
| 360 | |
| 361 | If the replace-as attribute is specified, then only the supplied local-as is |
| 362 | prepended to the AS_PATH when transmitting local-route updates to this peer. |
| 363 | |
| 364 | Note that replace-as can only be specified if no-prepend is. |
| 365 | |
| 366 | This command is only allowed for eBGP peers. |
| 367 | @end deffn |
| 368 | |
Pradosh Mohapatra | 5d804b4 | 2013-09-12 03:37:07 +0000 | [diff] [blame] | 369 | @deffn {BGP} {neighbor @var{peer} ttl-security hops @var{number}} {} |
| 370 | @deffnx {BGP} {no neighbor @var{peer} ttl-security hops @var{number}} {} |
| 371 | This command enforces Generalized TTL Security Mechanism (GTSM), as |
| 372 | specified in RFC 5082. With this command, only neighbors that are the |
| 373 | specified number of hops away will be allowed to become neighbors. This |
| 374 | command is mututally exclusive with @command{ebgp-multihop}. |
| 375 | @end deffn |
| 376 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 377 | @node Peer filtering |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 378 | @subsection Peer filtering |
| 379 | |
| 380 | @deffn {BGP} {neighbor @var{peer} distribute-list @var{name} [in|out]} {} |
| 381 | This command specifies a distribute-list for the peer. @var{direct} is |
| 382 | @samp{in} or @samp{out}. |
| 383 | @end deffn |
| 384 | |
| 385 | @deffn {BGP command} {neighbor @var{peer} prefix-list @var{name} [in|out]} {} |
| 386 | @end deffn |
| 387 | |
| 388 | @deffn {BGP command} {neighbor @var{peer} filter-list @var{name} [in|out]} {} |
| 389 | @end deffn |
| 390 | |
| 391 | @deffn {BGP} {neighbor @var{peer} route-map @var{name} [in|out]} {} |
| 392 | Apply a route-map on the neighbor. @var{direct} must be @code{in} or |
| 393 | @code{out}. |
| 394 | @end deffn |
| 395 | |
| 396 | @c ----------------------------------------------------------------------- |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 397 | @node BGP Peer Group |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 398 | @section BGP Peer Group |
| 399 | |
| 400 | @deffn {BGP} {neighbor @var{word} peer-group} {} |
| 401 | This command defines a new peer group. |
| 402 | @end deffn |
| 403 | |
| 404 | @deffn {BGP} {neighbor @var{peer} peer-group @var{word}} {} |
| 405 | This command bind specific peer to peer group @var{word}. |
| 406 | @end deffn |
| 407 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 408 | @node BGP Address Family |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 409 | @section BGP Address Family |
| 410 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 411 | @c ----------------------------------------------------------------------- |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 412 | @node Autonomous System |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 413 | @section Autonomous System |
| 414 | |
paul | aa5943f | 2005-11-04 21:53:59 +0000 | [diff] [blame] | 415 | The @acronym{AS,Autonomous System} number is one of the essential |
| 416 | element of BGP. BGP is a distance vector routing protocol, and the |
| 417 | AS-Path framework provides distance vector metric and loop detection to |
| 418 | BGP. @cite{RFC1930, Guidelines for creation, selection, and |
| 419 | registration of an Autonomous System (AS)} provides some background on |
| 420 | the concepts of an AS. |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 421 | |
paul | aa5943f | 2005-11-04 21:53:59 +0000 | [diff] [blame] | 422 | The AS number is a two octet value, ranging in value from 1 to 65535. |
| 423 | The AS numbers 64512 through 65535 are defined as private AS numbers. |
| 424 | Private AS numbers must not to be advertised in the global Internet. |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 425 | |
| 426 | @menu |
| 427 | * AS Path Regular Expression:: |
| 428 | * Display BGP Routes by AS Path:: |
| 429 | * AS Path Access List:: |
| 430 | * Using AS Path in Route Map:: |
| 431 | * Private AS Numbers:: |
| 432 | @end menu |
| 433 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 434 | @node AS Path Regular Expression |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 435 | @subsection AS Path Regular Expression |
| 436 | |
paul | aa5943f | 2005-11-04 21:53:59 +0000 | [diff] [blame] | 437 | AS path regular expression can be used for displaying BGP routes and |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 438 | AS path access list. AS path regular expression is based on |
| 439 | @code{POSIX 1003.2} regular expressions. Following description is |
| 440 | just a subset of @code{POSIX} regular expression. User can use full |
| 441 | @code{POSIX} regular expression. Adding to that special character '_' |
| 442 | is added for AS path regular expression. |
| 443 | |
| 444 | @table @code |
| 445 | @item . |
| 446 | Matches any single character. |
| 447 | @item * |
| 448 | Matches 0 or more occurrences of pattern. |
| 449 | @item + |
| 450 | Matches 1 or more occurrences of pattern. |
| 451 | @item ? |
| 452 | Match 0 or 1 occurrences of pattern. |
| 453 | @item ^ |
| 454 | Matches the beginning of the line. |
| 455 | @item $ |
| 456 | Matches the end of the line. |
| 457 | @item _ |
| 458 | Character @code{_} has special meanings in AS path regular expression. |
| 459 | It matches to space and comma , and AS set delimiter @{ and @} and AS |
| 460 | confederation delimiter @code{(} and @code{)}. And it also matches to |
| 461 | the beginning of the line and the end of the line. So @code{_} can be |
| 462 | used for AS value boundaries match. @code{show ip bgp regexp _7675_} |
| 463 | matches to all of BGP routes which as AS number include @var{7675}. |
| 464 | @end table |
| 465 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 466 | @node Display BGP Routes by AS Path |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 467 | @subsection Display BGP Routes by AS Path |
| 468 | |
paul | aa5943f | 2005-11-04 21:53:59 +0000 | [diff] [blame] | 469 | To show BGP routes which has specific AS path information @code{show |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 470 | ip bgp} command can be used. |
| 471 | |
| 472 | @deffn Command {show ip bgp regexp @var{line}} {} |
| 473 | This commands display BGP routes that matches AS path regular |
| 474 | expression @var{line}. |
| 475 | @end deffn |
| 476 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 477 | @node AS Path Access List |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 478 | @subsection AS Path Access List |
| 479 | |
paul | aa5943f | 2005-11-04 21:53:59 +0000 | [diff] [blame] | 480 | AS path access list is user defined AS path. |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 481 | |
| 482 | @deffn {Command} {ip as-path access-list @var{word} @{permit|deny@} @var{line}} {} |
| 483 | This command defines a new AS path access list. |
| 484 | @end deffn |
| 485 | |
| 486 | @deffn {Command} {no ip as-path access-list @var{word}} {} |
| 487 | @deffnx {Command} {no ip as-path access-list @var{word} @{permit|deny@} @var{line}} {} |
| 488 | @end deffn |
| 489 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 490 | @node Using AS Path in Route Map |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 491 | @subsection Using AS Path in Route Map |
| 492 | |
| 493 | @deffn {Route Map} {match as-path @var{word}} {} |
| 494 | @end deffn |
| 495 | |
| 496 | @deffn {Route Map} {set as-path prepend @var{as-path}} {} |
| 497 | @end deffn |
| 498 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 499 | @node Private AS Numbers |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 500 | @subsection Private AS Numbers |
| 501 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 502 | @c ----------------------------------------------------------------------- |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 503 | @node BGP Communities Attribute |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 504 | @section BGP Communities Attribute |
| 505 | |
paul | aa5943f | 2005-11-04 21:53:59 +0000 | [diff] [blame] | 506 | BGP communities attribute is widely used for implementing policy |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 507 | routing. Network operators can manipulate BGP communities attribute |
| 508 | based on their network policy. BGP communities attribute is defined |
paul | aa5943f | 2005-11-04 21:53:59 +0000 | [diff] [blame] | 509 | in @cite{RFC1997, BGP Communities Attribute} and |
| 510 | @cite{RFC1998, An Application of the BGP Community Attribute |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 511 | in Multi-home Routing}. It is an optional transitive attribute, |
| 512 | therefore local policy can travel through different autonomous system. |
| 513 | |
paul | aa5943f | 2005-11-04 21:53:59 +0000 | [diff] [blame] | 514 | Communities attribute is a set of communities values. Each |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 515 | communities value is 4 octet long. The following format is used to |
| 516 | define communities value. |
| 517 | |
| 518 | @table @code |
| 519 | @item AS:VAL |
| 520 | This format represents 4 octet communities value. @code{AS} is high |
| 521 | order 2 octet in digit format. @code{VAL} is low order 2 octet in |
| 522 | digit format. This format is useful to define AS oriented policy |
| 523 | value. For example, @code{7675:80} can be used when AS 7675 wants to |
| 524 | pass local policy value 80 to neighboring peer. |
| 525 | @item internet |
| 526 | @code{internet} represents well-known communities value 0. |
| 527 | @item no-export |
| 528 | @code{no-export} represents well-known communities value @code{NO_EXPORT}@* |
| 529 | @r{(0xFFFFFF01)}. All routes carry this value must not be advertised |
| 530 | to outside a BGP confederation boundary. If neighboring BGP peer is |
| 531 | part of BGP confederation, the peer is considered as inside a BGP |
| 532 | confederation boundary, so the route will be announced to the peer. |
| 533 | @item no-advertise |
| 534 | @code{no-advertise} represents well-known communities value |
| 535 | @code{NO_ADVERTISE}@*@r{(0xFFFFFF02)}. All routes carry this value |
| 536 | must not be advertise to other BGP peers. |
| 537 | @item local-AS |
| 538 | @code{local-AS} represents well-known communities value |
| 539 | @code{NO_EXPORT_SUBCONFED} @r{(0xFFFFFF03)}. All routes carry this |
| 540 | value must not be advertised to external BGP peers. Even if the |
| 541 | neighboring router is part of confederation, it is considered as |
| 542 | external BGP peer, so the route will not be announced to the peer. |
| 543 | @end table |
| 544 | |
| 545 | When BGP communities attribute is received, duplicated communities |
| 546 | value in the communities attribute is ignored and each communities |
| 547 | values are sorted in numerical order. |
| 548 | |
| 549 | @menu |
| 550 | * BGP Community Lists:: |
| 551 | * Numbered BGP Community Lists:: |
| 552 | * BGP Community in Route Map:: |
| 553 | * Display BGP Routes by Community:: |
| 554 | * Using BGP Communities Attribute:: |
| 555 | @end menu |
| 556 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 557 | @node BGP Community Lists |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 558 | @subsection BGP Community Lists |
| 559 | |
| 560 | BGP community list is a user defined BGP communites attribute list. |
| 561 | BGP community list can be used for matching or manipulating BGP |
| 562 | communities attribute in updates. |
| 563 | |
paul | aa5943f | 2005-11-04 21:53:59 +0000 | [diff] [blame] | 564 | There are two types of community list. One is standard community |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 565 | list and another is expanded community list. Standard community list |
| 566 | defines communities attribute. Expanded community list defines |
| 567 | communities attribute string with regular expression. Standard |
| 568 | community list is compiled into binary format when user define it. |
| 569 | Standard community list will be directly compared to BGP communities |
| 570 | attribute in BGP updates. Therefore the comparison is faster than |
| 571 | expanded community list. |
| 572 | |
| 573 | @deffn Command {ip community-list standard @var{name} @{permit|deny@} @var{community}} {} |
| 574 | This command defines a new standard community list. @var{community} |
| 575 | is communities value. The @var{community} is compiled into community |
| 576 | structure. We can define multiple community list under same name. In |
| 577 | that case match will happen user defined order. Once the |
| 578 | community list matches to communities attribute in BGP updates it |
| 579 | return permit or deny by the community list definition. When there is |
| 580 | no matched entry, deny will be returned. When @var{community} is |
| 581 | empty it matches to any routes. |
| 582 | @end deffn |
| 583 | |
| 584 | @deffn Command {ip community-list expanded @var{name} @{permit|deny@} @var{line}} {} |
| 585 | This command defines a new expanded community list. @var{line} is a |
| 586 | string expression of communities attribute. @var{line} can include |
| 587 | regular expression to match communities attribute in BGP updates. |
| 588 | @end deffn |
| 589 | |
| 590 | @deffn Command {no ip community-list @var{name}} {} |
| 591 | @deffnx Command {no ip community-list standard @var{name}} {} |
| 592 | @deffnx Command {no ip community-list expanded @var{name}} {} |
| 593 | These commands delete community lists specified by @var{name}. All of |
| 594 | community lists shares a single name space. So community lists can be |
| 595 | removed simpley specifying community lists name. |
| 596 | @end deffn |
| 597 | |
| 598 | @deffn {Command} {show ip community-list} {} |
| 599 | @deffnx {Command} {show ip community-list @var{name}} {} |
| 600 | This command display current community list information. When |
| 601 | @var{name} is specified the specified community list's information is |
| 602 | shown. |
| 603 | |
| 604 | @example |
| 605 | # show ip community-list |
| 606 | Named Community standard list CLIST |
| 607 | permit 7675:80 7675:100 no-export |
| 608 | deny internet |
| 609 | Named Community expanded list EXPAND |
| 610 | permit : |
| 611 | |
| 612 | # show ip community-list CLIST |
| 613 | Named Community standard list CLIST |
| 614 | permit 7675:80 7675:100 no-export |
| 615 | deny internet |
| 616 | @end example |
| 617 | @end deffn |
| 618 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 619 | @node Numbered BGP Community Lists |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 620 | @subsection Numbered BGP Community Lists |
| 621 | |
paul | aa5943f | 2005-11-04 21:53:59 +0000 | [diff] [blame] | 622 | When number is used for BGP community list name, the number has |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 623 | special meanings. Community list number in the range from 1 and 99 is |
| 624 | standard community list. Community list number in the range from 100 |
| 625 | to 199 is expanded community list. These community lists are called |
| 626 | as numbered community lists. On the other hand normal community lists |
| 627 | is called as named community lists. |
| 628 | |
| 629 | @deffn Command {ip community-list <1-99> @{permit|deny@} @var{community}} {} |
| 630 | This command defines a new community list. <1-99> is standard |
| 631 | community list number. Community list name within this range defines |
| 632 | standard community list. When @var{community} is empty it matches to |
| 633 | any routes. |
| 634 | @end deffn |
| 635 | |
| 636 | @deffn Command {ip community-list <100-199> @{permit|deny@} @var{community}} {} |
| 637 | This command defines a new community list. <100-199> is expanded |
| 638 | community list number. Community list name within this range defines |
| 639 | expanded community list. |
| 640 | @end deffn |
| 641 | |
| 642 | @deffn Command {ip community-list @var{name} @{permit|deny@} @var{community}} {} |
| 643 | When community list type is not specifed, the community list type is |
| 644 | automatically detected. If @var{community} can be compiled into |
| 645 | communities attribute, the community list is defined as a standard |
| 646 | community list. Otherwise it is defined as an expanded community |
| 647 | list. This feature is left for backward compability. Use of this |
| 648 | feature is not recommended. |
| 649 | @end deffn |
| 650 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 651 | @node BGP Community in Route Map |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 652 | @subsection BGP Community in Route Map |
| 653 | |
paul | aa5943f | 2005-11-04 21:53:59 +0000 | [diff] [blame] | 654 | In Route Map (@pxref{Route Map}), we can match or set BGP |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 655 | communities attribute. Using this feature network operator can |
| 656 | implement their network policy based on BGP communities attribute. |
| 657 | |
paul | aa5943f | 2005-11-04 21:53:59 +0000 | [diff] [blame] | 658 | Following commands can be used in Route Map. |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 659 | |
| 660 | @deffn {Route Map} {match community @var{word}} {} |
| 661 | @deffnx {Route Map} {match community @var{word} exact-match} {} |
| 662 | This command perform match to BGP updates using community list |
| 663 | @var{word}. When the one of BGP communities value match to the one of |
| 664 | communities value in community list, it is match. When |
| 665 | @code{exact-match} keyword is spcified, match happen only when BGP |
| 666 | updates have completely same communities value specified in the |
| 667 | community list. |
| 668 | @end deffn |
| 669 | |
| 670 | @deffn {Route Map} {set community none} {} |
| 671 | @deffnx {Route Map} {set community @var{community}} {} |
| 672 | @deffnx {Route Map} {set community @var{community} additive} {} |
| 673 | This command manipulate communities value in BGP updates. When |
| 674 | @code{none} is specified as communities value, it removes entire |
| 675 | communities attribute from BGP updates. When @var{community} is not |
| 676 | @code{none}, specified communities value is set to BGP updates. If |
| 677 | BGP updates already has BGP communities value, the existing BGP |
| 678 | communities value is replaced with specified @var{community} value. |
| 679 | When @code{additive} keyword is specified, @var{community} is appended |
| 680 | to the existing communities value. |
| 681 | @end deffn |
| 682 | |
| 683 | @deffn {Route Map} {set comm-list @var{word} delete} {} |
| 684 | This command remove communities value from BGP communities attribute. |
| 685 | The @var{word} is community list name. When BGP route's communities |
| 686 | value matches to the community list @var{word}, the communities value |
| 687 | is removed. When all of communities value is removed eventually, the |
| 688 | BGP update's communities attribute is completely removed. |
| 689 | @end deffn |
| 690 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 691 | @node Display BGP Routes by Community |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 692 | @subsection Display BGP Routes by Community |
| 693 | |
paul | aa5943f | 2005-11-04 21:53:59 +0000 | [diff] [blame] | 694 | To show BGP routes which has specific BGP communities attribute, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 695 | @code{show ip bgp} command can be used. The @var{community} value and |
| 696 | community list can be used for @code{show ip bgp} command. |
| 697 | |
| 698 | @deffn Command {show ip bgp community} {} |
| 699 | @deffnx Command {show ip bgp community @var{community}} {} |
| 700 | @deffnx Command {show ip bgp community @var{community} exact-match} {} |
| 701 | @code{show ip bgp community} displays BGP routes which has communities |
| 702 | attribute. When @var{community} is specified, BGP routes that matches |
| 703 | @var{community} value is displayed. For this command, @code{internet} |
| 704 | keyword can't be used for @var{community} value. When |
| 705 | @code{exact-match} is specified, it display only routes that have an |
| 706 | exact match. |
| 707 | @end deffn |
| 708 | |
| 709 | @deffn Command {show ip bgp community-list @var{word}} {} |
| 710 | @deffnx Command {show ip bgp community-list @var{word} exact-match} {} |
| 711 | This commands display BGP routes that matches community list |
| 712 | @var{word}. When @code{exact-match} is specified, display only routes |
| 713 | that have an exact match. |
| 714 | @end deffn |
| 715 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 716 | @node Using BGP Communities Attribute |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 717 | @subsection Using BGP Communities Attribute |
| 718 | |
paul | aa5943f | 2005-11-04 21:53:59 +0000 | [diff] [blame] | 719 | Following configuration is the most typical usage of BGP communities |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 720 | attribute. AS 7675 provides upstream Internet connection to AS 100. |
| 721 | When following configuration exists in AS 7675, AS 100 networks |
| 722 | operator can set local preference in AS 7675 network by setting BGP |
| 723 | communities attribute to the updates. |
| 724 | |
| 725 | @example |
| 726 | router bgp 7675 |
| 727 | neighbor 192.168.0.1 remote-as 100 |
| 728 | neighbor 192.168.0.1 route-map RMAP in |
| 729 | ! |
| 730 | ip community-list 70 permit 7675:70 |
| 731 | ip community-list 70 deny |
| 732 | ip community-list 80 permit 7675:80 |
| 733 | ip community-list 80 deny |
| 734 | ip community-list 90 permit 7675:90 |
| 735 | ip community-list 90 deny |
| 736 | ! |
| 737 | route-map RMAP permit 10 |
| 738 | match community 70 |
| 739 | set local-preference 70 |
| 740 | ! |
| 741 | route-map RMAP permit 20 |
| 742 | match community 80 |
| 743 | set local-preference 80 |
| 744 | ! |
| 745 | route-map RMAP permit 30 |
| 746 | match community 90 |
| 747 | set local-preference 90 |
| 748 | @end example |
| 749 | |
paul | aa5943f | 2005-11-04 21:53:59 +0000 | [diff] [blame] | 750 | Following configuration announce 10.0.0.0/8 from AS 100 to AS 7675. |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 751 | The route has communities value 7675:80 so when above configuration |
| 752 | exists in AS 7675, announced route's local preference will be set to |
| 753 | value 80. |
| 754 | |
| 755 | @example |
| 756 | router bgp 100 |
| 757 | network 10.0.0.0/8 |
| 758 | neighbor 192.168.0.2 remote-as 7675 |
| 759 | neighbor 192.168.0.2 route-map RMAP out |
| 760 | ! |
| 761 | ip prefix-list PLIST permit 10.0.0.0/8 |
| 762 | ! |
| 763 | route-map RMAP permit 10 |
| 764 | match ip address prefix-list PLIST |
| 765 | set community 7675:80 |
| 766 | @end example |
| 767 | |
paul | aa5943f | 2005-11-04 21:53:59 +0000 | [diff] [blame] | 768 | Following configuration is an example of BGP route filtering using |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 769 | communities attribute. This configuration only permit BGP routes |
| 770 | which has BGP communities value 0:80 or 0:90. Network operator can |
| 771 | put special internal communities value at BGP border router, then |
| 772 | limit the BGP routes announcement into the internal network. |
| 773 | |
| 774 | @example |
| 775 | router bgp 7675 |
| 776 | neighbor 192.168.0.1 remote-as 100 |
| 777 | neighbor 192.168.0.1 route-map RMAP in |
| 778 | ! |
| 779 | ip community-list 1 permit 0:80 0:90 |
| 780 | ! |
| 781 | route-map RMAP permit in |
| 782 | match community 1 |
| 783 | @end example |
| 784 | |
paul | aa5943f | 2005-11-04 21:53:59 +0000 | [diff] [blame] | 785 | Following exmaple filter BGP routes which has communities value 1:1. |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 786 | When there is no match community-list returns deny. To avoid |
| 787 | filtering all of routes, we need to define permit any at last. |
| 788 | |
| 789 | @example |
| 790 | router bgp 7675 |
| 791 | neighbor 192.168.0.1 remote-as 100 |
| 792 | neighbor 192.168.0.1 route-map RMAP in |
| 793 | ! |
| 794 | ip community-list standard FILTER deny 1:1 |
| 795 | ip community-list standard FILTER permit |
| 796 | ! |
| 797 | route-map RMAP permit 10 |
| 798 | match community FILTER |
| 799 | @end example |
| 800 | |
paul | aa5943f | 2005-11-04 21:53:59 +0000 | [diff] [blame] | 801 | Communities value keyword @code{internet} has special meanings in |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 802 | standard community lists. In below example @code{internet} act as |
| 803 | match any. It matches all of BGP routes even if the route does not |
| 804 | have communities attribute at all. So community list @code{INTERNET} |
| 805 | is same as above example's @code{FILTER}. |
| 806 | |
| 807 | @example |
| 808 | ip community-list standard INTERNET deny 1:1 |
| 809 | ip community-list standard INTERNET permit internet |
| 810 | @end example |
| 811 | |
paul | aa5943f | 2005-11-04 21:53:59 +0000 | [diff] [blame] | 812 | Following configuration is an example of communities value deletion. |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 813 | With this configuration communities value 100:1 and 100:2 is removed |
| 814 | from BGP updates. For communities value deletion, only @code{permit} |
| 815 | community-list is used. @code{deny} community-list is ignored. |
| 816 | |
| 817 | @example |
| 818 | router bgp 7675 |
| 819 | neighbor 192.168.0.1 remote-as 100 |
| 820 | neighbor 192.168.0.1 route-map RMAP in |
| 821 | ! |
| 822 | ip community-list standard DEL permit 100:1 100:2 |
| 823 | ! |
| 824 | route-map RMAP permit 10 |
| 825 | set comm-list DEL delete |
| 826 | @end example |
| 827 | |
| 828 | @c ----------------------------------------------------------------------- |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 829 | @node BGP Extended Communities Attribute |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 830 | @section BGP Extended Communities Attribute |
| 831 | |
paul | aa5943f | 2005-11-04 21:53:59 +0000 | [diff] [blame] | 832 | BGP extended communities attribute is introduced with MPLS VPN/BGP |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 833 | technology. MPLS VPN/BGP expands capability of network infrastructure |
| 834 | to provide VPN functionality. At the same time it requires a new |
| 835 | framework for policy routing. With BGP Extended Communities Attribute |
| 836 | we can use Route Target or Site of Origin for implementing network |
| 837 | policy for MPLS VPN/BGP. |
| 838 | |
paul | aa5943f | 2005-11-04 21:53:59 +0000 | [diff] [blame] | 839 | BGP Extended Communities Attribute is similar to BGP Communities |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 840 | Attribute. It is an optional transitive attribute. BGP Extended |
| 841 | Communities Attribute can carry multiple Extended Community value. |
| 842 | Each Extended Community value is eight octet length. |
| 843 | |
paul | aa5943f | 2005-11-04 21:53:59 +0000 | [diff] [blame] | 844 | BGP Extended Communities Attribute provides an extended range |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 845 | compared with BGP Communities Attribute. Adding to that there is a |
| 846 | type field in each value to provides community space structure. |
| 847 | |
paul | aa5943f | 2005-11-04 21:53:59 +0000 | [diff] [blame] | 848 | There are two format to define Extended Community value. One is AS |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 849 | based format the other is IP address based format. |
| 850 | |
| 851 | @table @code |
| 852 | @item AS:VAL |
| 853 | This is a format to define AS based Extended Community value. |
| 854 | @code{AS} part is 2 octets Global Administrator subfield in Extended |
| 855 | Community value. @code{VAL} part is 4 octets Local Administrator |
| 856 | subfield. @code{7675:100} represents AS 7675 policy value 100. |
| 857 | @item IP-Address:VAL |
| 858 | This is a format to define IP address based Extended Community value. |
| 859 | @code{IP-Address} part is 4 octets Global Administrator subfield. |
| 860 | @code{VAL} part is 2 octets Local Administrator subfield. |
| 861 | @code{10.0.0.1:100} represents |
| 862 | @end table |
| 863 | |
| 864 | @menu |
| 865 | * BGP Extended Community Lists:: |
| 866 | * BGP Extended Communities in Route Map:: |
| 867 | @end menu |
| 868 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 869 | @node BGP Extended Community Lists |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 870 | @subsection BGP Extended Community Lists |
| 871 | |
paul | aa5943f | 2005-11-04 21:53:59 +0000 | [diff] [blame] | 872 | Expanded Community Lists is a user defined BGP Expanded Community |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 873 | Lists. |
| 874 | |
| 875 | @deffn Command {ip extcommunity-list standard @var{name} @{permit|deny@} @var{extcommunity}} {} |
| 876 | This command defines a new standard extcommunity-list. |
| 877 | @var{extcommunity} is extended communities value. The |
| 878 | @var{extcommunity} is compiled into extended community structure. We |
| 879 | can define multiple extcommunity-list under same name. In that case |
| 880 | match will happen user defined order. Once the extcommunity-list |
| 881 | matches to extended communities attribute in BGP updates it return |
| 882 | permit or deny based upon the extcommunity-list definition. When |
| 883 | there is no matched entry, deny will be returned. When |
| 884 | @var{extcommunity} is empty it matches to any routes. |
| 885 | @end deffn |
| 886 | |
| 887 | @deffn Command {ip extcommunity-list expanded @var{name} @{permit|deny@} @var{line}} {} |
| 888 | This command defines a new expanded extcommunity-list. @var{line} is |
| 889 | a string expression of extended communities attribute. @var{line} can |
| 890 | include regular expression to match extended communities attribute in |
| 891 | BGP updates. |
| 892 | @end deffn |
| 893 | |
| 894 | @deffn Command {no ip extcommunity-list @var{name}} {} |
| 895 | @deffnx Command {no ip extcommunity-list standard @var{name}} {} |
| 896 | @deffnx Command {no ip extcommunity-list expanded @var{name}} {} |
| 897 | These commands delete extended community lists specified by |
| 898 | @var{name}. All of extended community lists shares a single name |
| 899 | space. So extended community lists can be removed simpley specifying |
| 900 | the name. |
| 901 | @end deffn |
| 902 | |
| 903 | @deffn {Command} {show ip extcommunity-list} {} |
| 904 | @deffnx {Command} {show ip extcommunity-list @var{name}} {} |
| 905 | This command display current extcommunity-list information. When |
| 906 | @var{name} is specified the community list's information is shown. |
| 907 | |
| 908 | @example |
| 909 | # show ip extcommunity-list |
| 910 | @end example |
| 911 | @end deffn |
| 912 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 913 | @node BGP Extended Communities in Route Map |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 914 | @subsection BGP Extended Communities in Route Map |
| 915 | |
| 916 | @deffn {Route Map} {match extcommunity @var{word}} {} |
| 917 | @end deffn |
| 918 | |
| 919 | @deffn {Route Map} {set extcommunity rt @var{extcommunity}} {} |
| 920 | This command set Route Target value. |
| 921 | @end deffn |
| 922 | |
| 923 | @deffn {Route Map} {set extcommunity soo @var{extcommunity}} {} |
| 924 | This command set Site of Origin value. |
| 925 | @end deffn |
| 926 | |
| 927 | @c ----------------------------------------------------------------------- |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 928 | @node Displaying BGP routes |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 929 | @section Displaying BGP Routes |
| 930 | |
| 931 | @menu |
| 932 | * Show IP BGP:: |
| 933 | * More Show IP BGP:: |
| 934 | @end menu |
| 935 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 936 | @node Show IP BGP |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 937 | @subsection Show IP BGP |
| 938 | |
| 939 | @deffn {Command} {show ip bgp} {} |
| 940 | @deffnx {Command} {show ip bgp @var{A.B.C.D}} {} |
| 941 | @deffnx {Command} {show ip bgp @var{X:X::X:X}} {} |
| 942 | This command displays BGP routes. When no route is specified it |
| 943 | display all of IPv4 BGP routes. |
| 944 | @end deffn |
| 945 | |
| 946 | @example |
| 947 | BGP table version is 0, local router ID is 10.1.1.1 |
| 948 | Status codes: s suppressed, d damped, h history, * valid, > best, i - internal |
| 949 | Origin codes: i - IGP, e - EGP, ? - incomplete |
| 950 | |
| 951 | Network Next Hop Metric LocPrf Weight Path |
| 952 | *> 1.1.1.1/32 0.0.0.0 0 32768 i |
| 953 | |
| 954 | Total number of prefixes 1 |
| 955 | @end example |
| 956 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 957 | @node More Show IP BGP |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 958 | @subsection More Show IP BGP |
| 959 | |
| 960 | @deffn {Command} {show ip bgp regexp @var{line}} {} |
| 961 | This command display BGP routes using AS path regular expression (@pxref{Display BGP Routes by AS Path}). |
| 962 | @end deffn |
| 963 | |
| 964 | @deffn Command {show ip bgp community @var{community}} {} |
| 965 | @deffnx Command {show ip bgp community @var{community} exact-match} {} |
| 966 | This command display BGP routes using @var{community} (@pxref{Display |
| 967 | BGP Routes by Community}). |
| 968 | @end deffn |
| 969 | |
| 970 | @deffn Command {show ip bgp community-list @var{word}} {} |
| 971 | @deffnx Command {show ip bgp community-list @var{word} exact-match} {} |
| 972 | This command display BGP routes using community list (@pxref{Display |
| 973 | BGP Routes by Community}). |
| 974 | @end deffn |
| 975 | |
| 976 | @deffn {Command} {show ip bgp summary} {} |
| 977 | @end deffn |
| 978 | |
| 979 | @deffn {Command} {show ip bgp neighbor [@var{peer}]} {} |
| 980 | @end deffn |
| 981 | |
| 982 | @deffn {Command} {clear ip bgp @var{peer}} {} |
| 983 | Clear peers which have addresses of X.X.X.X |
| 984 | @end deffn |
| 985 | |
| 986 | @deffn {Command} {clear ip bgp @var{peer} soft in} {} |
| 987 | Clear peer using soft reconfiguration. |
| 988 | @end deffn |
| 989 | |
Alexandre Chappuis | c31e572 | 2011-09-11 16:54:11 +0400 | [diff] [blame] | 990 | @deffn {Command} {show ip bgp dampened-paths} {} |
| 991 | Display paths suppressed due to dampening |
| 992 | @end deffn |
| 993 | |
| 994 | @deffn {Command} {show ip bgp flap-statistics} {} |
| 995 | Display flap statistics of routes |
| 996 | @end deffn |
| 997 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 998 | @deffn {Command} {show debug} {} |
| 999 | @end deffn |
| 1000 | |
| 1001 | @deffn {Command} {debug event} {} |
| 1002 | @end deffn |
| 1003 | |
| 1004 | @deffn {Command} {debug update} {} |
| 1005 | @end deffn |
| 1006 | |
| 1007 | @deffn {Command} {debug keepalive} {} |
| 1008 | @end deffn |
| 1009 | |
| 1010 | @deffn {Command} {no debug event} {} |
| 1011 | @end deffn |
| 1012 | |
| 1013 | @deffn {Command} {no debug update} {} |
| 1014 | @end deffn |
| 1015 | |
| 1016 | @deffn {Command} {no debug keepalive} {} |
| 1017 | @end deffn |
| 1018 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 1019 | @node Capability Negotiation |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1020 | @section Capability Negotiation |
| 1021 | |
paul | aa5943f | 2005-11-04 21:53:59 +0000 | [diff] [blame] | 1022 | When adding IPv6 routing information exchange feature to BGP. There |
| 1023 | were some proposals. @acronym{IETF,Internet Engineering Task Force} |
| 1024 | @acronym{IDR, Inter Domain Routing} @acronym{WG, Working group} adopted |
| 1025 | a proposal called Multiprotocol Extension for BGP. The specification |
| 1026 | is described in @cite{RFC2283}. The protocol does not define new protocols. |
| 1027 | It defines new attributes to existing BGP. When it is used exchanging |
| 1028 | IPv6 routing information it is called BGP-4+. When it is used for |
| 1029 | exchanging multicast routing information it is called MBGP. |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1030 | |
paul | aa5943f | 2005-11-04 21:53:59 +0000 | [diff] [blame] | 1031 | @command{bgpd} supports Multiprotocol Extension for BGP. So if remote |
| 1032 | peer supports the protocol, @command{bgpd} can exchange IPv6 and/or |
| 1033 | multicast routing information. |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1034 | |
paul | aa5943f | 2005-11-04 21:53:59 +0000 | [diff] [blame] | 1035 | Traditional BGP did not have the feature to detect remote peer's |
| 1036 | capabilities, e.g. whether it can handle prefix types other than IPv4 |
| 1037 | unicast routes. This was a big problem using Multiprotocol Extension |
| 1038 | for BGP to operational network. @cite{RFC2842, Capabilities |
| 1039 | Advertisement with BGP-4} adopted a feature called Capability |
| 1040 | Negotiation. @command{bgpd} use this Capability Negotiation to detect |
| 1041 | the remote peer's capabilities. If the peer is only configured as IPv4 |
| 1042 | unicast neighbor, @command{bgpd} does not send these Capability |
| 1043 | Negotiation packets (at least not unless other optional BGP features |
| 1044 | require capability negotation). |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1045 | |
paul | aa5943f | 2005-11-04 21:53:59 +0000 | [diff] [blame] | 1046 | By default, Quagga will bring up peering with minimal common capability |
| 1047 | for the both sides. For example, local router has unicast and |
| 1048 | multicast capabilitie and remote router has unicast capability. In |
| 1049 | this case, the local router will establish the connection with unicast |
| 1050 | only capability. When there are no common capabilities, Quagga sends |
| 1051 | Unsupported Capability error and then resets the connection. |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1052 | |
paul | aa5943f | 2005-11-04 21:53:59 +0000 | [diff] [blame] | 1053 | If you want to completely match capabilities with remote peer. Please |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1054 | use @command{strict-capability-match} command. |
| 1055 | |
| 1056 | @deffn {BGP} {neighbor @var{peer} strict-capability-match} {} |
| 1057 | @deffnx {BGP} {no neighbor @var{peer} strict-capability-match} {} |
| 1058 | Strictly compares remote capabilities and local capabilities. If capabilities |
| 1059 | are different, send Unsupported Capability error then reset connection. |
| 1060 | @end deffn |
| 1061 | |
paul | aa5943f | 2005-11-04 21:53:59 +0000 | [diff] [blame] | 1062 | You may want to disable sending Capability Negotiation OPEN message |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1063 | optional parameter to the peer when remote peer does not implement |
| 1064 | Capability Negotiation. Please use @command{dont-capability-negotiate} |
| 1065 | command to disable the feature. |
| 1066 | |
| 1067 | @deffn {BGP} {neighbor @var{peer} dont-capability-negotiate} {} |
| 1068 | @deffnx {BGP} {no neighbor @var{peer} dont-capability-negotiate} {} |
| 1069 | Suppress sending Capability Negotiation as OPEN message optional |
| 1070 | parameter to the peer. This command only affects the peer is configured |
| 1071 | other than IPv4 unicast configuration. |
| 1072 | @end deffn |
| 1073 | |
paul | aa5943f | 2005-11-04 21:53:59 +0000 | [diff] [blame] | 1074 | When remote peer does not have capability negotiation feature, remote |
| 1075 | peer will not send any capabilities at all. In that case, bgp |
| 1076 | configures the peer with configured capabilities. |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1077 | |
paul | aa5943f | 2005-11-04 21:53:59 +0000 | [diff] [blame] | 1078 | You may prefer locally configured capabilities more than the negotiated |
| 1079 | capabilities even though remote peer sends capabilities. If the peer |
| 1080 | is configured by @command{override-capability}, @command{bgpd} ignores |
| 1081 | received capabilities then override negotiated capabilities with |
| 1082 | configured values. |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1083 | |
| 1084 | @deffn {BGP} {neighbor @var{peer} override-capability} {} |
| 1085 | @deffnx {BGP} {no neighbor @var{peer} override-capability} {} |
| 1086 | Override the result of Capability Negotiation with local configuration. |
| 1087 | Ignore remote peer's capability value. |
| 1088 | @end deffn |
| 1089 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 1090 | @node Route Reflector |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1091 | @section Route Reflector |
| 1092 | |
| 1093 | @deffn {BGP} {bgp cluster-id @var{a.b.c.d}} {} |
| 1094 | @end deffn |
| 1095 | |
| 1096 | @deffn {BGP} {neighbor @var{peer} route-reflector-client} {} |
| 1097 | @deffnx {BGP} {no neighbor @var{peer} route-reflector-client} {} |
| 1098 | @end deffn |
| 1099 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 1100 | @node Route Server |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1101 | @section Route Server |
| 1102 | |
| 1103 | At an Internet Exchange point, many ISPs are connected to each other by |
| 1104 | external BGP peering. Normally these external BGP connection are done by |
paul | aa5943f | 2005-11-04 21:53:59 +0000 | [diff] [blame] | 1105 | @samp{full mesh} method. As with internal BGP full mesh formation, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1106 | this method has a scaling problem. |
| 1107 | |
| 1108 | This scaling problem is well known. Route Server is a method to resolve |
| 1109 | the problem. Each ISP's BGP router only peers to Route Server. Route |
| 1110 | Server serves as BGP information exchange to other BGP routers. By |
| 1111 | applying this method, numbers of BGP connections is reduced from |
| 1112 | O(n*(n-1)/2) to O(n). |
| 1113 | |
| 1114 | Unlike normal BGP router, Route Server must have several routing tables |
| 1115 | for managing different routing policies for each BGP speaker. We call the |
| 1116 | routing tables as different @code{view}s. @command{bgpd} can work as |
| 1117 | normal BGP router or Route Server or both at the same time. |
| 1118 | |
| 1119 | @menu |
| 1120 | * Multiple instance:: |
| 1121 | * BGP instance and view:: |
| 1122 | * Routing policy:: |
| 1123 | * Viewing the view:: |
| 1124 | @end menu |
| 1125 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 1126 | @node Multiple instance |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1127 | @subsection Multiple instance |
| 1128 | |
| 1129 | To enable multiple view function of @code{bgpd}, you must turn on |
| 1130 | multiple instance feature beforehand. |
| 1131 | |
| 1132 | @deffn {Command} {bgp multiple-instance} {} |
| 1133 | Enable BGP multiple instance feature. After this feature is enabled, |
| 1134 | you can make multiple BGP instances or multiple BGP views. |
| 1135 | @end deffn |
| 1136 | |
| 1137 | @deffn {Command} {no bgp multiple-instance} {} |
| 1138 | Disable BGP multiple instance feature. You can not disable this feature |
| 1139 | when BGP multiple instances or views exist. |
| 1140 | @end deffn |
| 1141 | |
| 1142 | When you want to make configuration more Cisco like one, |
| 1143 | |
| 1144 | @deffn {Command} {bgp config-type cisco} {} |
| 1145 | Cisco compatible BGP configuration output. |
| 1146 | @end deffn |
| 1147 | |
| 1148 | When bgp config-type cisco is specified, |
| 1149 | |
| 1150 | ``no synchronization'' is displayed. |
Ivan Moskalyov | 2b09e21 | 2010-03-11 17:14:35 +0300 | [diff] [blame] | 1151 | ``no auto-summary'' is displayed. |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1152 | |
| 1153 | ``network'' and ``aggregate-address'' argument is displayed as |
| 1154 | ``A.B.C.D M.M.M.M'' |
| 1155 | |
paul | 7190f4e | 2003-08-12 12:40:20 +0000 | [diff] [blame] | 1156 | Quagga: network 10.0.0.0/8 |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1157 | Cisco: network 10.0.0.0 |
| 1158 | |
paul | 7190f4e | 2003-08-12 12:40:20 +0000 | [diff] [blame] | 1159 | Quagga: aggregate-address 192.168.0.0/24 |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1160 | Cisco: aggregate-address 192.168.0.0 255.255.255.0 |
| 1161 | |
| 1162 | Community attribute handling is also different. If there is no |
| 1163 | configuration is specified community attribute and extended community |
| 1164 | attribute are sent to neighbor. When user manually disable the |
| 1165 | feature community attribute is not sent to the neighbor. In case of |
paul | aa5943f | 2005-11-04 21:53:59 +0000 | [diff] [blame] | 1166 | @command{bgp config-type cisco} is specified, community attribute is not |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1167 | sent to the neighbor by default. To send community attribute user has |
paul | aa5943f | 2005-11-04 21:53:59 +0000 | [diff] [blame] | 1168 | to specify @command{neighbor A.B.C.D send-community} command. |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1169 | |
paul | aa5943f | 2005-11-04 21:53:59 +0000 | [diff] [blame] | 1170 | @example |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1171 | ! |
| 1172 | router bgp 1 |
| 1173 | neighbor 10.0.0.1 remote-as 1 |
| 1174 | no neighbor 10.0.0.1 send-community |
| 1175 | ! |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1176 | router bgp 1 |
| 1177 | neighbor 10.0.0.1 remote-as 1 |
| 1178 | neighbor 10.0.0.1 send-community |
| 1179 | ! |
paul | aa5943f | 2005-11-04 21:53:59 +0000 | [diff] [blame] | 1180 | @end example |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1181 | |
| 1182 | @deffn {Command} {bgp config-type zebra} {} |
paul | 7190f4e | 2003-08-12 12:40:20 +0000 | [diff] [blame] | 1183 | Quagga style BGP configuration. This is default. |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1184 | @end deffn |
| 1185 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 1186 | @node BGP instance and view |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1187 | @subsection BGP instance and view |
| 1188 | |
| 1189 | BGP instance is a normal BGP process. The result of route selection |
| 1190 | goes to the kernel routing table. You can setup different AS at the |
| 1191 | same time when BGP multiple instance feature is enabled. |
| 1192 | |
| 1193 | @deffn {Command} {router bgp @var{as-number}} {} |
| 1194 | Make a new BGP instance. You can use arbitrary word for the @var{name}. |
| 1195 | @end deffn |
| 1196 | |
| 1197 | @example |
| 1198 | @group |
| 1199 | bgp multiple-instance |
| 1200 | ! |
| 1201 | router bgp 1 |
| 1202 | neighbor 10.0.0.1 remote-as 2 |
| 1203 | neighbor 10.0.0.2 remote-as 3 |
| 1204 | ! |
| 1205 | router bgp 2 |
| 1206 | neighbor 10.0.0.3 remote-as 4 |
| 1207 | neighbor 10.0.0.4 remote-as 5 |
| 1208 | @end group |
| 1209 | @end example |
| 1210 | |
| 1211 | BGP view is almost same as normal BGP process. The result of |
| 1212 | route selection does not go to the kernel routing table. BGP view is |
| 1213 | only for exchanging BGP routing information. |
| 1214 | |
| 1215 | @deffn {Command} {router bgp @var{as-number} view @var{name}} {} |
| 1216 | Make a new BGP view. You can use arbitrary word for the @var{name}. This |
| 1217 | view's route selection result does not go to the kernel routing table. |
| 1218 | @end deffn |
| 1219 | |
| 1220 | With this command, you can setup Route Server like below. |
| 1221 | |
| 1222 | @example |
| 1223 | @group |
| 1224 | bgp multiple-instance |
| 1225 | ! |
| 1226 | router bgp 1 view 1 |
| 1227 | neighbor 10.0.0.1 remote-as 2 |
| 1228 | neighbor 10.0.0.2 remote-as 3 |
| 1229 | ! |
| 1230 | router bgp 2 view 2 |
| 1231 | neighbor 10.0.0.3 remote-as 4 |
| 1232 | neighbor 10.0.0.4 remote-as 5 |
| 1233 | @end group |
| 1234 | @end example |
| 1235 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 1236 | @node Routing policy |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1237 | @subsection Routing policy |
| 1238 | |
| 1239 | You can set different routing policy for a peer. For example, you can |
| 1240 | set different filter for a peer. |
| 1241 | |
| 1242 | @example |
| 1243 | @group |
| 1244 | bgp multiple-instance |
| 1245 | ! |
| 1246 | router bgp 1 view 1 |
| 1247 | neighbor 10.0.0.1 remote-as 2 |
| 1248 | neighbor 10.0.0.1 distribute-list 1 in |
| 1249 | ! |
| 1250 | router bgp 1 view 2 |
| 1251 | neighbor 10.0.0.1 remote-as 2 |
| 1252 | neighbor 10.0.0.1 distribute-list 2 in |
| 1253 | @end group |
| 1254 | @end example |
| 1255 | |
| 1256 | This means BGP update from a peer 10.0.0.1 goes to both BGP view 1 and view |
| 1257 | 2. When the update is inserted into view 1, distribute-list 1 is |
| 1258 | applied. On the other hand, when the update is inserted into view 2, |
| 1259 | distribute-list 2 is applied. |
| 1260 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 1261 | @node Viewing the view |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1262 | @subsection Viewing the view |
| 1263 | |
| 1264 | To display routing table of BGP view, you must specify view name. |
| 1265 | |
| 1266 | @deffn {Command} {show ip bgp view @var{name}} {} |
| 1267 | Display routing table of BGP view @var{name}. |
| 1268 | @end deffn |
| 1269 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 1270 | @node How to set up a 6-Bone connection |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1271 | @section How to set up a 6-Bone connection |
| 1272 | |
paul | 6a22b1f | 2004-11-07 19:39:13 +0000 | [diff] [blame] | 1273 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1274 | @example |
| 1275 | @group |
| 1276 | zebra configuration |
| 1277 | =================== |
| 1278 | ! |
| 1279 | ! Actually there is no need to configure zebra |
| 1280 | ! |
| 1281 | |
| 1282 | bgpd configuration |
| 1283 | ================== |
| 1284 | ! |
| 1285 | ! This means that routes go through zebra and into the kernel. |
| 1286 | ! |
| 1287 | router zebra |
| 1288 | ! |
| 1289 | ! MP-BGP configuration |
| 1290 | ! |
| 1291 | router bgp 7675 |
| 1292 | bgp router-id 10.0.0.1 |
| 1293 | neighbor 3ffe:1cfa:0:2:2a0:c9ff:fe9e:f56 remote-as @var{as-number} |
| 1294 | ! |
| 1295 | address-family ipv6 |
| 1296 | network 3ffe:506::/32 |
| 1297 | neighbor 3ffe:1cfa:0:2:2a0:c9ff:fe9e:f56 activate |
| 1298 | neighbor 3ffe:1cfa:0:2:2a0:c9ff:fe9e:f56 route-map set-nexthop out |
| 1299 | neighbor 3ffe:1cfa:0:2:2c0:4fff:fe68:a231 remote-as @var{as-number} |
| 1300 | neighbor 3ffe:1cfa:0:2:2c0:4fff:fe68:a231 route-map set-nexthop out |
| 1301 | exit-address-family |
| 1302 | ! |
| 1303 | ipv6 access-list all permit any |
| 1304 | ! |
| 1305 | ! Set output nexthop address. |
| 1306 | ! |
| 1307 | route-map set-nexthop permit 10 |
| 1308 | match ipv6 address all |
| 1309 | set ipv6 nexthop global 3ffe:1cfa:0:2:2c0:4fff:fe68:a225 |
| 1310 | set ipv6 nexthop local fe80::2c0:4fff:fe68:a225 |
| 1311 | ! |
| 1312 | ! logfile FILENAME is obsolete. Please use log file FILENAME |
paul | 7190f4e | 2003-08-12 12:40:20 +0000 | [diff] [blame] | 1313 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1314 | log file bgpd.log |
| 1315 | ! |
| 1316 | @end group |
| 1317 | @end example |
| 1318 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 1319 | @node Dump BGP packets and table |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1320 | @section Dump BGP packets and table |
| 1321 | |
| 1322 | @deffn Command {dump bgp all @var{path}} {} |
| 1323 | @deffnx Command {dump bgp all @var{path} @var{interval}} {} |
| 1324 | Dump all BGP packet and events to @var{path} file. |
| 1325 | @end deffn |
| 1326 | |
| 1327 | @deffn Command {dump bgp updates @var{path}} {} |
| 1328 | @deffnx Command {dump bgp updates @var{path} @var{interval}} {} |
| 1329 | Dump BGP updates to @var{path} file. |
| 1330 | @end deffn |
| 1331 | |
| 1332 | @deffn Command {dump bgp routes @var{path}} {} |
| 1333 | @deffnx Command {dump bgp routes @var{path}} {} |
| 1334 | Dump whole BGP routing table to @var{path}. This is heavy process. |
| 1335 | @end deffn |
paul | aa5943f | 2005-11-04 21:53:59 +0000 | [diff] [blame] | 1336 | |
| 1337 | @node BGP Configuration Examples |
| 1338 | @section BGP Configuration Examples |
| 1339 | |
| 1340 | Example of a session to an upstream, advertising only one prefix to it. |
| 1341 | |
| 1342 | @example |
| 1343 | router bgp 64512 |
| 1344 | bgp router-id 10.236.87.1 |
| 1345 | network 10.236.87.0/24 |
| 1346 | neighbor upstream peer-group |
| 1347 | neighbor upstream remote-as 64515 |
| 1348 | neighbor upstream capability dynamic |
| 1349 | neighbor upstream prefix-list pl-allowed-adv out |
| 1350 | neighbor 10.1.1.1 peer-group upstream |
| 1351 | neighbor 10.1.1.1 description ACME ISP |
| 1352 | ! |
| 1353 | ip prefix-list pl-allowed-adv seq 5 permit 82.195.133.0/25 |
| 1354 | ip prefix-list pl-allowed-adv seq 10 deny any |
| 1355 | |
| 1356 | @end example |
| 1357 | |
| 1358 | A more complex example. With upstream, peer and customer sessions. |
| 1359 | Advertising global prefixes and NO_EXPORT prefixes and providing |
| 1360 | actions for customer routes based on community values. Extensive use of |
| 1361 | route-maps and the 'call' feature to support selective advertising of |
| 1362 | prefixes. This example is intended as guidance only, it has NOT been |
| 1363 | tested and almost certainly containts silly mistakes, if not serious |
| 1364 | flaws. |
| 1365 | |
| 1366 | @example |
| 1367 | router bgp 64512 |
| 1368 | bgp router-id 10.236.87.1 |
| 1369 | network 10.123.456.0/24 |
| 1370 | network 10.123.456.128/25 route-map rm-no-export |
| 1371 | neighbor upstream capability dynamic |
| 1372 | neighbor upstream route-map rm-upstream-out out |
| 1373 | neighbor cust capability dynamic |
| 1374 | neighbor cust route-map rm-cust-in in |
| 1375 | neighbor cust route-map rm-cust-out out |
| 1376 | neighbor cust send-community both |
| 1377 | neighbor peer capability dynamic |
| 1378 | neighbor peer route-map rm-peer-in in |
| 1379 | neighbor peer route-map rm-peer-out out |
| 1380 | neighbor peer send-community both |
| 1381 | neighbor 10.1.1.1 remote-as 64515 |
| 1382 | neighbor 10.1.1.1 peer-group upstream |
| 1383 | neighbor 10.2.1.1 remote-as 64516 |
| 1384 | neighbor 10.2.1.1 peer-group upstream |
| 1385 | neighbor 10.3.1.1 remote-as 64517 |
| 1386 | neighbor 10.3.1.1 peer-group cust-default |
| 1387 | neighbor 10.3.1.1 description customer1 |
| 1388 | neighbor 10.3.1.1 prefix-list pl-cust1-network in |
| 1389 | neighbor 10.4.1.1 remote-as 64518 |
| 1390 | neighbor 10.4.1.1 peer-group cust |
| 1391 | neighbor 10.4.1.1 prefix-list pl-cust2-network in |
| 1392 | neighbor 10.4.1.1 description customer2 |
| 1393 | neighbor 10.5.1.1 remote-as 64519 |
| 1394 | neighbor 10.5.1.1 peer-group peer |
| 1395 | neighbor 10.5.1.1 prefix-list pl-peer1-network in |
| 1396 | neighbor 10.5.1.1 description peer AS 1 |
| 1397 | neighbor 10.6.1.1 remote-as 64520 |
| 1398 | neighbor 10.6.1.1 peer-group peer |
| 1399 | neighbor 10.6.1.1 prefix-list pl-peer2-network in |
| 1400 | neighbor 10.6.1.1 description peer AS 2 |
| 1401 | ! |
| 1402 | ip prefix-list pl-default permit 0.0.0.0/0 |
| 1403 | ! |
| 1404 | ip prefix-list pl-upstream-peers permit 10.1.1.1/32 |
| 1405 | ip prefix-list pl-upstream-peers permit 10.2.1.1/32 |
| 1406 | ! |
| 1407 | ip prefix-list pl-cust1-network permit 10.3.1.0/24 |
| 1408 | ip prefix-list pl-cust1-network permit 10.3.2.0/24 |
| 1409 | ! |
| 1410 | ip prefix-list pl-cust2-network permit 10.4.1.0/24 |
| 1411 | ! |
| 1412 | ip prefix-list pl-peer1-network permit 10.5.1.0/24 |
| 1413 | ip prefix-list pl-peer1-network permit 10.5.2.0/24 |
| 1414 | ip prefix-list pl-peer1-network permit 192.168.0.0/24 |
| 1415 | ! |
| 1416 | ip prefix-list pl-peer2-network permit 10.6.1.0/24 |
| 1417 | ip prefix-list pl-peer2-network permit 10.6.2.0/24 |
| 1418 | ip prefix-list pl-peer2-network permit 192.168.1.0/24 |
| 1419 | ip prefix-list pl-peer2-network permit 192.168.2.0/24 |
| 1420 | ip prefix-list pl-peer2-network permit 172.16.1/24 |
| 1421 | ! |
| 1422 | ip as-path access-list asp-own-as permit ^$ |
| 1423 | ip as-path access-list asp-own-as permit _64512_ |
| 1424 | ! |
| 1425 | ! ################################################################# |
| 1426 | ! Match communities we provide actions for, on routes receives from |
| 1427 | ! customers. Communities values of <our-ASN>:X, with X, have actions: |
| 1428 | ! |
| 1429 | ! 100 - blackhole the prefix |
| 1430 | ! 200 - set no_export |
| 1431 | ! 300 - advertise only to other customers |
| 1432 | ! 400 - advertise only to upstreams |
| 1433 | ! 500 - set no_export when advertising to upstreams |
| 1434 | ! 2X00 - set local_preference to X00 |
| 1435 | ! |
| 1436 | ! blackhole the prefix of the route |
| 1437 | ip community-list standard cm-blackhole permit 64512:100 |
| 1438 | ! |
| 1439 | ! set no-export community before advertising |
| 1440 | ip community-list standard cm-set-no-export permit 64512:200 |
| 1441 | ! |
| 1442 | ! advertise only to other customers |
| 1443 | ip community-list standard cm-cust-only permit 64512:300 |
| 1444 | ! |
| 1445 | ! advertise only to upstreams |
| 1446 | ip community-list standard cm-upstream-only permit 64512:400 |
| 1447 | ! |
| 1448 | ! advertise to upstreams with no-export |
| 1449 | ip community-list standard cm-upstream-noexport permit 64512:500 |
| 1450 | ! |
| 1451 | ! set local-pref to least significant 3 digits of the community |
| 1452 | ip community-list standard cm-prefmod-100 permit 64512:2100 |
| 1453 | ip community-list standard cm-prefmod-200 permit 64512:2200 |
| 1454 | ip community-list standard cm-prefmod-300 permit 64512:2300 |
| 1455 | ip community-list standard cm-prefmod-400 permit 64512:2400 |
| 1456 | ip community-list expanded cme-prefmod-range permit 64512:2... |
| 1457 | ! |
| 1458 | ! Informational communities |
| 1459 | ! |
| 1460 | ! 3000 - learned from upstream |
| 1461 | ! 3100 - learned from customer |
| 1462 | ! 3200 - learned from peer |
| 1463 | ! |
| 1464 | ip community-list standard cm-learnt-upstream permit 64512:3000 |
| 1465 | ip community-list standard cm-learnt-cust permit 64512:3100 |
| 1466 | ip community-list standard cm-learnt-peer permit 64512:3200 |
| 1467 | ! |
| 1468 | ! ################################################################### |
| 1469 | ! Utility route-maps |
| 1470 | ! |
| 1471 | ! These utility route-maps generally should not used to permit/deny |
| 1472 | ! routes, i.e. they do not have meaning as filters, and hence probably |
| 1473 | ! should be used with 'on-match next'. These all finish with an empty |
| 1474 | ! permit entry so as not interfere with processing in the caller. |
| 1475 | ! |
| 1476 | route-map rm-no-export permit 10 |
| 1477 | set community additive no-export |
| 1478 | route-map rm-no-export permit 20 |
| 1479 | ! |
| 1480 | route-map rm-blackhole permit 10 |
| 1481 | description blackhole, up-pref and ensure it cant escape this AS |
| 1482 | set ip next-hop 127.0.0.1 |
| 1483 | set local-preference 10 |
| 1484 | set community additive no-export |
| 1485 | route-map rm-blackhole permit 20 |
| 1486 | ! |
| 1487 | ! Set local-pref as requested |
| 1488 | route-map rm-prefmod permit 10 |
| 1489 | match community cm-prefmod-100 |
| 1490 | set local-preference 100 |
| 1491 | route-map rm-prefmod permit 20 |
| 1492 | match community cm-prefmod-200 |
| 1493 | set local-preference 200 |
| 1494 | route-map rm-prefmod permit 30 |
| 1495 | match community cm-prefmod-300 |
| 1496 | set local-preference 300 |
| 1497 | route-map rm-prefmod permit 40 |
| 1498 | match community cm-prefmod-400 |
| 1499 | set local-preference 400 |
| 1500 | route-map rm-prefmod permit 50 |
| 1501 | ! |
| 1502 | ! Community actions to take on receipt of route. |
| 1503 | route-map rm-community-in permit 10 |
| 1504 | description check for blackholing, no point continuing if it matches. |
| 1505 | match community cm-blackhole |
| 1506 | call rm-blackhole |
| 1507 | route-map rm-community-in permit 20 |
| 1508 | match community cm-set-no-export |
| 1509 | call rm-no-export |
| 1510 | on-match next |
| 1511 | route-map rm-community-in permit 30 |
| 1512 | match community cme-prefmod-range |
| 1513 | call rm-prefmod |
| 1514 | route-map rm-community-in permit 40 |
| 1515 | ! |
| 1516 | ! ##################################################################### |
| 1517 | ! Community actions to take when advertising a route. |
| 1518 | ! These are filtering route-maps, |
| 1519 | ! |
| 1520 | ! Deny customer routes to upstream with cust-only set. |
| 1521 | route-map rm-community-filt-to-upstream deny 10 |
| 1522 | match community cm-learnt-cust |
| 1523 | match community cm-cust-only |
| 1524 | route-map rm-community-filt-to-upstream permit 20 |
| 1525 | ! |
| 1526 | ! Deny customer routes to other customers with upstream-only set. |
| 1527 | route-map rm-community-filt-to-cust deny 10 |
| 1528 | match community cm-learnt-cust |
| 1529 | match community cm-upstream-only |
| 1530 | route-map rm-community-filt-to-cust permit 20 |
| 1531 | ! |
| 1532 | ! ################################################################### |
| 1533 | ! The top-level route-maps applied to sessions. Further entries could |
| 1534 | ! be added obviously.. |
| 1535 | ! |
| 1536 | ! Customers |
| 1537 | route-map rm-cust-in permit 10 |
| 1538 | call rm-community-in |
| 1539 | on-match next |
| 1540 | route-map rm-cust-in permit 20 |
| 1541 | set community additive 64512:3100 |
| 1542 | route-map rm-cust-in permit 30 |
| 1543 | ! |
| 1544 | route-map rm-cust-out permit 10 |
| 1545 | call rm-community-filt-to-cust |
| 1546 | on-match next |
| 1547 | route-map rm-cust-out permit 20 |
| 1548 | ! |
| 1549 | ! Upstream transit ASes |
| 1550 | route-map rm-upstream-out permit 10 |
| 1551 | description filter customer prefixes which are marked cust-only |
| 1552 | call rm-community-filt-to-upstream |
| 1553 | on-match next |
| 1554 | route-map rm-upstream-out permit 20 |
| 1555 | description only customer routes are provided to upstreams/peers |
| 1556 | match community cm-learnt-cust |
| 1557 | ! |
| 1558 | ! Peer ASes |
| 1559 | ! outbound policy is same as for upstream |
| 1560 | route-map rm-peer-out permit 10 |
| 1561 | call rm-upstream-out |
| 1562 | ! |
| 1563 | route-map rm-peer-in permit 10 |
| 1564 | set community additive 64512:3200 |
| 1565 | @end example |