You are on page 1of 66

CHAPTE R 1 2

Using the Border Gateway Protocol for
Interdomain Routing
The Border Gateway Protocol (BGP), defined in RFC 1771, provides loop-free interdomain routing
between autonomous systems. (An autonomous system [AS] is a set of routers that operate under the
same administration.) BGP is often run among the networks of Internet service providers (ISPs). This
case study examines how BGP works and how you can use it to participate in routing with other
networks that run BGP. The following topics are covered:
• BGP Fundamentals
• BGP Decision Algorithm
• Controlling the Flow of BGP Updates
• Practical Design Example

Note The version of BGP described in this case study is BGP Version 4.

BGP Fundamentals
This section presents fundamental information about BGP, including the following topics:
• Internal BGP
• External BGP
• BGP and Route Maps
• Advertising Networks
Routers that belong to the same AS and exchange BGP updates are said to be running internal BGP
(IBGP), and routers that belong to different ASs and exchange BGP updates are said to be running
external BGP (EBGP). With the exception of the neighbor ebgp-multihop router configuration
command (described in the section “External BGP” later in this chapter), the commands for
configuring EBGP and IBGP are the same. This case study uses the terms EBGP and IBGP as a
reminder that, for any particular context, routing updates are being exchanged between ASs (EBGP)
or within an AS (IBGP).
Figure 12-1 shows a network that demonstrates the difference between EBGP and IBGP.

Using the Border Gateway Protocol for Interdomain Routing 12-1

BGP Fundamentals

Figure 12-1 EBGP, IBGP, and Multiple ASs

AS 100 AS 300

Router A Router D
129.213.1.2 192.208.10.1

EBGP EBGP

129.213.1.1 192.208.10.2
IBGP
Router B Router C
175.220.212.1 175.220.1.2

S4574
AS 200

Before it exchanges information with an external AS, BGP ensures that networks within the AS are
reachable. This is done by a combination of internal BGP peering among routers within the AS and
by redistributing BGP routing information to Interior Gateway Protocols (IGPs) that run within the
AS, such as Interior Gateway Routing Protocol (IGRP), Intermediate System-to-Intermediate
System (IS-IS), Routing Information Protocol (RIP), and Open Shortest Path First (OSPF).
BGP uses the Transmission Control Protocol (TCP) as its transport protocol (specifically port 179).
Any two routers that have opened a TCP connection to each other for the purpose of exchanging
routing information are known as peers or neighbors. In Figure 12-1, Routers A and B are BGP
peers, as are Routers B and C, and Routers C and D. The routing information consists of a series of
AS numbers that describe the full path to the destination network. BGP uses this information to
construct a loop-free map of ASs. Note that within an AS, BGP peers do not have to be directly
connected.
BGP peers initially exchange their full BGP routing tables. Thereafter, BGP peers send incremental
updates only. BGP peers also exchange keepalive messages (to ensure that the connection is up) and
notification messages (in response to errors or special conditions).
In Figure 12-1, the following commands configure BGP on Router A:
router bgp 100
neighbor 129.213.1.1 remote-as 200

The following commands configure BGP on Router B:
router bgp 200
neighbor 129.213.1.2 remote-as 100
neighbor 175.220.1.2 remote-as 200

The following commands configure BGP on Router C:
router bgp 200
neighbor 175.220.212.1 remote-as 200
neighbor 192.208.10.1 remote-as 300

The following commands configure BGP on Router D:
router bgp 300
neighbor 192.208.10.2 remote-as 200

The router bgp global configuration command enables a BGP routing process and assigns to it an
AS number.

12-2 Internetworking Case Studies

BGP Fundamentals

The neighbor remote-as router configuration command adds an entry to the BGP neighbor table
specifying that the peer identified by a particular IP address belongs to the specified AS. For routers
that run EBGP, neighbors are usually directly connected, and the IP address is usually the IP address
of the interface at the other end of the connection. (For the exception to this rule, see the section
“EBGP Multihop,” later in this chapter.) For routers that run IBGP, the IP address can be the IP
address of any of the router’s interfaces.
Note the following about the ASs shown in Figure 12-1:
• Routers A and B are running EBGP, and Routers B and C are running IBGP. Note that the EBGP
peers are directly connected and that the IBGP peers are not. As long as there is an IGP running
that allows the two neighbors to reach one another, IBGP peers do not have to be directly
connected.
• All BGP speakers within an AS must establish a peer relationship with each other. That is, the
BGP speakers within an AS must be fully meshed logically. BGP4 provides two techniques that
alleviate the requirement for a logical full mesh: confederations and route reflectors. For
information about these techniques, see the sections “Confederations” and “Route Reflectors,”
later in this chapter.
• AS 200 is a transit AS for AS 100 and AS 300—that is, AS 200 is used to transfer packets
between AS 100 and AS 300.
To verify that BGP peers are up, use the show ip bgp neighbors EXEC command. Following is the
output of this command on Router A:
RouterA# show ip bgp neighbors
BGP neighbor is 129.213.1.1, remote AS 200, external link
BGP version 4, remote router ID 175.220.212.1
BGP state = established, table version = 3, up for 0:10:59
Last read 0:00:29, hold time is 180, keepalive interval is 60 seconds
Minimum time between advertisement runs is 30 seconds
Received 2828 messages, 0 notifications, 0 in queue
Sent 2826 messages, 0 notifications, 0 in queue
Connections established 11; dropped 10

Anything other than state = established indicates that the peers are not up. The remote router ID is
the highest IP address on that router (or the highest loopback interface, if there is one). Notice the
table version number: each time the table is updated by new incoming information, the table version
number increments. A table version number that continually increments is an indication that a route
is flapping, thereby causing routes to be updated continually.

Note When you make a configuration change with respect to a neighbor for which a peer
relationship has been established, be sure to reset the BGP session with that neighbor. To reset the
session, at the system prompt, issue the clear ip bgp EXEC command specifying the IP address of
that neighbor.

Internal BGP
Internal BGP (IBGP) is the form of BGP that exchanges BGP updates within an AS. Instead of
IBGP, the routes learned via EBGP could be redistributed into IGP within the AS and then
redistributed again into another AS. However, IBGP is more flexible, provides more efficient ways
of controlling the exchange of information within the AS, and presents a consistent view of the AS
to external neighbors. For example, IBGP provides ways to control the exit point from an AS.
Figure 12-2 shows a topology that demonstrates IBGP.

Using the Border Gateway Protocol for Interdomain Routing 12-3

0 When a BGP speaker receives an update from other BGP speakers in its own AS (that is.10.10.10.10.1 AS 100 Router D IBGP 150.0 !Router C router bgp 400 neighbor 175.10.10. If you want Router D to receive updates from Router B. and Router C in AS 400: !Router A router bgp 100 neighbor 180.2 remote-as 100 network 175.1 remote-as 400 neighbor 180.40.0 !Router B router bgp 100 neighbor 150.10.10.0. if there were no IBGP session between Routers B and D.10.10.30. Router A would send updates from Router B to Router E but not to Router D.40.10.30.20.2 remote-as 300 network 150. 12-4 Internetworking Case Studies .1 Router A IBGP Router B 170. the receiving BGP speaker uses EBGP to forward the update to external BGP speakers only.1 Router E Router C AS 300 AS 400 S4582 AS 500 170. via IBGP).1 190.10.10.40.1 remote-as 100 neighbor 175.2 175.50.10.1 175.20. in Figure 12-2.2 170.1 remote-as 100 network 190.10.0.50.10.0.10.10.10.20.30. Router B must be configured so that Router D is a BGP peer.10.1 remote as 100 network 190.10. For example.30.10.BGP Fundamentals Figure 12-2 Internal BGP Example 180.30. This behavior of IBGP is why it is necessary for BGP speakers within an AS to be fully meshed.0.0 The following commands configure Routers A and B in AS 100.0 175.1 remote-as 100 neighbor 190.0.1 remote-as 100 neighbor 170.50.50.30.1 remote-as 100 neighbor 190.0 !Router D router bgp 100 neighbor 150.40.

1 E0 IBGP E1 Router A Router B 190. When the loopback interface is used. Figure 12-3 Use of Loopback Interfaces Loopback interface 0: 150.1 E3 E2 AS 100 S4576 In Figure 12-3. or 3 in the neighbor remote-as router configuration command. The following commands configure Router A for BGP: !Router A router bgp 100 neighbor 150. 1.1 remote-as 100 The following commands configure Router B for BGP: !Router B loopback interface 0 ip address 150. therefore.225. When the neighbor update-source command is used.1.11.225. Instead. depend on a particular physical interface for connectivity.1) of Router B in the neighbor remote-as router configuration command. Routers A and B are running IBGP within AS 100.1. 2. If Router A were to specify the IP address of Ethernet interface 0.212. Router A would not be able to establish a TCP connection with Router B. BGP Fundamentals Loopback Interfaces Loopback interfaces are often used by IBGP peers. Note Loopback interfaces are rarely between EBGP peers because EBGP peers are usually directly connected and.212. Using the Border Gateway Protocol for Interdomain Routing 12-5 .0 ! router bgp 100 neighbor 190. Router A specifies the IP address of the loopback interface that Router B defines.0. BGP does not have to rely on the availability of a particular interface for making TCP connections.11. This use of the loopback interface requires that the configuration of Router B include the neighbor update-source router configuration command. Figure 12-3 shows a network in which using the loopback interface is advantageous.1 255.225. the source of BGP TCP connections for the specified neighbor is the IP address of the loopback interface instead of the IP address of a physical interface.11. The advantage of using loopback interfaces is that they eliminate a dependency that would otherwise occur when you use the IP address of a physical interface to configure BGP.1.212.212.255.1.1 update-source loopback 0 Router A specifies the IP address of the loopback interface (150. and if the specified interface were to become unavailable.1 remote-as 100 neighbor 190.

1. over a wide-area network [WAN] connection).1. they cannot be directly connected.3 Router A Router B EBGP S4577 AS 100 AS 300 The following commands configure Router A to run EBGP: !Router A loopback interface 0 ip address 129.225.225.225.11.1 180.225. however.BGP Fundamentals External BGP When two BGP speakers that are not in the same AS run BGP to exchange routing information. In this special case. the two EBGP speakers are directly connected (for example. Sometimes.213.1.1 update-source loopback 0 The neighbor remote-as router configuration command specifies the IP address of an interface that is an extra hop away (180. Figure 12-4 EBGP Multihop Loopback interface 0: Loopback interface 0: 129. Note Multihop is used only for EBGP.225.225.1 129.2 129. This section describes commands that solve configuration problems that arise when BGP routing updates are exchanged between different ASs: • EBGP Multihop • EBGP Load Balancing • Synchronization EBGP Multihop Usually. the neighbor ebgp-multihop router configuration command is used. The following commands configure Router B: !Router B loopback interface 0 ip address 180.1 12-6 Internetworking Case Studies .11.11.11. its configuration must include static routes or must enable an IGP so that the neighbors can reach each other.11.213.1 remote-as 300 neighbor 180.213.1 instead of 129.1 ! router bgp 100 neighbor 180. Figure 12-4 illustrates a topology in which the neighbor ebgp-multihop command is useful. and the neighbor ebgp-multihop router configuration command enables EGBP multihop. they are said to be running EBGP.1.1.1 ebgp-multihop neighbor 180.3). but not for IBGP.213. Because Router A references an external neighbor by an address that is not directly connected.11.213.

1 remote-as 100 neighbor 129.1. Static routes are used to introduce two equal-cost paths to the destination.1 The neighbor ebgp-multihop and neighbor update-source router configuration commands have the effect of making the loopback interface the next hop for EBGP.0.2.0.2.1.1.10.255. but with the neighbor ebgp-multihop command on each router.0.213.0.255.10.10.255.0 Without the neighbor ebgp-multihop command on each router. which allows load balancing to occur.10.1 Router B 2.0 ! router bgp 100 neighbor 160.1 ip route 150.10.0 1. BGP uses both serial lines.213.1 ebgp-multihop neighbor 150.1.2.1.1.0.1 1.2 Router A 2.10.1.1.2.1.1 update-source loopback 0 EBGP Load Balancing The neighbor ebgp-multihop router configuration command and loopback interfaces are also useful for configuring load balancing between two ASs over parallel serial lines.1 update-source loopback 0 network 150.1 remote-as 200 neighbor 160.0 255.255.1.1 update-source loopback 0 network 160.1 255.10.1.10. The following commands configure load balancing for Router A: !Router A interface loopback 0 ip address 150. BGP Fundamentals router bgp 300 neighbor 129.1. BGP would not perform load balancing in Figure 12-5.1.255.1 Loopback interface 0: 160.1 255.2.0 2.10.0 255.10.1 ebgp-multihop neighbor 129.10.0 160.0 ! router bgp 200 neighbor 150.0 255.0.0 ! ip route 150.2.0.1.2.10.1.1. Figure 12-5 Load Balancing over Parallel Serial Lines Loopback interface 0: 150.0 ! ip route 160.1 ebgp-multihop neighbor 160.0.1.2.1 1.0.0 1. (The same effect Using the Border Gateway Protocol for Interdomain Routing 12-7 .10.255.0 255.10.2 AS 100 AS 200 S4578 150.255.0 2.1.0.1 remote-as 100 neighbor 150.10.255.213.0. as shown in Figure 12-5.10.2 The following commands configure load balancing for Router B: !Router B interface loopback 0 ip address 160.1.1.0.1.10.2 ip route 160.10.

but it might result in dropped transit packets.2 2.1.1. traffic coming from Router D to Router B with a destination of 170.0 before Router E learns about the network via IGP.10.0. Likewise.0. AS 100) have learned about the route via an IGP.0.0.) Router A can reach the next hop of 160.10.10. it sends traffic to Router E.0 into an IGP.1 in two ways: via 1.2. Routers A and B are running IBGP.1.2.1 and via 2.10.2. BGP does not advertise a route before all routers within the AS (in this case.0 AS 400 In Figure 12-6.10. • All the transit routers in your AS run BGP.0 via IBGP.2.0.2. which states that if an AS (such as AS 100 in Figure 12-6) passes traffic from one AS to another AS.1 Router C Router D AS 300 S4589 170.0.0.0 to Router A.10.0.0.10. BGP should not advertise a route until all of the routers within the AS have learned about the route via an IGP.1. Synchronization When an AS provides transit service to other ASs and if there are non-BGP routers in the AS. The topology shown in Figure 12-6 demonstrates the synchronization rule.2. Disabling synchronization allows BGP to converge more quickly. Figure 12-6 Synchronization AS 100 150. If Router B wants to reach network 170. Router B waits to hear about network 170. If Router B advertises to AS 400 that it can reach 170.1. In this case.0 Router E IGP IGP Router A IBGP Router B 2.10. Router E has no way of knowing that network 170. If Router A does not redistribute network 170.0 exists and will drop the packets.10.10.0.1.1.0.0 via an IGP before it sends an update to Router D. You can disable synchronization if one of the following conditions is true: • Your AS does not pass traffic from one AS to another AS. so Router B receives updates about network 170. you might want to disable synchronization. The BGP synchronization rule states that if an AS provides transit service to another AS. transit traffic might be dropped if the intermediate non-BGP routers have not learned routes for that traffic via an IGP. 12-8 Internetworking Case Studies .2. Router C sends updates about network 170.BGP Fundamentals could also be accomplished by using an IGP.10.2 and via 2.1 in two ways: via 1.2.10. In some cases. Router B can reach the next hop of 150.2. This situation is handled by the synchronization rule of BGP.0 will flow to Router E and be dropped.

0 via an IGP.0.) Using the Border Gateway Protocol for Interdomain Routing 12-9 .10.0 neighbor 3.3.1 remote-as 100 network 175.3.0.0.0 The no synchronization router configuration command causes Router B to put 170.0 neighbor 1.3.1.0 175.10.0.2 Router C Router D AS 300 AS 400 S4590 170. BGP and Route Maps Figure 12-7 shows a topology in which it is desirable to disable synchronization.0 in its IP routing table and advertise it to Router D without learning network 170.10.3 remote-as 100 no synchronization !Router D router bgp 400 neighbor 1. and the sequence number indicates the position that an instance of the route map is to have in relation to other instances of the same route map.0.2 remote-as 400 neighbor 3.4 1.0 The following commands configure Routers A.2.2. (Instances are ordered sequentially. The format of a route map is as follows: route-map map-tag [[permit | deny] | [sequence-number]] The map tag is a name that identifies the route map.4 remote-as 100 neighbor 2.3 3.3.1 remote-as 300 no synchronization !Router B router bgp 100 network 150. Figure 12-7 Disabled Synchronization AS 100 150.3.0.10.1 2.0.3.2 2.1 1. B.1.2.1. and C: !Router A network 150.2.1.10.0 IBGP Router A Router B 3.1. BGP and Route Maps Route maps are used with BGP to control and modify routing information and to define the conditions by which routes are redistributed between routing domains.3.0.3.10.2.10.1.1.2.1.10.

0 2. The match and set route map configuration commands are used to define the condition portion of a route map. instance 10).10. Following is an example of a simple route map: route-map MYMAP permit 10 match ip address 1.2.2.10.1. If the first set of conditions is not met.3. the second instance is applied.1. You can. use route maps to filter outgoing BGP updates based on IP address. sends the update (because of the permit keyword).2. or there are no more sets of conditions to apply.1 set metric 5 When an update matches IP address 1.4 Router A Router B 2. The match command specifies a criteria that must be matched.1. Note Route maps cannot be used to filter incoming BGP updates based on IP address.3.2. When BGP applies MYMAP to routing updates.1. however. and so on. it applies the lowest instance first (in this case. When an update does not meet the criteria of an instance.1. until an action is taken.3 RIP 3.3. If the update does not meet any criteria. until either a set of conditions has been met. and the update is not redistributed or controlled.2 AS 100 EBGP 150. you might use the following commands to define a route map named MYMAP: route-map MYMAP permit 10 ! First set of conditions goes here. BGP applies the next instance of the route map to the update. and breaks out of the list of route-map instances.3. and the set command specifies an action that is to be taken if the routing update meets the condition defined by the match command. Figure 12-8 Route Map Example 3. and the route map specifies the deny keyword. When an update meets the match criteria.0. or there are no more route map instances to apply. Figure 12-8 shows a topology that demonstrates the use of route maps.3 Router C AS 300 S4579 170. BGP sets the metric for the update to 5.BGP and Route Maps For example. and so on.0. the update is not redistributed or controlled. BGP breaks out of the list of instances. route-map MYMAP permit 20 ! Second set of conditions goes here.0 12-10 Internetworking Case Studies .

2. Routers A and B run RIP with each other.10.0 passive-interface serial 0 redistribute bgp 100 route-map SETMETRIC ! router bgp 100 neighbor 2. The following commands apply a route map to outgoing updates on Router C: !Router C router bgp 300 network 170.0 and permits updates for any other network.10.0.0.0.0.0 with a metric of 2 and to redistribute all other routes with a metric of 5. BGP and Route Maps In Figure 12-8.0. If you want Router A to redistribute routes from 170.3 remote-as 300 network 150.255 When a route matches the IP address 170.2.0.2.0.2.255.0.10. BGP provides three ways for an AS to advertise the networks that it originates: • Redistributing Static Routes • Redistributing Dynamic Routes • Using the network Command Using the Border Gateway Protocol for Interdomain Routing 12-11 .0.0 ! route-map SETMETRIC permit 10 match ip-address 1 set metric 2 ! route-map SETMETRIC permit 20 set metric 5 ! access-list 1 permit 170.255 Access list 1 denies any update for network 170.10. and Routers A and C run BGP with each other. To inform other ASs about its networks.255.0 network 150.2 remote-as 100 neighbor 2.0. When a route does not match the IP address 170. Assume that on Router C you want to set to 300 the community attribute of outgoing updates for network 170.2.0 255.0 network 2.10. the AS advertises them. Advertising Networks A network that resides within an AS is said to originate from that network.0.10.0 neighbor 2.2 route-map SETCOMMUNITY out ! route-map SETCOMMUNITY permit 10 match ip address 1 set community 300 ! access-list 1 permit 0.255.10.0.0 0.2.0.0. its metric is set to 5.0.0.10.0. and the route is redistributed. it is redistributed with a metric of 2. use the following commands for Router A: !Router A router rip network 3.0.0.10.

BGP always passes on information that it learns from one peer to other peers.0 2. The difference is that routes generated by the network and redistribute router configuration commands specify the AS of the router as the originating AS for the network.220. 12-12 Internetworking Case Studies .) To configure Router C in Figure 12-9 to originate network 175.BGP and Route Maps Note It is important to remember that routes advertised by the techniques described in this section are advertised in addition to other BGP routes that a BGP-configured router learns from its internal and external neighbors. Figure 12-9 Network Advertisement Example 1 AS 300 Router D 1.1.1.220.0.2.0.1. (For a discussion of other values that can be assigned to the origin attribute.0 into BGP.0 0.” later in this chapter. The only difference between advertising a static route and advertising a dynamic route is that when you redistribute a static route.220.213.1 1.255 null 0 The redistribute router configuration command and the static keyword cause all static routes to be redistributed into BGP.1. BGP sets the origin attribute of updates for the route to Incomplete.1 remote-as 300 redistribute static ! ip route 175.1.0 S4580 AS 100 AS 200 Redistributing Static Routes One way to advertise that a network or a subnet originates from an AS is to redistribute static routes into BGP.0.255.0.1. use these commands: !Router C router bgp 200 neighbor 1.1.2 129.2 Router A Router B Router C IBGP 175. This section uses the topology shown in Figure 12-9 to demonstrate how networks that originate from an AS can be advertised.2. see the section “Origin Attribute.

2.) The neighbor distribute-list router configuration command applies access list 1 to outgoing advertisements to the neighbor whose IP address is 1.213. that Router C is learning 129. Note Redistribution of dynamic routes requires careful use of access lists to prevent updates from being injected back into BGP.0 is to be advertised. the specification of the null 0 interface would cause a packet destined for network 175. there will be a more specific match for the packet than 175. and allows BGP to advertise network 175.1.1 (that is.0 to be discarded. Typically. Router D).1.1.0.0.0. so you need to use access lists to prevent the redistribution of routes back into BGP. Some of your IGP routes might have been learned from BGP.220.1. are implicitly prevented from being advertised.0 0. the redistribute router configuration command is the only way to inject BGP routes into an IGP.220.220. IS-IS.1.213.213.220.0 from being injected back into BGP as if it originated from AS 200.0.1.0.2.0 back into Enhanced IGRP.0. Assume that in Figure 12-9 Routers B and C are running IBGP.0.213.1. The access list prevents network 129. (Normally. distributing BGP into IGP should be avoided because too many routes would be injected into the AS. The following commands configure Router C: !Router C router eigrp 10 network 175.255 The redistribute router configuration command with the eigrp keyword redistributes Enhanced IGRP routes for process ID 10 into BGP.1 remote-as 300 neighbor 2. Redistributing Dynamic Routes Another way to advertise networks is to redistribute dynamic routes. In theory.0 redistribute bgp 200 redistributed connected default-metric 1000 100 250 100 1500 ! router bgp 200 neighbor 1.0. you redistribute IGP routes (such as Enhanced IGRP.” later in this chapter) or redistribute static routes instead of redistributing dynamic routes.1 distribute-list 1 out redistribute eigrp 10 ! access-list 1 permit 175. you should use the network command (described in the section “Using the network Command. If possible.2 remote-as 200 neighbor 1.255. All other networks. Access list 1 specifies that network 175. Redistributing a static route is the best way to advertise a supernet because it prevents the route from flapping.1. OSPF.1. and the router will send it out the appropriate interface.220. BGP and Route Maps The ip route global configuration command establishes a static route for network 175. Using the Border Gateway Protocol for Interdomain Routing 12-13 . In practice. IGRP.0. and RIP routes) into BGP.220. such as network 129.0 as originating from AS 200.220.1. and that Router B is redistributing 129. Note Regardless of route type (static or dynamic).0.0 via BGP.0.

Figure 12-10 Network Advertisement Example 2 AS 100 AS 200 150.1 remote-as 300 network 175. when used with an IGP such as RIP.10.0 160.1 150. Figure 12-10 shows another topology that demonstrates the effects of the network command.2 remote-as 300 network 150.2 Router C AS 300 S4581 170.10.20.10.10.20.0: !Router C router bgp 200 neighbor 1.10.20.10.20. the network command specifies the networks that the AS originates.220.0.10.) The network command works for networks that the router learns dynamically or that are configured as static routes.2 remote-as 300 network 160.0 !Router C router bgp 300 neighbor 150.0 Router A Router B 150.0 The network router configuration command causes Router C to generate an entry in the BGP routing table for network 175.10.220. When used with BGP.10. The origin attribute of routes that are injected into BGP by means of the network command is set to IGP.1 remote-as 200 network 170.1.0.0.220. the network command identifies the interfaces on which the IGP is to run.0.BGP and Route Maps Using the network Command Another way to advertise networks is to use the network router configuration command.10.0 !Router B router bgp 200 neighbor 160.1 remote-as 100 neighbor 160.10.1.0 12-14 Internetworking Case Studies .0 The following configurations use the network command to configure the routers shown in Figure 12-10: !Router A router bgp 100 neighbor 150.1 160.20.0.20.0. The following commands configure Router C to advertise network 175.20. (By way of contrast.0.10.10.2 160.0.0.0.20.10.

This section describes the following attributes and factors that BGP uses in the decision-making process: • AS_path Attribute • Origin Attribute • Next Hop Attribute • Weight Attribute • Local Preference Attribute • Multi-Exit Discriminator Attribute • Community Attribute AS_path Attribute Whenever an update passes through an AS.10. For example.0 Router C AS 300 S4583 180. Router C will pass the update to Router B with the origin still set to AS 100.10.0.0. BGP Decision Algorithm To ensure a loop-free interdomain topology. BGP Decision Algorithm When a BGP speaker receives updates from multiple ASs that describe different paths to the same destination. BGP does not accept updates that originated from its own AS. which will recognize that the update originated from its own AS and will ignore it. it must choose the single best path for reaching that destination. in Figure 12-10. BGP prepends its AS number to the update. the origin of the route. The decision is based on the value of attributes (such as next hop. BGP propagates the best path to its neighbors.0 Router A Router B AS 100 170. Consider the network shown in Figure 12-11.10.10. Once chosen. Figure 12-11 AS_path Attribute AS 200 190. if Router A generates an update for network 150.0 Using the Border Gateway Protocol for Interdomain Routing 12-15 . local preference. Router B will send the update (with the origin still set to AS 100) to Router A. administrative weights. An AS-SET is a mathematical set of all the ASs that have been traversed. The AS_path attribute is the list of AS numbers that an update has traversed in order to reach a destination.10. and path length) that the update contains and other BGP-configurable factors.0 with the origin set to AS 100 and sends it to Router C.0.

Figure 12-12 Origin Attribute AS 100 150. so when the update reaches Router A. An origin of Incomplete occurs when a route is redistributed into BGP.255.0 The following commands configure the routers shown in Figure 12-12: !Router A router bgp 100 neighbor 190. The origin of a route can be one of three values: • IGP—The route is interior to the originating AS.1 remote-as 100 neighbor 170.0. Router B advertises network 190.20.1 EBGP 170.10.0. the AS_path attribute for reaching network 170.0 255. The IGP origin type is represented by the letter i in the output of the show ip bgp EXEC command.20.0.30. Origin Attribute The origin attribute provides information about the origin of the route.2 Router E AS 300 S4584 170. Likewise.50.0 from Router B is 300.10. 100. The Incomplete origin type is represented by the ? symbol in the output of the show ip bgp EXEC command.10. • Incomplete—The origin of the route is unknown or learned in some other way.BGP Decision Algorithm In Figure 12-11.50. That is.0. Router C prepends its own AS number to it. Figure 12-12 shows a network that demonstrates the value of the origin attribute.10.0 traverses AS 300.40.0.0 null 0 12-16 Internetworking Case Studies .10.0. The EGP origin type is represented by the letter e in the output of the show ip bgp EXEC command.0 in AS 200 with an AS_path of 200.0. 200.0 from Router A is 300.1 175. • EGP—The route is learned via the Exterior Gateway Protocol (EGP).10.20.10.10.10. This value is set when the network router configuration command is used to inject the route into BGP. the AS_path attribute for reaching network 190.1 Router A IBGP Router B 170. When the update for 190.10.10.2 remote-as 300 network 150.2 190.10.10.10.0 redistribute static ! ip route 190.0. two AS numbers have been attached to it: 200 and then 300.

10.1 remote-as 100 network 170.0 !Router E router bgp 300 neighbor 170.0.20.1 Router A Router B 170.10.10.0.20.10.0.30.10.) Consider the network shown in Figure 12-13.0 150. in which case.0 has an empty AS_path (the route is in the same AS as Router A) and an origin attribute of IGP.10.0 Using the Border Gateway Protocol for Interdomain Routing 12-17 .1 IBGP 150.2 Router C AS 300 S4585 170. • From Router E. the next hop is usually the IP address of the neighbor specified by the neighbor remote-as router configuration command. the route for reaching 150. Next Hop Attribute The BGP next hop attribute is the IP address of the next hop that is going to be used to reach a certain destination. the following is true: • From Router A.10.10.0 Given these configurations.50.20.0. the route for reaching 170.0 has an AS_path of 100 and an origin attribute of Incomplete (because 190. the next hop could be the IP address of the router in the same subnet.0 has an AS_path of 300 and an origin attribute of IGP.0.10. BGP Decision Algorithm !Router B router bgp 100 neighbor 150.50. the route for reaching 190.1 EBGP 170.10.0.10.0 has an AS_path of 100 and an origin attribute of IGP.10. Figure 12-13 Next Hop Attribute AS 100 150. (The exception is when the next hop is on a multiaccess media. the route for reaching 190.0.30.10.10.50.1 remote-as 100 network 190. • From Router E. • From Router A.10.0 is a redistributed route). For EBGP.

You might want to make IGRP passive on the link to Router C so that only BGP updates are exchanged. Otherwise.0.10.10.30.10.10. such as Ethernet.2.10. and Router A advertises network 150. Router A should run IGRP on network 170.10. For that reason.10.50. Next Hop Attribute and Multiaccess Media BGP might set the value of the next hop attribute differently on multiaccess media. and Router A advertises 170. 12-18 Internetworking Case Studies . instead of 150.20. Consider the network shown in Figure 12-14.1 remote-as 100 network 150.20. if Router B runs IGRP.10. the next hop to reach 170.10. Router C advertises network 170.0.10.2.20.30.20.BGP Decision Algorithm In Figure 12-13.0 Note Router C advertises 170.1.0 to Router A with a next hop attribute of 170.0 to Router A with a next hop attribute of 170. The following commands configure the routers shown in Figure 12-13: !Router A router bgp 100 neighbor 170.0 to Router B with a next hop attribute of 170.10. Because of that rule.0 to its IBGP peer (Router B) with a next hop attribute of 170.0.1 remote-as 100 !Router C router bgp 300 neighbor 170.10. according to Router B.0.0.2 remote-as 300 neighbor 150.20.10.2. the configuration must ensure that Router B can reach 170.10.2.10.10.2.0. Router A advertises 170.0 is 170.20.0.10. For example.0.20. Router B will drop packets destined for 170.0.0 to Router C with a next hop attribute of 170. BGP specifies that the next hop of EBGP-learned routes should be carried without modification into IBGP.0 because the next hop address is inaccessible. As a result.20. The next hop of EBGP-learned routes is passed to the IBGP neighbor.10.10.10.1.0.0 !Router B router bgp 100 neighbor 150.10.20.2 via an IGP.0.10.1 remote-as 100 network 170.

10. When Router C sends a BGP update to Router A regarding 180.10. C. and C are in the same subnet. Routers C and D in AS 300 are running OSPF.10. such as Frame Relay. instead of its own IP address (170.10.0 150. and it makes more sense for Router A to use Router D as the next hop rather than taking an extra hop via Router C.20.20.1 AS 100 150.10.0.10. The problem is that Router A does not have a direct permanent virtual Using the Border Gateway Protocol for Interdomain Routing 12-19 . B. This is because Routers A.20.10.1 Router A Router B 170.20. Next Hop Attribute and Nonbroadcast Media Access In Figure 12-15.2).20.20.0.10. use a common media such as Frame Relay (or any NBMA cloud).0 to Router A with a next hop of 170.0.0 via 170.0.3.10.0.20.20.50.3 Router C Router D S4587 AS 300 180.50.20.20. BGP Decision Algorithm Figure 12-14 Next Hop Attribute and Multiaccess Media 150.10.10. it sets the next hop attribute to 170.20.3.0 If Routers A.10.2 170. Router C advertises 180. just as it would do if the common media were Ethernet. three networks are connected by a nonbroadcast media access (NBMA) cloud. Router C is running BGP with Router A. Figure 12-15 Next Hop Attribute and Nonbroadcast Media Access AS 100 150.1 150.0.0 S4586 AS 300 In Figure 12-14. and D.10.3 Router C Router D 180.10.2 170.20.3.30.1 PVC PVC 170.1 150.0.0 170. Router C can reach network 180.20.20.20.10.30.10.0.1 Router A Router B 170.

20.1 remote-as 100 neighbor 170. By default.1.2.2. The weight attribute is local to the router on which it is assigned. Weight Attribute The weight attribute is a special Cisco attribute that is used in the path selection process when there is more than one route to the same destination.0. Routers A and B learn about network 175.BGP Decision Algorithm connection (PVC) to Router D and cannot reach the next hop.1 next-hop-self The neighbor next-hop-self command causes Router C to advertise 180. Router C has two routes for reaching 175.0.10. Routes with a higher weight are preferred when there are multiple routes to the same destination. To remedy this situation.10. Router C will use Router A as the next hop to reach network 175.10.0.1 Router D 2.0.0 190.10. Consider the network shown in Figure 12-16. Figure 12-16 Weight Example AS 100 AS 400 AS 200 170.0.10. use the neighbor next-hop-self router configuration command. so routing will fail. and it is not propagated in routing updates.0 Router C S4591 AS 300 In Figure 12-16.0 175.1. you set the weight of the updates coming in from Router A to be higher than the updates coming in from Router B.10.0 175. There are three ways to set the weight for updates coming in from Router A: • Using an Access List to Set the Weight Attribute • Using a Route Map to Set the Weight Attribute • Using the neighbor weight Command to Set the Weight Attribute 12-20 Internetworking Case Studies .0 with the next hop attribute set to 170.0 from AS 400.10.2.10.0.0 Router A Router D Router B 1. the weight attribute is 32768 for paths that the router originates and zero for other paths.10.20. as shown in the following configuration for Router C: !Router C router bgp 300 neighbor 170.10.0.0. on Router C.20. and each propagates the update to Router C.0.0.20. If.2 175.10.0 and has to decide which route to use.

1.1. see the appendix on regular expressions in the Cisco Internetwork Operating System (Cisco IOS) software configuration guides and command references.2 weight 1000 Using the Border Gateway Protocol for Interdomain Routing 12-21 .1.1. (The ^ and $ symbols are used to form regular expressions.2 remote-as 200 neighbor 2.2 remote-as 200 neighbor 2.1.2. In effect. this configuration assigns 2000 to the weight attribute of all route updates received from AS 100 and assigns 1000 to the weight attribute of all route updates from AS 200.1 route-map SETWEIGHTIN in neighbor 2.2.2. Access list 6 permits updates whose AS_path attribute starts with 200 and ends with 200. Access list 5 permits updates whose AS_path attribute starts with 100 (as specified by ^) and ends with 100 (as specified by $).2.1 filter-list 5 weight 2000 neighbor 2. Using the neighbor weight Command to Set the Weight Attribute The following configuration for Router C uses the neighbor weight router configuration command: !Router C router bgp 300 neighbor 1.1 weight 2000 neighbor 2.2 remote-as 200 neighbor 2. 2000 is assigned to the weight attribute of updates from the neighbor at IP address 1.2 route-map SETWEIGHTIN in ! ip as-path access-list 5 permit ^100$ ! route-map SETWEIGHTIN permit 10 match as-path 5 set weight 2000 route-map SETWEIGHTIN permit 20 set weight 1000 This first instance of the SETWEIGHTIN route map assigns 2000 to any route update from AS 100.1. This example also assigns 1000 to the weight attribute of updates from the neighbor at IP address 2.2 that are permitted by access list 6.1 remote-as 100 neighbor 1.1.2 filter-list 6 weight 1000 ! ip as-path access-list 5 permit ^100$ ip as-path access-list 6 permit ^200$ In this example.2.1.2. BGP Decision Algorithm Using an Access List to Set the Weight Attribute The following commands on Router C use access lists and the value of the AS_path attribute to assign a weight to route updates: !Router C router bgp 300 neighbor 1.2.1 that are permitted by access list 5.2.2.2. and the second instance of the SETWEIGHTIN route map assigns 1000 to route updates from any other AS. Using a Route Map to Set the Weight Attribute The following commands on Router C use a route map to assign a weight to route updates: !Router C router bgp 300 neighbor 1. For a complete explanation of regular expressions.1 remote-as 100 neighbor 1.1.2.1 remote-as 100 neighbor 1.1.1.2.1.2.2.1.1.

BGP Decision Algorithm This configuration sets the weight of all route updates from AS 100 to 2000.213.2 Router C IBGP Router D AS 34 S4592 AS 256 In Figure 12-17.10.2 remote-as 256 bgp default local-preference 150 12-22 Internetworking Case Studies .3.213. which is only relevant to the local router.0 from AS 100 and AS 300.1.2 3.0 AS 100 AS 300 Router A Router B 1. the local preference attribute is part of the routing update and is exchanged among routers in the same AS.10.3.213.11.1.1 remote-as 100 neighbor 128. Figure 12-17 Local Preference 170. AS 256 receives route updates for network 170.4 1.0.1 128.1. The path with the higher preference is preferred (the default value of the local preference attribute is 100). The higher weight assigned to route updates from AS 100 causes Router C to send traffic through Router A.3 128. The network shown in Figure 12-17 demonstrates the local preference attribute.1.3.1.1 3. Local Preference Attribute When there are multiple paths to the same destination. the local preference attribute indicates the preferred path. There are two ways to set local preference: • Using the bgp default local-preference Command • Using a Route Map to Set Local Preference Using the bgp default local-preference Command The following configurations use the bgp default local-preference router configuration command to set the local preference attribute on Routers C and D: !Router C router bgp 256 neighbor 1.11.0. and the weight of all route updates coming from AS 200 to 1000.3.11.1. Unlike the weight attribute.

The following configuration uses a route map to set the local preference attribute on Router D specifically for updates regarding AS 300: !Router D router bgp 256 neighbor 3.213. the local preference attribute of any update coming from AS 300 is set to 200. all traffic in AS 256 destined for network 170.3. When BGP sends that update to another AS. the MED is reset to 0. Because local preference is exchanged within the AS. MED is known as Inter-AS_Metric. Using the Border Gateway Protocol for Interdomain Routing 12-23 .3. The default value of the MED attribute is 0. Note In BGP Version 3. As a result. that value is used for decision making within the AS. A lower MED value is preferred over a higher MED value.3.3. Multi-Exit Discriminator Attribute The multi-exit discriminator (MED) attribute is a hint to external neighbors about the preferred path into an AS when there are multiple entry points into the AS. Unlike local preference.10.0 is sent to Router D as the exit point.11.213. and the configuration for Router D causes it to set the local preference for all updates from AS 100 to 200. Unless otherwise specified.0 have a higher local preference when they come from AS 300 than when they come from AS 100. Using a Route Map to Set Local Preference Route maps provide more flexibility than the bgp default local-preference router configuration command.0.1 remote-as 256 ! ip as-path 7 permit ^300$ route-map SETLOCALIN permit 10 match as-path 7 set local-preference 200 ! route-map SETLOCALIN permit 20 With this configuration. When the bgp default local-preference command is used on Router D in Figure 12-17.1 remote-as 256 bgp default local-preference 200 The configuration for Router C causes it to set the local preference of all updates from AS 300 to 150. the router compares MED attributes for paths from external neighbors that are in the same AS.4 remote-as 300 route-map SETLOCALIN in neighbor 128.0. When an update enters the AS with a certain MED value.4 remote-as 300 neighbor 128. but a MED attribute that comes into an AS does not leave the AS. BGP Decision Algorithm !Router D router bgp 256 neighbor 3. the local preference attribute of all updates received by Router D will be set to 200. both Routers C and D determine that updates regarding network 170. you must configure the bgp always-compare-med command. If you want MED attributes from neighbors in other ASs to be compared. Instance 20 of the SETLOCALIN route map accepts all other routes. including updates from AS 34.11. the MED attribute is exchanged between ASs.10.

BGP Decision Algorithm

The network shown in Figure 12-18 demonstrates the use of the MED attribute.

Figure 12-18 MED Example

AS 100 AS 400
170.10.0.0 180.10.0.0
MED = 50
4.4.4.4
4.4.4.3
Router A 3.3.3.2 Router B
2.2.2.2 5.5.5.5

180.10.0.0
180.10.0.0
MED = 200
MED = 120
2.2.2.1 5.5.5.4

3.3.3.3
Router C Router D
1.1.1.1 1.1.1.2
AS 300

S4593
180.10.0.0

In Figure 12-18, AS 100 receives updates regarding network 180.10.0.0 from Routers B, C, and D.
Routers C and D are in AS 300, and Router B is in AS 400.
The following commands configure Routers A, B, C, and D:
!Router A
router bgp 100
neighbor 2.2.2.1 remote-as 300
neighbor 3.3.3.3 remote-as 300
neighbor 4.4.4.3 remote-as 400

!Router B
router bgp 400
neighbor 4.4.4.4 remote-as 100
neighbor 4.4.4.4 route-map SETMEDOUT out
neighbor 5.5.5.4 remote-as 300
!
route-map SETMEDOUT permit 10
set metric 50

!Router C
router bgp 300
neighbor 2.2.2.2 remote-as 100
neighbor 2.2.2.2 route-map SETMEDOUT out
neighbor 5.5.5.5 remote-as 400
neighbor 1.1.1.2 remote-as 300
!
route-map SETMEDOUT permit 10
set metric 120

!Router D
router bgp 300
neighbor 3.3.3.2 remote-as 100
neighbor 3.3.3.2 route map SETMEDOUT out
neighbor 1.1.1.1 remote-as 300
route-map SETMEDOUT permit 10
set metric 200

12-24 Internetworking Case Studies

BGP Decision Algorithm

By default, BGP compares the MED attributes of routes coming from neighbors in the same external
AS (such as AS 300 in Figure 12-18). Router A can only compare the MED attribute coming from
Router C (120) to the MED attribute coming from Router D (200) even though the update coming
from Router B has the lowest MED value.
Router A will choose Router C as the best path for reaching network 180.10.0.0. To force Router A
to include updates for network 180.10.0.0 from Router B in the comparison, use the
bgp always-compare-med router configuration command, as in the following modified
configuration for Router A:
!Router A
router bgp 100
neighbor 2.2.2.1 remote-as 300
neighbor 3.3.3.3 remote-as 300
neighbor 4.4.4.3 remote-as 400
bgp always-compare-med

Router A will choose Router B as the best next hop for reaching network 180.10.0.0 (assuming that
all other attributes are the same).
You can also set the MED attribute when you configure the redistribution of routes into BGP. For
example, on Router B you can inject the static route into BGP with a MED of 50 as in the following
configuration:
!Router B
router bgp 400
redistribute static
default-metric 50
!
ip route 160.10.0.0 255.255.0.0 null 0

The preceding configuration causes Router B to send out updates for 160.10.0.0 with a MED
attribute of 50.

Community Attribute
The community attribute provides a way of grouping destinations (called communities) to which
routing decisions (such as acceptance, preference, and redistribution) can be applied.
Route maps are used to set the community attribute. A few predefined communities are listed in
Table 12-1.

Table 12-1 Predefined Communities

Community Meaning
no-export Do not advertise this route to EBGP peers.
no-advertise Do not advertise this route to any peer.
internet Advertise this route to the internet community; all routers in the network belong to it.

The following route maps set the value of the community attribute:
route-map COMMUNITYMAP
match ip address 1
set community no-advertise
!
route-map SETCOMMUNITY
match as-path 1
set community 200 additive

Using the Border Gateway Protocol for Interdomain Routing 12-25

Controlling the Flow of BGP Updates

If you specify the additive keyword, the specified community value is added to the existing value
of the community attribute. Otherwise, the specified community value replaces any community
value that was set previously.
To send the community attribute to a neighbor, you must use the neighbor send-community router
configuration command, as in the following example:
router bgp 100
neighbor 3.3.3.3 remote-as 300
neighbor 3.3.3.3 send-community
neighbor 3.3.3.3 route-map setcommunity out

For examples of how the community attribute is used to filter updates, see the section “Community
Filtering,” later in this chapter.

Summary of the BGP Path Selection Process
BGP selects only one path as the best path. When the path is selected, BGP puts the selected path in
its routing table and propagates the path to its neighbors. BGP uses the following criteria, in the order
presented, to select a path for a destination:
1 If the path specifies a next hop that is inaccessible, drop the update.
2 Prefer the path with the largest weight.
3 If the weights are the same, prefer the path with the largest local preference.
4 If the local preferences are the same, prefer the path that was originated by BGP running on this
router.
5 If no route was originated, prefer the route that has the shortest AS_path.
6 If all paths have the same AS_path length, prefer the path with the lowest origin type (where IGP
is lower than EGP, and EGP is lower than Incomplete).
7 If the origin codes are the same, prefer the path with the lowest MED attribute.
8 If the paths have the same MED, prefer the external path over the internal path.
9 If the paths are still the same, prefer the path through the closest IGP neighbor.
10 Prefer the path with the lowest IP address, as specified by the BGP router ID.

Controlling the Flow of BGP Updates
This section describes techniques for controlling the flow of BGP updates. The techniques include
the following:
• Administrative Distance
• BGP Filtering
• BGP Peer Groups
• CIDR and Aggregate Addresses
• Confederations
• Route Reflectors
• Route Flap Dampening

12-26 Internetworking Case Studies

All of these default distances are higher than the default distance of EBGP (which is 20).2. a route could be learned via more than one protocol.0. IGRP.1 Router C AS 300 S4588 170. two ASs have an IGP-learned backdoor route and an EBGP-learned route.10. but it does influence whether BGP-learned routes are installed in the IP routing table. The default distances for RIP.3 EBGP EBGP 2. the route with the lowest distance is preferred. Controlling the Flow of BGP Updates Administrative Distance Normally. Sometimes. The network in Figure 12-19 shows this situation. IGRP.2.2 3.3. Administrative distance is used to discriminate between routes learned from more than one protocol. Enhanced IGRP.2. 90.0.0 160. Figure 12-19 Back Door Example AS 100 AS 200 150.3. By default.3.0 In Figure 12-19. Routers A and C are running EBGP. it is installed in the IP routing table because of its distance (20).0.2. BGP uses the administrative distances shown in Table 12-2. and 110. Table 12-2 BGP Default Distances Distance Default Value Function External 20 Applied to routes learned from EBGP Internal 200 Applied to routes learned from IBGP Local 200 Applied to routes originated by the router Note Distance does not influence the BGP path selection algorithm. as are Routers B and C. 100.10.10. respectively. Using the Border Gateway Protocol for Interdomain Routing 12-27 . The route with the lowest administrative distance is installed in the IP routing table.1 3. Enhanced IGRP. however. Usually when a route is learned via EBGP. or OSPF). Their policy might be to use the IGP-learned path as the preferred path and to use the EBGP-learned path when the IGP path is down. Usually. Routers A and B are running an IGP (such as RIP. and OSPF are 120.3.0 IGP Router A Router B 2.

you can filter based on routing updates to or from a particular neighbor. Note Although BGP treats network 160.2. Router A treats the EBGP-learned route as local and installs it in the IP routing table with a distance of 200.10. (Not recommended because the distance will affect all updates. BGP Filtering You can control the sending and receiving of updates by using the following filtering methods: • Prefix Filtering • AS_path Filtering • Route Map Filtering • Community Filtering Each method can be used to achieve the same result—the choice of method depends on the specific network configuration.0 backdoor With the network backdoor command.0.2. Router A will choose the EBGP-learned route from Router C.0. (Recommended) To establish a BGP back door. The network is also learned via Enhanced IGRP (with a distance of 90). The network shown in Figure 12-20 demonstrates the usefulness of prefix filtering.0. (Not recommended because the distance will affect all updates. use the network backdoor router configuration command.0.0 from two routing protocols: EBGP and an IGP. Prefix Filtering To restrict the routing information that the router learns or advertises.1 remote-as 300 network 160. which might lead to undesirable behavior when multiple routing protocols interact with one another.10. you could use one of the following techniques: • Change the external distance of EBGP. so the Enhanced IGRP route is successfully installed in the IP routing table and is used to forward traffic. If you want Router A to learn about 160. The filter consists of an access list that is applied to updates to or from a neighbor.) • Establish a BGP back door.0 router bgp 100 neighbor 2.10.10.0.0 as a local entry. If the Enhanced IGRP-learned route goes down. Because the default distance for EBGP is lower than the default distance of the IGP. it does not advertise network 160. The following commands configure Router A in Figure 12-19: !Router A router eigrp 10 network 150. the EBGP-learned route will be installed in the IP routing table and used to forward traffic. which might lead to undesirable behavior when multiple routing protocols interact with one another.10.10.) • Change the distance of the IGP.0.0 from Router B (IGP).0 as it normally would advertise a local entry.Controlling the Flow of BGP Updates Router A receives updates about 160. 12-28 Internetworking Case Studies .

0.2.0.0.0 to AS 100.2.255.0. The following access list would permit 160.255.0 0.0/9.3 remote-as 200 neighbor 2.255. Router B is originating network 160. such as the following: access-list 101 permit ip 160.0. and so on: access-list 1 permit 160.0.3.1 3.0.0/8.10. Using the Border Gateway Protocol for Interdomain Routing 12-29 .0.255 access-list 1 permit 0.255 To restrict the update to 160.255.0.0 160.0.0.10.3 160.0. that Router B in Figure 12-20 has different subnets of 160.10.0.3.0 255.10. The network shown in Figure 12-21 demonstrates the usefulness of AS_path filters.2.0.0.x.10.255 255.2.2.0 2.10.0.0. the combination of the neighbor distribute-list router configuration command and access list 1 prevents Router C from propagating routes for network 160.0 0. Assume. Controlling the Flow of BGP Updates Figure 12-20 Route Filtering AS 100 AS 200 150.10.3.10.0. and you want to advertise 160.x.2 3.1 Router C S4594 AS 300 170.0 AS_path Filtering You can specify an access list on both incoming and outgoing updates based on the value of the AS_path attribute.10.0 0.0.0 and sending it to Router C. Using access lists to filter supernets is a bit trickier. If you want to prevent Router C from propagating updates for network 160.0.10.255.0 when it sends routing updates to neighbor 2.0. you can apply an access list to filter those updates when Router C exchanges updates with Router A.0 0.0.0/8 only.2 (Router A).0.2.2 remote-as 100 neighbor 2.0/8 only.2.2. as demonstrated by the following configuration for Router C: !Router C router bgp 300 network 170.10.2.0.0 Router A Router B 2.0.0 neighbor 3.255 In the preceding configuration.255. you have to use an extended access list.0.0 In Figure 12-20. 160.3.2 distribute-list 1 out ! access-list 1 deny 160.255.0.3.2.0 160.3.0.0. for example.

0. Because Router B sends updates about 160. Note The neighbor route-map command has no effect on incoming updates when matching is based on IP address. 12-30 Internetworking Case Studies .2.0 AS 400 Router A Router B 2. which in effect permits any update that has not been denied by the previous access-list statement.3.3.0 160.3.10.2.2.3. If the access list specified ^200 as the regular expression.0 2.10. If you want to verify that your regular expressions work as intended. Together.10. access list 1 denies any update whose AS_path attribute starts with 200 (as specified by ^) and ends with 200 (as specified by $).10.0.1 3. The network shown in Figure 12-22 demonstrates using route maps to filter BGP updates.2 remote-as 100 neighbor 2.* matches any value of the AS_path attribute. Route Map Filtering The neighbor route-map router configuration command can be used to apply a route map to incoming and outgoing routes.) symbol means any character.2. the access list permits updates from AS 400 (whose AS_path attribute is 200.2 filter-list 1 out ! ip as-path access-list 1 deny ^200$ ip as-path access-list 1 permit . 400).0 !Router C neighbor 3.2.3.0. In the second access-list statement.* In this example.3. the period (.3 160.0 whose AS_path attributes start with 200 and end with 200.2 3.10.2.2. updates from AS 400 would be denied.0.10.Controlling the Flow of BGP Updates Figure 12-21 AS_path Filtering AS 100 AS 200 150. By specifying that the update must also end with 200.0.0 160.0. . such updates will match the access list and will be denied.2.3 remote-as 200 neighbor 2.1 Router C AS 300 S4595 170. use the following EXEC command: show ip bgp regexp regular-expression The router displays all of the paths that match the specified regular expression. and the asterisk (*) symbol means a repetition of that character.

3.0. you do not want Router C to learn about AS 100.0 Assume that in Figure 12-22.) Also. (That is. The following configuration for Router C accomplishes this goal: !Router C router bgp 300 network 170. All other updates are denied and dropped. Controlling the Flow of BGP Updates Figure 12-22 BGP Route Map Filtering AS 600 190. on those routes that Router C accepts from AS 200. AS 400. access list 1 permits updates that originate in AS 200).3.10.0. you want Router C to learn about networks that are local to AS 200 only.3. access list 1 permits any update whose AS_path attribute begins with 200 and ends with 200 (that is.3 remote-as 200 neighbor 3.10. The following configuration for Router C accomplishes this goal: !Router C router bgp 300 network 170.3.3 2.2.0 neighbor 3.0.0.3.2 3. you want Router C to do the following: • Accept updates that originate from AS 200 and change their weight attribute to 20.3.0 neighbor 3.10.2.3.2. • Accept any other updates and change their weight attribute to 10.1 Router C AS 300 S4597 170.0 160. The weight attribute of the permitted updates is set to 20.3 remote-as 200 neighbor 3.3 route-map STAMP in ! route-map STAMP permit 10 match as-path 1 set weight 20 ! ip as-path access-list 1 permit ^200$ In the preceding configuration.3.2.0.3 route-map STAMP in Using the Border Gateway Protocol for Interdomain Routing 12-31 .0 Router A Router B 2.10. you want the weight attribute to be set to 20.3.10. or AS 600 from AS 200. Assume that in Figure 12-22.0.3.3.0 AS 400 AS 100 AS 200 150. • Deny updates that contain AS 400.10.1 3.3.

All other updates will have a weight of 10 (by means of instance 30 of the STAMP route map) and will be permitted.0. the routers in AS 600 will pick the shortest AS_path attribute: the route through AS 100.0. as in the following configuration: !Router C router bgp 300 network 170. 300). 300.Controlling the Flow of BGP Updates route-map STAMP permit 10 match as-path 1 set weight 20 ! route-map STAMP permit 20 match as-path 2 ! route-map STAMP permit 30 set weight 10 ! ip as-path access-list 1 permit ^200$ ip as-path access-list 2 deny _400_ In the preceding configuration.2 route-map SETPATH out ! route-map SETPATH permit 10 set as-path prepend 300 300 The set as-path route map configuration command with the prepend keyword causes Router C to prepend 300 twice to the value of the AS_path attribute before it sends updates to the neighbor at IP address 2.2 (Router A). 12-32 Internetworking Case Studies . If you want to use the configuration of Router C to influence the choice of paths in AS 600. When updates about network 170.2. you can do so by prepending extra AS numbers to the AS_path attribute for routes that Router C advertises to AS 100. Suppose that in Figure 12-22 Router C advertises its own network (170.0) to AS 100 and AS 200.10. Access list 2 denies updates whose AS_path attribute contains 400. Community Filtering The network shown in Figure 12-23 demonstrates the usefulness of community filters. A common practice is to repeat the AS number. 300) as the better path.0 that AS 600 receives via AS 100 will be 100. access list 1 permits any update whose AS_path attribute begins with 200 and ends with 200 (that is.0.10.2.0 that AS 600 receives via AS 400 (400.0.2.2.10.10. 200. The weight attribute of the permitted updates is set to 20. 300.0. AS 600 will choose (400. the AS_path attribute of updates for network 170. 300) and via AS 400 with an AS_path attribute of (400. 200.2. 300. 200. Assuming that the values of all other attributes are the same. which is longer than the value of the AS_path attribute of updates for network 170.2. the routers in AS 600 will have network reachability information via two routes: via AS 100 with an AS_path attribute of (100. access list 1 permits updates that originate in AS 200).0 neighbor 2.10.0 arrive in AS 600. 300).2 remote-as 100 neighbor 2. As a result.

When Router C receives the updates from Router B.3 2.3.0 160.3.0.3.0.0 neighbor 3. The neighbor send-community router configuration command is required to include the community attribute in updates sent to the neighbor at IP address 3. it does not propagate them to Router A because the value of the community attribute is no-export.2.3.3.255 For routes that are sent to the neighbor at IP address 3. as in the following configuration for Router B: !Router B router bgp 200 network 160.1 send-community neighbor 3.3.3.1 route-map SETCOMMUNITY out ! route-map SETCOMMUNITY permit 10 match ip address 1 set community no-export ! route-map SETCOMMUNITY permit 20 ! access list 1 permit 0.0 255.0.10. Another way to filter updates based on the value of the community attribute is to use the ip community-list global configuration command.2.3.0 Assume that you do not want Router C to propagate routes learned from Router B to Router A. Router B applies the route map named SETCOMMUNITY.1 remote-as 300 neighbor 3.3.3.0.1 remote-as 300 neighbor 3.10.0. Assume that Router B has been configured as follows: !Router B router bgp 200 network 160.3.10.3.1 AS 300 S4596 170. Controlling the Flow of BGP Updates Figure 12-23 Community Filtering AS 100 AS 200 150.1 Router C 3.1 to no-export. The SETCOMMUNITY route map sets the community attribute of any update (by means of access list 1) destined for 3.2.255.1 send-community neighbor 3.3.3.1 (Router C).10.3.10. You can do this by setting the community attribute on updates that Router B sends to Router C.3.1.3.3.255.0.0 Router A Router B 2.3.3.2.2 3.0 neighbor 3.3.3.0.1 route-map SETCOMMUNITY out ! route-map SETCOMMUNITY permit 10 match ip address 2 set community 100 200 additive Using the Border Gateway Protocol for Interdomain Routing 12-33 .

3.3.3. Any route whose community attribute is only 200 (by virtue of the exact keyword) matches community list 2 and has its weight set to 10. (The internet keyword specifies all routes because all routes are members of the internet community.0.3.255 In the preceding configuration.1. That is.0 255. Router B adds 100 and 200 to the community value of any update destined for the neighbor at IP address 3. Instead of defining the same policies for each individual neighbor. you can only override options that are set for incoming updates. 12-34 Internetworking Case Studies . The use of BGP peer groups is demonstrated by the network shown in Figure 12-24. Members of a peer group inherit all of the configuration options of the peer group.Controlling the Flow of BGP Updates route-map SETCOMMUNITY permit 20 ! access list 2 permit 0. Update policies are usually set by route maps. distribution lists.255. In the last community list (list 3) the use of the internet keyword permits all other updates without changing the value of an attribute.255.) BGP Peer Groups A BGP peer group is a group of BGP neighbors that share the same update policies.3 remote-as 200 neighbor 3. you define a peer group name and assign policies to the peer group.3 route-map check-community in ! route-map check-community permit 10 match community 1 set weight 20 ! route-map check-community permit 20 match community 2 exact set weight 10 ! route-map check-community permit 30 match community 3 ! ip community-list 1 permit 100 ip community-list 2 permit 200 ip community-list 3 permit internet In the preceding configuration. Peer group members can also be configured to override configuration options if the options do not affect outgoing updates. To configure Router C to use the ip community-list global configuration command to set the value of the weight attribute based on whether the community attribute contains 100 or 200. and filter lists.3. any route that has 100 in its community attribute matches community list 1 and has its weight set to 20.0.3. use the following configuration: !Router C router bgp 300 neighbor 3.

1 6.3.1 Router G AS 300 S4598 6.6.3.2 remote-as 600 Using the Border Gateway Protocol for Interdomain Routing 12-35 .2.2 remote-as 100 neighbor 2.5.6.2 peer-group INTERNALMAP neighbor 6.10.0.1 5.6.1. F.3.3.2.0 The following commands configure a BGP peer group named INTERNALMAP on Router C and apply it to the other routers in AS 300: !Router C router bgp 300 neighbor INTERNALMAP peer-group neighbor INTERNALMAP remote-as 300 neighbor INTERNALMAP route-map INTERNAL out neighbor INTERNALMAP filter-list 1 out neighbor INTERNALMAP filter-list 2 in neighbor 5.2 filter-list 3 in The preceding configuration defines the following policies for the internalmap peer group: • A route map named INTERNAL • A filter list for outgoing updates (filter list 1) • A filter list for incoming updates (filter list 2) The configuration applies the peer group to all internal neighbors—Routers E.2 3.1. 200.2 4.6.4.2 Router E 2.2.3.2.4.6.2.4.2 peer-group INTERNALMAP neighbor 3.6.2.2.1.3. The configuration also defines a filter list for incoming updates from the neighbor at IP address 3.4.2.2 (Router E).2 1. and G.3.5.5.5. and 600: !Router C router bgp 300 neighbor EXTERNALMAP peer-group neighbor EXTERNALMAP route-map SETMED neighbor EXTERNALMAP filter-list 1 out neighbor EXTERNALMAP filter-list 2 in neighbor 2.0. Controlling the Flow of BGP Updates Figure 12-24 BGP Peer Groups AS 100 AS 600 AS 200 150.1.2 peer-group INTERNALMAP neighbor 3.0 Router A Router H Router B 2.2 170. The following commands configure a BGP peer group named EXTERNALMAP on Router C and apply it to routers in AS 100.1 1.2 Router C Router F 5.10.5.2 peer-group EXTERNALMAP neighbor 4.5. This filter list can only be used to override options that affect incoming updates.3.

1 3. which is a major improvement over BGP3. the neighbor remote-as router configuration commands are placed outside of the neighbor peer-group router configuration commands because different external ASs have to be defined. 192.11. (CIDR is also known as supernetting.1.0 255.2.0 160.10.0 to Router A. use the following commands: !Router C router bgp 300 neighbor 3.11.0 The aggregate-address router configuration command advertises the prefix route (in this case.0.3.10.10.3.0 aggregate-address 160.0 160.1.213.0 Router A Router B 160.2.0.1. For example.213.0.0. which minimizes the size of routing tables.0/8) and all of the more specific routes. which is an illegal Class C network number.0.3.0/16.0.0.255.2. Also note that this configuration defines filter list 3. which can be used to override configuration options for incoming updates from the neighbor at IP address 1. Therefore.3.1.0.4.0.1.0.0.0 255.0 3.3 remote-as 200 neighbor 2.0 and advertising it to Router C in AS 300.213.3 2.0. Consider the network shown in Figure 12-25.1.0. CIDR makes it easy to aggregate routes.0.3.2 peer-group EXTERNALMAP neighbor 1.213. 12-36 Internetworking Case Studies . Router B in AS 200 is originating network 160.2 remote-as 100 network 160.3.0.4.0.0.0.2.2 peer-group EXTERNALMAP neighbor 1.2.0.1.2 2.2 remote-as 200 neighbor 1.2 (Router B).0.2 filter-list 3 in In the preceding configuration.Controlling the Flow of BGP Updates neighbor 4. The /16 indicates that the subnet mask consists of 16 bits (counting from the left). is a legal supernet when it is represented in CIDR notation as 192.0. 160. Figure 12-25 Aggregation AS 100 AS 200 150.10.0/16 is similar to 192.2.1 Router C AS 300 S4600 160. To configure Router C to propagate the aggregate address 160.0 In Figure 12-25.1. Aggregation is the process of combining several different routes in such a way that a single route can be advertised. CIDR and Aggregate Addresses BGP4 supports classless interdomain routing (CIDR).0.) CIDR is a new way of looking at IP addresses that eliminates the concept of classes (Class A. Class B.0. network 192. and so on).

0.0.0.255 access-list 1 permit 0.0. even if you specify the summary-only keyword with the aggregate-address router configuration command. If you want Router C to propagate the prefix route only. you can define a route map and apply it to the aggregate.2.10. as demonstrated by the following commands: route-map SETORIGIN permit 10 set origin igp ! aggregate-address 160.20.0.2.0. If you want to suppress specific routes when aggregating routes. Note If you use the network command to advertise a network.0 255. can be redistributed from an IGP.0.0.0.0.0. If.255.0.0 attribute-map SETORIGIN Aggregation and Static Routes The network shown in Figure 12-26 demonstrates how static routes can be used to generate aggregates.0 and suppress the specific route 160.0 255.20.0.0.0. but propagate route 160. you want Router C in Figure 12-25 to aggregate 160.2 remote-as 100 network 160.0. The more specific route can be injected in the BGP routing table by incoming updates from other ASs.3.0. or can be established by the network router configuration command.0 255.0 255.255.0/8) and suppresses any more specific routes that the router may have in its BGP routing table.0 suppress-map CHECK ! route-map CHECK permit 10 match ip address 1 ! access-list 1 deny 160. use an attribute map. Controlling the Flow of BGP Updates Note A router cannot aggregate an address if it does not have a more specific route of that address in the BGP routing table.0.0 0.0 aggregate-address 160. the entry for that network is always injected into BGP updates.0. and you do not want it to propagate a more specific route.0.0 summary-only This command propagates the prefix (160. Using the Border Gateway Protocol for Interdomain Routing 12-37 . use the following commands: !Router C router bgp 300 neighbor 3.255.0. use the following command: aggregate-address 160.0.255 If you want the router to set the value of an attribute when it propagates the aggregate route. for example.0.0.3 remote-as 200 neighbor 2.3.10.0.

3.10.0 null 0 As a result of this configuration.2.0. has the same effect as the preceding configuration except that the origin attribute of updates for network 160.0 255.3.10. 12-38 Internetworking Case Studies .0.1 3.0.0.3.10.3. as in the following configuration.0.0. The following configuration for Router B redistributes a static aggregate route into BGP: !Router B router bgp 200 neighbor 3.3.0.0.0.0.0.0 Router A Router B 160.0.1 remote-as 300 redistribute static ! ip route 160.0 mask 255.0.3.0.2 2.0 3. you want Router B to advertise the prefix 160. Using the network router command instead of the redistribute command.2. This set is useful for preventing routing information loops.0 neighbor 3. !Router B router bgp 200 network 160.2.0.0 and suppress all of the more specific routes.0 255.2.0.0.1 Router C AS 300 S4601 170.0.0. Aggregation and AS-SET When aggregates are generated from more specific routes. the AS_path attributes of the more specific routes are combined to form a set called the AS-SET. Router B advertises the aggregate with an origin attribute whose value is Incomplete.0 In Figure 12-26.0 160.Controlling the Flow of BGP Updates Figure 12-26 CIDR Aggregation Example AS 100 AS 200 150.0.3.0.3 2. The network shown in Figure 12-27 demonstrates the use of AS-SET when aggregating addresses.0 null 0 Note The use of static routes (as shown in these two examples) is the preferred method of injecting an aggregate route because using static routes avoids unnecessary route flaps.1 remote-as 300 ! ip route 160.3.0 will be set to IGP instead of Incomplete.

4 Router C Router D 160.0.0 160.3 2.0 Router A 160.0 AS 400 In Figure 12-27.2 remote-as 100 neighbor 4.10.3.0.0.3.3.0.0.0 from Router B.4 remote-as 400 aggregate-address 160. If Router D has another route to AS 100.0/8 and sends updates for it to Router D.0 as-set The as-set keyword causes Router C to generate updates for network 160. the AS_path attribute of those updates will indicate that AS 300 is the origin of network 160. use the aggregate-address router configuration command with the as-set keyword.0.2.2 3. If Router C aggregates network 160.0.3 remote-as 200 neighbor 2.2.0.0.3.10.0 160.0.0 Router B 2.10. To prevent this problem.0. Confederations A confederation is a technique for reducing the IBGP mesh inside the AS.3. Router C is receiving updates about network 160.4.4.0 from Router A and is receiving updates about network 160.0. the set of 100 and 200). Controlling the Flow of BGP Updates Figure 12-27 CIDR Aggregation Example with AS-SET AS 100 AS 200 160.20.0. as in the following configuration for Router C: !Router C neighbor 3.0. Consider the network shown in Figure 12-28. the updates from AS 300 may cause a routing loop.2.0.0.0.20.2.2.20.0.4.0.0.0. Using the Border Gateway Protocol for Interdomain Routing 12-39 .30.3.1 4.4.0/8 that include information indicating that network 160.1 3.2.0 belongs to a set (in this case.0.0 255.0 AS 300 S4602 160.

You use confederations to divide the AS into multiple mini-ASs and assign the mini-ASs to a confederation. Even though the mini-ASs have EBGP peers to ASs within the confederation.213. and each router would need to connect to an external AS and run EBGP.11.1 remote-as 65050 neighbor 128.30.1 S4603 AS 500 In Figure 12-28.213.210.Controlling the Flow of BGP Updates Figure 12-28 Confederations AS 100 AS 600 Router A 5.213.2 128. Without confederations. the confederation looks like a single AS.5. as shown in Figure 12-28. and local preference information is preserved. BGP would require that the routers in AS 500 be fully meshed.20. Each mini-AS is fully meshed.30.6 AS65070 5.1 remote-as 65060 12-40 Internetworking Case Studies .5 6.1 129. To the outside world.1 Router D 135.14.6.5. they exchange routing updates as if they were using IBGP—that is.1 AS65050 AS65060 128.1 remote-as 65050 neighbor 128.10. The following commands configure Router C: !Router C router bgp 65050 bgp confederation identifier 500 bgp confederation peers 65060 65070 neighbor 128.210.1 Router C 128. That is. the next hop.20.5. each router would need to run IBGP with each of the other eight routers.213.212.213.6.5.11. and IBGP is run among its members. Confederations reduce the number of peers within the AS.210. MED. AS 500 consists of nine BGP speakers (although there might be other routers that are not configured for BGP). for a total of nine peers for each router.4 129.10. Each mini-AS has a connection to the other mini-ASs within the confederation.

5.30.213.6 remote-as 600 The router bgp global configuration command specifies that Router D belongs to AS 65060. Controlling the Flow of BGP Updates neighbor 135.2 remote-as 65060 neighbor 128.5. The second two neighbor remote-as commands establish BGP connections with confederation peers 65060 and 65070.4 remote-as 500 The neighbor remote-as command establishes an EBGP connection with Router C. The bgp confederation identifier router configuration command specifies that Router C belongs to confederation 500.212. The following commands configure Router D: !Router D router bgp 65060 bgp confederation identifier 500 bgp confederation peers 65050 65070 neighbor 129. Route Reflectors Route reflectors are another solution for the explosion of IBGP peering within an AS. The following commands configure Router A: !Router A router bgp 100 neighbor 5. The second two neighbor remote-as commands establish BGP connections with confederation peers 65050 and 65070.6.” a BGP speaker does not advertise a route learned from another IBGP speaker to a third IBGP speaker. The network shown in Figure 12-29 demonstrates how route reflectors work.212. or AS 65070. AS 65060. Router A is unaware of AS 65050.210. The first neighbor remote-as router configuration command establishes an IBGP connection to the other router within AS 65060. Route reflectors ease this limitation and allow a router to advertise (reflect) IBGP-learned routes to other IBGP speakers. Using the Border Gateway Protocol for Interdomain Routing 12-41 .5.1 remote-as 65050 neighbor 135.5. The last neighbor remote-as command establishes an EBGP connection with external AS 100. Router A only has knowledge of AS 500.1 remote-as 65070 neighbor 5.14. As described earlier in the section “Synchronization. The first two neighbor remote-as router configuration commands establish IBGP connections to the other two routers within AS 65050. thereby reducing the number of IBGP peers within an AS.6.30. The last neighbor remote-as command establishes an EBGP connection with AS 600. The bgp confederation identifier router configuration command specifies that Router D belongs to confederation 500.14.5 remote-as 100 The router bgp global configuration command specifies that Router C belongs to AS 50.1 remote-as 65070 neighbor 6.

1.2 Router B S4604 Without a route reflector. Each route reflector is configured as a nonclient peer of each other route reflector in a fully meshed topology.2. In the advanced configuration shown in Figure 12-30.1. If Router C is configured as a route reflector. 12-42 Internetworking Case Studies . the AS is divided into multiple clusters. There can be more than one route reflector in a cluster. An AS can have more than one route reflector.1. When an AS has more than one route reflector.2 route-reflector-client The router whose configuration includes neighbor route-reflector-client router configuration commands is the route reflector.2. and there can be more than one cluster in an AS. IBGP peering between Routers A and B is not required because Router C will reflect updates from Router A to Router B and from Router B to Router A.1 2.2 remote-as 100 neighbor 2.2.Controlling the Flow of BGP Updates Figure 12-29 Simple Route Reflector Example AS100 Router C Route reflector Router A 1.1 remote-as 100 neighbor 1. the network shown in Figure 12-29 would require a full IBGP mesh (that is. To configure Router C as a route reflector.1. with each cluster having one route reflector. When considered as a whole. each route reflector treats other route reflectors as normal IBGP speakers. Other IBGP peers of the route reflector that are not clients are called nonclients.1.2. the route reflector and its clients are called a cluster.1. Router A would have to be a peer of Router B). The routers identified by the neighbor route-reflector-client commands are clients of the route reflector.1 route-reflector-client neighbor 2. Note Route reflector clients should not establish peer relationships with IBGP speakers outside of their cluster. use the following commands: !Router C router bgp 100 neighbor 1.2.2.

1 Router E Router F Router A Router B S4605 AS 100 12.4.4.4.8. depending on the type of peer that sent the update: • Update from a nonclient peer—Send the update to all clients in the cluster.3. E.1. Note that Routers C.2.5.2.12 AS 300 In Figure 12-30.2 route-reflector-client neighbor 7. and Router C is the route reflector.2 1. and G are fully meshed and that the routers within a cluster are not fully meshed. it takes the following actions.6.1.2.1 remote-as 100 neighbor 1. and F form a second cluster. Controlling the Flow of BGP Updates Figure 12-30 Advanced Route Reflectors Example AS 200 8.8.7.7 reflector Route 4.5.7.8 remote-as 200 Using the Border Gateway Protocol for Interdomain Routing 12-43 .1 route-reflector-client neighbor 2. Routers A.8 Router G Route 7. B.2 remote-as 100 neighbor 2.1. Router G forms a third cluster. Routers D.8.2. of which Router D is the route reflector.1.12.12. • Update from a client peer—Send the update to all nonclient peers and to all client peers.2. When a route reflector in Figure 12-30 receives an update.4.3 Router D Router C reflector 6.4 remote-as 100 neighbor 8.3. The following configurations establish the route reflectors in AS 100: !Router C router bgp 100 neighbor 1.7.8.7 remote-as 100 neighbor 4.1.1.5 2.2.6 5.6.7. • Update from EBGP peer—Send the update to all nonclient peers and to all client peers.4 3. and C form a cluster. D.

it appends the local cluster ID to the cluster list.12.3 remote-as 100 neighbor 7.3 remote-as 100 neighbor 12. with Routers C and G). the update comes back to the originator.5. Note that Routers D and H maintain a fully meshed peering relationship with the other route reflectors in AS 100 (that is. all of the route reflectors in the cluster need to be configured with a 4-byte cluster ID. and H belong to the same cluster.7 remote-as 100 If a set clause is used to modify an attribute. A cluster list is a sequence of cluster IDs that an update has traversed. a routing loop may occur when the IBGP-learned routes are reflected. When a cluster has more than one route reflector. in which case. Routers D.7.6 route-reflector-client neighbor 3.12 remote-as 300 !Router D router bgp 100 neighbor 5.5. the cluster is identified by the router ID of the route reflector. E. F.5.6. the originator ignores it. To increase redundancy and avoid single points of failure.3. Router H is prepared to take its place.6. the neighbor next-hop-self command only affects the next hop of EBGP-learned routes when used with route reflectors. Routers D and H are route reflectors for the same cluster.Controlling the Flow of BGP Updates !Router B router bgp 100 neighbor 3.3.7. Another automatic restriction concerns the neighbor next-hop-self router configuration command.5.3. a cluster might have more than one route reflector. BGP automatically prevents the set clause of outgoing route maps from affecting routes reflected to IBGP peers. If Router D goes down. the update is ignored.5 route-reflector-client neighbor 6. The cluster ID allows route reflectors to recognize updates from other route reflectors in the same cluster. because of poor configuration.6 remote-as 100 neighbor 6. This attribute carries the router ID of the originator of the route in the local AS.6. When a route reflector sends a route from its clients to nonclients outside of the cluster.5 remote-as 100 neighbor 5.6. 12-44 Internetworking Case Studies .3.12. In Figure 12-31. Two techniques prevent routing loops in route reflector configurations: • Using an Originator ID • Using a Cluster List Using an Originator ID The originator ID is a 4-byte BGP attribute that is created by the route reflector. Because the next hop of reflected routes should not be changed. If the route reflector receives an update whose cluster list contains the local cluster ID. Using a Cluster List Usually a cluster has a single route reflector. If.

13 S4606 AS 500 The following commands configure Routers C.11.9 8.7.4.5.11.6.1.7.7.2 remote-as 100 neighbor 2.7 remote-as 100 neighbor 11.10 remote-as 100 neighbor 8.6. Controlling the Flow of BGP Updates Figure 12-31 Route Reflectors and Cluster Lists AS 400 AS 300 AS 200 11.2.5.1.1.9.11.11 9.3 Route reflector Router D Router C reflector Route reflector 6.4 remote-as 100 neighbor 7.8.8 7.8.10.13.1 remote-as 100 neighbor 1.6.3.1.10 2.10.11.4.8 remote-as 200 !Router D neighbor 10.7.7 remote-as 100 neighbor 10.4.7 Router G Route reflector Route 4.3 remote-as 100 neighbor 7.10.10.7.2.2 route-reflector-client neighbor 4.9.6.4.5.2 1.1 route-reflector-client neighbor 2.5.5 route-reflector-client neighbor 6.3.6.1.5 remote-as 100 neighbor 5.4 3. and H: !Router C router bgp 100 neighbor 1.6 remote-as 100 neighbor 6.6.8.10 remote-as 100 neighbor 5. D.2.6 Router H 10.5.1.7.13.2.5.5 Router F AS 100 13.10.10.6 route-reflector-client neighbor 3.3. F.2.2.3.11 remote-as 400 bgp cluster-id 10 Using the Border Gateway Protocol for Interdomain Routing 12-45 .1 Router E Router A Router B 5.8.

The configuration for Router C does not include the bgp cluster-id command because Router C is the only route reflector in its cluster.13.6.13.5 route-reflector-client neighbor 6.3 remote-as 100 neighbor 9. and F form a route reflector cluster. In Figure 12-32.4.4.7.7.6.9.13 remote-as 500 !Router H router bgp 100 neighbor 4. and Routers A.6. Routers D. B.5.10.9. which sets the cluster ID to 10.10.9 remote-as 300 bgp cluster-id 10 The configurations for Routers D and H include the bgp cluster-id router configuration command.3. Such routers are known as conventional BGP speakers.5. E.7 remote-as 100 neighbor 3.10 remote-as 100 neighbor 4.4 remote-as 100 neighbor 5.6. 12-46 Internetworking Case Studies .4.6 route-reflector-client neighbor 7.5.5. and C are conventional BGP speakers.5 remote-as 100 neighbor 5.4 remote-as 100 neighbor 13. Route Reflectors and Conventional BGP Speakers It is normal for an AS in which route reflectors are configured to have BGP speakers that do not support route reflection.4.3.6 remote-as 100 neighbor 6.Controlling the Flow of BGP Updates !Router F router bgp 100 neighbor 10.

1 remote-as 100 neighbor 8.5.3.4.2 1.2.6.13.4 remote-as 100 neighbor 2. Router C can be configured to be the route reflector.5 route-reflector-client neighbor 3. each conventional BGP speaker is peered with the route reflector (Router D).13.4.8 4.13 remote-as 300 When it is time to make the conventional BGP speakers members of a cluster.13 8.5 2. B.5.2.6.6.2.14.1.2.13. Controlling the Flow of BGP Updates Figure 12-32 Route Reflectors and Conventional BGP Speakers AS 300 AS 200 13.5 remote-as 100 neighbor 5.1 Router E Router F Router A Router B AS 100 14.1.8.2.1.8 remote-as 200 !Router D router bgp 100 neighbor 6.6 route-reflector-client neighbor 5.3 Route reflector Router D Router C 6.2 remote-as 100 neighbor 1.4 3.5.2 remote-as 100 neighbor 1.5.1.6 5. and Routers A and B can be its clients.6.1.14 S4607 AS 400 In Figure 12-32.1 remote-as 100 neighbor 13.1.5. and Routers A.3.4.8.3 remote-as 100 neighbor 2.8.14.6 remote-as 100 neighbor 6.4.6. and C are peered among each other.3.8.13.3.6.5. The following commands configure Routers C and D: !Router C router bgp 100 neighbor 4.2. Using the Border Gateway Protocol for Interdomain Routing 12-47 .

• Suppressed—A route that is not advertised even though it is up.250.174 S0/0 Router B 192. • History entry—An entry that is used to store flap information about a route that is down.Controlling the Flow of BGP Updates Route Flap Dampening Route flap dampening (introduced in Cisco Internetwork Operating System [Cisco IOS] Release 11.10. The following terms are used to describe route flap dampening: • Penalty—A numeric value that is assigned to a route when it flaps. BGP suppresses advertisement of the route even if the route is up.208. When the accumulated penalty reaches a configurable limit.2 255.2 S0 Router A S1 192. Note Dampening is not applied to routes that are learned via IBGP. Figure 12-33 Route Flap Dampening 203. This restriction avoids forwarding loops and prevents IBGP peers from having a higher penalty for routes that are external to the AS.6 AS 100 Loopback interface 0: 192.15.10. If the penalty is less than the reuse limit. If the penalty is greater than the suppress limit. the route is suppressed. The network shown in Figure 12-33 demonstrates route flap dampening.208. A route that is flapping receives a penalty of 1000 for each flap. the route is advertised again (if it is still up). • Half-life time—A configurable numeric value that describes the time required to reduce the penalty by one half.250. • Suppress limit—A numeric value that is compared with the penalty. A route is suppressed if the penalty is more than the suppressed limit.208.0) is a mechanism for minimizing the instability caused by route flapping. • Reuse limit—A configurable numeric value that is compared with the penalty.252 12-48 Internetworking Case Studies .5 S4619 AS 300 The following commands configure Routers A and B: !RouterA hostname RouterA ! interface serial 0 ip address 203. When the accumulated penalty is less than the reuse limit.255.10.15.255. a suppressed route that is up will no longer be suppressed. The accumulated penalty is decremented by the half-life time.

? . * valid.208.6 Now.0 neighbor 192.208.192 ! interface serial 0/0 ip address 192.208.208.5 (192.208. no best path) 300 (history entry) 192.255.6 remote-as 100 Router A is configured for route dampening.208.2 Status codes: s suppressed.0 is as follows: RouterA# show ip bgp 192.2 Status codes: s suppressed.internal Origin codes: i . the BGP table on Router A looks like this: RouterA# show ip bgp table version is 24.208. metric 0. the BGP entry for 192.208. * valid.10.255.10.255.0.10. has flapped.10.10.internal Origin codes: i .10.255.5 0 0 300 i *> 203.15.0 0 32768 i Because the route for 192.208. external Dampinfo: penalty 1000.10. version 25 Paths: (1 available. the BGP table on Router A looks like this: RouterB# show ip bgp table version is 24.208. local router ID is 203. i .0 0.5 remote-as 300 !RouterB hostname RouterB ! interface loopback 0 ip address 192.0 BGP routing table entry for 192.15.208. ? . Assuming that the EBGP link to Router B is stable.174) Origin IGP.5 0 0 300 i *> 203.0 192.0.250.208.0. h history. Controlling the Flow of BGP Updates interface serial 1 ip address 192.252 ! router bgp 300 network 192.0.255.0 192.10.IGP.208.0.250.5 255.0 neighbor 192.IGP.0.15.208. e .255. i . local router ID is 203.252 ! router bgp 100 bgp dampening network 203.10.10.10.15.0 0.10.208.6 255.10. d damped.10.208.15. > best.EGP. The output of the show ip bgp EXEC command for network 192.208.incomplete Network Next Hop Metric LocPrf Weight Path *> 192.208. enter this command on Router B: clear ip bgp 192.250.255.174 255.0 0 32768 i To simulate a route flap. flapped 1 times in 0:02:03 Using the Border Gateway Protocol for Interdomain Routing 12-49 .10.10.10.250. d damped.250.5 255.255. h history.0 has been withdrawn and put into the history state.10.EGP.incomplete Network Next Hop Metric LocPrf Weight Path h 192.5 from 192. e .208. > best.10.

no best path) 300.5 0 0 300 i *> 203.5 255. * valid.incomplete Network Next Hop Metric LocPrf Weight Path *d 192. the show ip bgp command displays the following: RouterA# show ip bgp table version is 32.0 is as follows: RouterA# show ip bgp 192. it is suppressed.15.10. ? .208.250.208.0.10.10. d damped.10.255. The route will be reused when the penalty reaches the reuse limit (default 750).10. Practical Design Example Figure 12-34 shows a BGP network that demonstrates the types of topologies that are typical among ISPs.Practical Design Example The route has been given a penalty (1000) for flapping but the penalty is still below the suppress limit (default 2000). flapped 3 times in 0:05:18.10.5 from 192.0 BGP routing table entry for 192. local router ID is 203.0 0 32768 i The output of the show ip bgp command for network 192. i . it is marked as a history entry.255.10.208.174) Origin IGP. The dampening information will be purged when the penalty becomes less than half of the reuse limit (750/2 = 350).2 Status codes: s suppressed. version 32 Paths: (1 available. > best. h history.208.internal Origin codes: i . Because the route is down. 12-50 Internetworking Case Studies . If the route flaps a few more times.208. but because the penalty is greater than the suppress limit.15.10. e .0 0.EGP. metric 0.0 192.0. reuse in 0:27:00 The route is up. (suppressed due to dampening) 192.250. external Dampinfo: penalty 2615.5 (192.208.IGP.208.208.0.

250.41 255. The following configurations are preliminary configurations for the routers shown in Figure 12-34.63.15.174 AS 200 S2/0 128. Practical Design Example Figure 12-34 Practical Design Example for ISPs E0 AS 100 203.2 Router F S1 203.208.208.211.255.X Whenever an AS is connected to two ISPs via EBGP. These preliminary configurations are incomplete so that BGP troubleshooting techniques can be demonstrated.10.250. IBGP should be run within the AS for better control over routes.255.1 E0 203.” later in this chapter.6 Loopback interface 0: S2/1 128.255.213.1 Loopback interface 0: Router G 195. “Final Configurations.213.13.X.208.X 128.6 S1 S0 195.63.211.15.X.213.250.1 AS 400 S4608 200.X 192.0 0.1 S0 203.2 S0/0 192.250.252 ! router ospf 10 network 203.1 255.200.2 Router E Loopback interface 0: 200.63.0.1 255.213.10.1 S1 192.X.2 AS 300 128.208. see the section.250.250.X S0 192.211.255.255 area 0 Using the Border Gateway Protocol for Interdomain Routing 12-51 .14.41 Router A Router B S0 128.208.213.255.250.10.X.200.255. For the complete configurations.1 AS 500 195.10.255.13.250.2 Loopback interface 0: IBGP 203. The following configurations for the routers shown in Figure 12-34 run OSPF as the IGP and run IBGP between Routers A and B inside AS 100.211.63.174 S1 195.0.63.5 128.63.5 S0/1 192.0 ! interface ethernet 0 ip address 203.X.10.10.213.250.14.130 Loopback interface 0: Router C Router D 192.X 203.14.10.10.0 ! interface serial 0 ip address 128.213. !Router A hostname RouterA ! interface loopback 0 ip address 203.208.10.

6 255.Practical Design Example router bgp 100 network 203.255.0.63.192 ! interface serial 2/0 ip address 128.255.255.252 ! interface serial 2/1 ip address 128.255.5 255.255.250.13.0 neighbor 192.130 255.213.208.250.0 0.255.1 remote-as 500 neighbor 192.63.0 neighbor 192.208.208.255.10.63.252 ! router ospf 10 network 203.250.213.213.10.208.10.15.41 remote-as 100 !Router C hostname RouterC ! interface loopback 0 ip address 128.2 update-source loopback 0 !Router B hostname RouterB ! interface serial 0 ip address 203.213.5 255.63.255.2 remote-as 200 neighbor 203.208.255.1 255.6 remote-as 100 !Router E hostname RouterE ! interface loopback 0 ip address 200.208.255.192 ! interface serial 0/0 ip address 192.255.10.0 12-52 Internetworking Case Studies .255.252 ! router bgp 200 network 128.250.255.250.15.14.250.213.6 remote-as 400 !Router D hostname RouterD ! interface loopback 0 ip address 192.252 ! router bgp 300 network 192.0 mask 255.2 255.200.213.255.0 neighbor 128.255 area 0 ! router bgp 100 network 203.10.0 neighbor 128.255.255.255.252 ! interface serial 0/0 ip address 192.10.0.1 remote-as 100 neighbor 128.5 255.208.255.10.0 mask 255.63.10.5 remote-as 300 neighbor 203.255.2 remote-as 100 neighbor 203.2 255.250.0.15.0 network 203.208.250.15.10.252 ! interface serial 1 ip address 192.255.255.63.255.174 255.13.255.213.

as shown in the examples in this section.255.211.0 128.0 0.incomplete Network Next Hop Metric LocPrf Weight Path *i128.10.0 128.255.63.0 128.10.0.208.200.213.internal Origin codes: i .211.255.252 ! router bgp 400 network 200. local router ID is 203.63.255.255.250.250.2 100 0 200 400 500 i *i200.10.255.255.1 255.255.255.2 100 0 200 400 i *>i203.0 203. This method also avoids route flaps.211.10. i . e .252 ! interface serial 1 ip address 195.0 203. it is always better to advertise routes by using the network router configuration command or by redistributing static routes.213.10.14.250.10.2 255.0.10.255.255.0 ! interface serial 1 ip address 203.IGP.213.252 ! router bgp 500 network 195.213.255.6 255.250. h history.208.13.0 128.2 Status codes: s suppressed.0 neighbor 192.0 0.5 remote-as 200 neighbor 195.10.250.211.EGP.10. The following information is displayed when you enter the show ip bgp EXEC command on Router B: RouterB# show ip bgp table version is 4. Practical Design Example interface serial 0 ip address 195.192 ! interface serial 0 ip address 192.252 ! interface serial 1 ip address 128.211.15.13.10.211.14.2 255. you need to control the routes that are injected into BGP.10.250.252 ! router ospf 10 network 203.1 255.213.255.250.0 neighbor 128.0. ? .200.41 0 100 0 i *> 203.174 255.2 0 100 0 200 i *i192.1 255.255 area 0 !Router G hostname RouterG ! interface loopback 0 ip address 195.0 0 32768 i Using the Border Gateway Protocol for Interdomain Routing 12-53 .63.2 remote-as 300 neighbor 195.15. For that reason.213.0.255.63.250.213.2 remote-as 400 When you redistribute IGP routes into BGP.15.41 0 100 0 i *>i203.0.208.250. Determining the State of BGP Assume that in Figure 12-34 the connection between Routers B and D is down.63.13.255.63.2 100 0 200 400 500 300 i *i195. d damped. > best.1 remote-as 500 !Router F hostname RouterF ! interface ethernet 0 ip address 203.211.10. * valid.

Router B has not learned about 128.0 0.IGRP.255.63.213.255.14.255.0.0 0.0.0.EIGRP.0 via OSPF.EGP i . Following is the contents of the IP routing table on Router B: RouterB# show ip route Codes: C .1. run OSPF on interface serial 0 and make it passive.IS-IS level-2.0 has a next hop of 0.1 255. Note that any locally generated entry. • On Router A.2.15.213.IS-IS level-1. One problem is that the next hop for these entries (128.250.255. Router B will know how to reach the next hop 128. IA . E2 .13.255 is subnetted.63.213.EIGRP external.250.0. Serial0 O 203. OSPF). B .0 [110/74] via 203.OSPF external type 2. 02:40:46.213.255. This way.250.RIP.0 255.15.2.250. EX .14.0. R .63.13.255. This is because there is no way to reach that next hop via the IGP (in this case.41 [110/75] via 203. which is the EBGP next hop carried into IBGP.IS-IS.250.1 255. The > symbol indicates that BGP has chosen the best route based on the decision steps described in the section “Summary of the BGP Path Selection Process. The first entry reads as follows: Network 128.63. The letter i at the end of a line indicates that the path information comes from an IGP. O .255.13.candidate default Gateway of last resort not set 203. E .250.15.” earlier in this chapter.250. * .2.1.0 ! interface serial 0 ip address 128.213.252 ! router ospf 10 passive-interface serial 0 network 203.255.OSPF external type 1.0 ! interface ethernet 0 ip address 203.255.0 12-54 Internetworking Case Studies .63.0 is learned via path 200 and has a next hop of 128. Serial0 Note than none of the BGP entries appears in the IP routing table.255.255.0 255.0. use the neighbor next-hop-self router configuration command to change the next hop between Router A and Router B. Note the next hop attribute of 128.255.255. Serial0 203.213.OSPF inter area E1 .250.63. Correcting Next Hop Problems For the network shown in Figure 12-34.255 area 0 ! router bgp 100 network 203. I .0.15. BGP picks only the one route that it determines to be the best route.15. S . L2 .255.Practical Design Example The letter i at the beginning of a line means that the entry was learned via an internal BGP peer.252 is subnetted.BGP D .OSPF.0 mask 255.250. L1 .connected. 1 subnets C 203.255 area 0 network 128.0 is directly connected. The following configuration for Router A runs OSPF on interface serial 0 and makes it passive: !Router A hostname RouterA ! interface loopback 0 ip address 203.250.250.41 255. such as 203.mobile.213.250.2) is unreachable.13. 1 subnets O 203.213. the next hop problem can be corrected in one of two ways: • On Router A.static. It installs this route in the IP routing table and advertises it to other BGP peers.0. M . 02:50:45.

OSPF.63.250.13.250.OSPF external type 2.2 remote-as 100 neighbor 203.250. 1 subnets O 203. B . L2 .213.2 100 0 200 400 500 300 i *>i195.250.connected.0 255. 00:04:46.250.static. > best.0.250. E2 .211. Serial0 128.0 128. R .213. 00:04:46. IA .255.63.2 0 100 0 200 i *>i192.1.IS-IS level-1. ? .13.EIGRP external.EGP i .28.IGRP. I . S . O .incomplete Network Next Hop Metric LocPrf Weight Path *>i128.0 because BGP routes are not redistributed into OSPF yet.OSPF inter area E1 .0.0 is now reachable via OSPF.63. so it does not put the entries in the IP routing table.252 is subnetted.BGP D .211. Practical Design Example network 203.63.213.14.0.15.200.213.0 0 32768 i Note that a > symbol appears in all of the entries.0 [110/138] via 203.41 [110/75] via 203.candidate default Gateway of last resort not set 203. L1 .0 neighbor 128.213.internal Origin codes: i .255 is subnetted.0 255. Router F is not aware of networks 192. * .2 100 0 200 400 i *>i203.41 0 100 0i *> 203.63.0 0.15.0 [110/74] via 203.250.250. Serial0 203.EIGRP. The only difference is that 128. local router ID is 203.0 128.255.mobile.0 255.213.IS-IS level-2.10.41 0 100 0i *>i203.208.255.14. Serial 0 Note that the BGP entries still do not appear in the IP routing table. i .15.EGP.0 mask 255.2 update-source loopback 0 Now the BGP neighbor table on Router B contains the following routes: RouterB# show ip bgp table version is 10. Serial0 O 203.63.15. which means that BGP is satisfied with the next hop address.63.10.250.13.1.14.2 remote-as 200 neighbor 203.10.0 128.0 128.13.252 is subnetted.250.0 is directly connected.0 203.OSPF external type 1. d damped.250.255.2 Status codes: s suppressed.250.255.0 203. h history.255. Now the IP routing table on Router B contains the following routes: RouterB# show ip route Codes: C .15.1.255. The problem is synchronization: BGP is not synchronized with the IGP.15.255.0. Using the Border Gateway Protocol for Interdomain Routing 12-55 .213.250. 1 subnets O 1. EX . * valid.RIP.0 or 195.15.10.15.250. 00:04:47.13. and it does not send the entries in BGP updates.213.250.250. e .250.2 100 0 200 400 500 i *>i200. M .IS-IS.IGP.10.208.213. 1 subnets C 203. E .15.

250.0 [110/74] via 203.255.EIGRP.2. 00:01:07 B 192.14.250. 00:01:07 203. EthernetO 128.13. 00:12:37.250.15.static.EIGRP.250.BGP D .41 [110/11] via 203. Serial0 B 203.IS-IS. M .0 is directly connected. they will be dropped.250.EIGRP external.IS-IS.0.0 is variably subnetted. Redistributing OSPF The following configuration for Router A has been modified to redistribute OSPF (the new command is in bold): !Router A hostname RouterA ! interface loopback 0 ip address 203.255. Serial0 O 203.0 [200/0] via 128.0 [200/0] via 128.IS-IS level-2.63. Serial0 128.250.255 [110/75] via 203.15. 1 subnets O 128.213.255.15. L2 .BGP D . 2 masks B 128.15.EGP i .252 is subnetted.0 255.213.13.EIGRP external. 00:14:15. 2 masks O 203.0. 00:01:08 O 128.mobile.63. S . M . I . R .250.RIP.candidate default Gateway of last resort not set B 200. Seriall C 203.213.255.IGRP.0.250.63.0 255.255. * . E2 .0 [110/74] via 203. B . L1 .RIP.0 [200/0] via 128.250.14.41 255. EthernetO 203.0 12-56 Internetworking Case Studies .static.0 is directly connected.connected.OSPF.255.2.0 255.15. I .mobile.255. 2 subnets.0 [200/0] via 128.41 255.1.Practical Design Example Turning Off Synchronization If you enter the no synchronization router configuration command on Router B and then examine the IP routing table on Router B. IA . S .255 is subnetted.255. 00:14:15.255.IS-IS level-2.255.13.IS-IS level-1. L1 .41.250.15.63.0 [200/0] via 203.IGRP.0 255.candidate default Gateway of last resort is not set 203.1. but there is no way to reach those networks because Router F in the middle does not know how to reach them. B .OSPF inter area E1 .10.OSPF inter area E1 .213.connected. R .10.208.252 [110/138] via 203.1. E .250.0 255. 00:12:37.250.2.OSPF external type 1. IA .13.EGP i .255. 00:12:37.0. OSPF still needs to be redistributed into BGP on Router A so that Router F learns about BGP routes.0 is variably subnetted.213.OSPF external type 1.213. 2 subnets.250.250.2.211. O .63. 00:01:08 203. EX .252 is subnetted. you see the following contents of the IP routing table on Router B: RouterB# show ip route Codes: C . 1 subnets O 203.255.1.0 255 255.252 is subnetted.200.OSPF.213.250.255. O . Serial0 The routing table looks fine. EX .255.213.13. * . EthernetO If packets to the BGP network are forwarded to Router F.13. L2 .0 is directly connected.255. 1 subnets C 203. E2 .15.OSPF external type 2. as shown by the following output of the show ip route EXEC command on Router F: RouterF# show ip route Codes: C .13.10. E .63.OSPF external type 2.255.IS-IS level-1. 00:01:07 B 195.213.14.0 255.250. so turning off synchronization does not resolve this particular problem. 1 subnets C 203.250.250 14 1.

OSPF external type 1.255.2 remote-as 200 neighbor 203.0.5 via an IGP.OSPF. 00:00:16.250. synchronization should also be turned off on Router B so that it can advertise network 203.255 area 0 network 128.0 255.IGRP.213.250.15.41 255.13.250.250.0 255.250.0 mask 255. Serial0 O E2 203.255.8 is directly connected.255. * .0.255.15.213.EGP i .255.15.250.15.255.10.OSPF external type 2.250.15.0.250.1.0.1 255.15. IA . L1 .255 [110/75] via 203. 2 subnets.14. Serial0 128. Serial0 O E2 192.0 0.0.213. This step is required because Router A will not synchronize with OSPF because of mask differences.candidate default Gateway of last resort not set O E2 200. Serial0 203.63.252 ! router ospf 10 redistribute bgp 100 metric 2000 subnets passive-interface serial 0 network 203.15.250.250.250.0.213.255. 00:00:l5.250.0.0 [110/2000] via 203.0 neighbor 128.15. 00:00:14. 00:00:14.15.255.10.0 [110/2000] via 203.14. In addition.255.1.0 is variably subnetted.0.BGP D .250.63. R . S .250. EX .255. 2 masks O E2 128.0 255.255.0.255.213. B .connected.252 [110/138] via 203.250. Turning off synchronization on Router A will cause Router A to advertise network 203. I .1 255.13. OSPF should be enabled on interface serial 1 on Router B and made passive so that Router A learns about next hop 192. O .1.mobile.0 [110/2000] via 203.250.Serial0 O 128. Using the Border Gateway Protocol for Interdomain Routing 12-57 . Serial0 O 203.0 [110/74] via 203.250. 2 masks O 203.0 is variably subnetted. Serial0 O E2 195.IS-IS level-1.0.EIGRP.0 0.255.208.0.63.208.15.15.0 [110/2000] via 203. For the same reason.255. 00:00:14.250. Serial0 The BGP entries have disappeared because OSPF has a better distance (110) than IBGP (200). 2 subnets. E2 .10. 00:00:15.OSPF inter area E1 .RIP.250.10.255.1. 00:00:15.255 area 0 ! router bgp 100 network 203.15.2 update-source loopback 0 Now the routing table looks as follows: RouterB# show ip route Codes: C . 00:00:15.250.1. E .IS-IS.15.250.255.0 is directly connected.13. Serial0 203.0 ! interface serial 0 ip address 128. M .static.IS-IS level-2.213.0 [110/2000] via 203.211. L2 . Loopbackl C 203.2 remote-as 100 neighbor 203. Practical Design Example interface ethernet 0 ip address 203.1.200.1.1.EIGRP external.13. 2 subnets C 203.0 255.15.250.252 is subnetted.

10.0.) !Router A hostname RouterA ! interface loopback 0 ip address 203.63.255.208.255.213.14.63.250.208.5 0 100 0 300 i *>i195.255.0 192.0 192.Practical Design Example The modified configurations for Routers A and B are as follows. > best.2 0 100 0 i 12-58 Internetworking Case Studies .208.250.208.255.250.255.255.0 0 32768 i *>i203.13. d damped.250.255.0.0.10. * valid.41 Status codes: s suppressed.10.255 area 0 ! router bgp 100 network 203. i .208.0.213.0.0 neighbor 128.5 remote-as 300 neighbor 203.0 203.208.13.0.255.250.0.0.incomplete Network Next Hop Metric LocPrf Weight Path *> 128.255.15.1 255.250.0 0 32768 i *> 203.10.250.2 0 200 400 500 i *> 203.255.255.2 remote-as 100 neighbor 203.255 area 0 network 128.2 remote-as 200 neighbor 203.0.15.2 0 100 0 200 i *>i192.0. ? .250.10.internal Origin codes: i .13.0.250.EGP.0 ! interface serial 0 ip address 128.6 255.2 255.250.250.252 ! interface serial 1 ip address 192.213.0.0 network 203.255.IGP.250.0 0.10.0 0.255 area 0 network 192.0 0.15.15.250.0 mask 255.0 ! interface ethernet 0 ip address 203.0 0.250.213.213. local router ID is 203.15.250.14.13.0 0. h history. e .213. (New commands are in bold.63.0 128.1 255.5 100 0 300 500 i * 128.41 remote-as 100 Now bring up interface serial 1 on Router B and see what the BGP neighbor table looks like on Router A: RouterA# show ip bgp table version is 117.15.63.252 ! router ospf 10 redistribute bgp 100 metric 2000 subnets passive-interface serial 0 network 203.255.252 ! router ospf 10 redistribute bgp 100 metric 1000 subnets passive-interface serial 1 network 203.211.0.0 mask 255.2 update-source loopback 0 !Router B hostname RouterB ! interface serial 0 ip address 203.255 area 0 ! router bgp 100 no synchronization network 203.250.255.14.0 neighbor 192.255.255.41 255.13.0 0.255.255.

213.15.63. IA . e .213.208.0 128. ? .0. 00:41:26 C 128.255 [110/75] via 203.0 203. 2 subnets.41 0 100 0i *> 203.10 255.250.IS-IS level-2. 2 subnets.255.5 0 0 300 i *> 195.EGP. the networks are reachable via both of the ISPs and either Router A or B could be used to reach them.2 0 100 0 200 i * 192.13.250.0 255.0 is variably subnetted.OSPF.2. Using the Border Gateway Protocol for Interdomain Routing 12-59 .10 4 255.200.2.208.10.IS-IS level-1.0 128.0 255.255.255.250.13. M .0.14.252 [110/74] via 203.250.0 is variably subnetted.15.0.0 [200/0] via 203.213.5 0 300 500 400 i *>i203.15.0 0 32768 i Managing Asymmetry There are several ways to design the network for AS 100 to communicate with the ISP networks in AS 200 and AS 300.0.255.EGP i .213.2 Status codes: s suppressed.14. 2 masks O E2 192. E . Practical Design Example Following is the output of the show ip route EXEC command on Router A: RouterA# show ip route Codes: C .incomplete Network Next Hop Metric LocPrf Weight Path *>i128.250.250.0 255.2.14. L2 .10.IGP.0 [20/0] via 128. * .OSPF inter area E1 .0 is variably subnetted. Loopback0 203.208.250. AS 100 could learn partial routes from one of the ISPs and default routes to both ISPs. 00:41:25.0 is directly connected.255.2. Ethernet0 128. One way is to have a primary ISP and a backup ISP. E2 .13. 00:41:25 C 203.250.255.10.10. 00:41:25.208.OSPF external type 2.255. Ethernet0 C 203.static. 00:41:25.255.255. This might occur if networks are advertised to both of the ISPs.15.0.EIGRP. > best.OSPF external type 1.IS-IS.250.IGRP. 2 masks B 128.250. B . 3 masks O 203.13. Serial0 B* 200.connected. Ethernet0 O 203. O . d damped. In this example.0 255.208.250.213.63.14. h history.255.0.208.213. Potential asymmetry might occur if traffic going out from Router A comes back via Router B.10. From outside the AS.EIGRP external.255.250.0 [20/0] via 128.213.candidate default Gateway of last resort not set 192.208. Both Routers A and B generate default routes into OSPF.0. S .10. local router ID is 203.14. 3 subnets. i .15.5 0 300 500 i *>i200.250.250. 00:41:25.213.15. Ethernet0 O 192.0 is directly connected.63.211.252 is directly connected. EX .250. * valid.10. L1 .BGP D . R .0 192.0 203. with Router B being the more preferred route because of its lower MED attribute.2.0 0.0.255.255. You might find out that all incoming traffic to your AS is coming via one single point even though you have multiple points to the internetwork.10.RIP. AS 100 receives partial routes from AS 200 and only local routes from AS 300.10. This allows you to balance outgoing traffic between the two ISPs.0 192.2 100 0 200 400 i *> 192.2.2.208.14.63.255.41 0 100 0i *>i203.0 [110/1000] via 203.63.5 0 300 500 400 200 i *> 195. I .0 255.internal Origin codes: i .15.mobile.0 255.250.252 [110/138] via 203. 00:02:38 Following is the output of the show ip bgp EXEC command on Router B: RouterB# show ip bgp table version is 12. Ethernet0 B 203.200.250.

250.Practical Design Example One other potential reason for asymmetry is the different advertised path length to reach your AS. weight. One ISP might be closer to a certain destination than another.0 ! route-map setlocalpref permit 10 set local-preference 200 The final configuration for Router A sets the local preference for routes coming from AS 200 to 200.255. The ip default-information originate router configuration command is used to inject the default route inside the OSPF domain.14.0. you can redistribute a static route for 0.255.255 area 0 default-information originate metric 2000 ! router bgp 100 no synchronization neighbor 128.0.0 0.255. The configuration also uses the ip default-network global configuration command to specify network 200.0 as the candidate default route. (New or modified commands are in bold.2 remote-as 200 neighbor 128.0.15.255.1 255. But. For IGRP and Enhanced IGRP. (New or modified commands are in bold.2 route-map setlocalpref in neighbor 203.255.0 into the IGP domain. You might try to affect that decision by using the set as-path route map configuration command with the prepend keyword to prepend AS numbers to your updates to make the AS_path attribute longer.2 update-source loopback 0 ! ip default-network 200. Also.63.213.63.250.200.255.2 remote-as 100 neighbor 203.255.252 ! router ospf 10 redistribute bgp 100 metric 2000 subnets passive-interface serial 0 network 203.1 255. For RIP. network 0.) !Router A hostname RouterA ! interface loopback 0 ip address 203.200. traffic from AS 400 destined for AS 100 always comes in via Router A because of the shorter path.0. with IGRP and Enhanced IGRP.0.) !Router B hostname RouterB ! interface serial 0 ip address 203.255. In this example.255.63. Following is the final configuration for Router B.213.0.250.250. Final Configurations Following is the final configuration for Router A.0.255.0 is automatically redistributed into RIP without additional configuration. there is nothing you can do.0 ! interface ethernet 0 ip address 203.0. MED attribute.0 0.41 255. default information is injected into the IGP domain after BGP is redistributed.250.0 ! interface serial 0 ip address 128.15.255 area 0 network 128.13.0.15.252 ! interface serial 1 12-60 Internetworking Case Studies .250.2 255. if AS 400 has somehow set its exit point to be via AS 200 based on attributes such as local preference.213.0.213.

15.IGP.28.0 0.213.255. 500 to 300. The following is the output of the show ip bgp EXEC command for regular expression ^300$: RouterB# show bgp regexp ^300$ BGP table version is 14.0 neighbor 192.5 255.213. which is lower than the local preference of 200 coming in from Router A.213.250.10. (New and modified commands are in bold.5 0 300 0 300 Following is the final configuration for Router C. > best.10.255. If you want to advertise the local routes and the neighbor routes (customers of the ISP). Any other routes on Router B (if there are any) will be sent internally with a local preference of 100.63.63. This way. AS 100 will pick Router B for AS 500’s local routes.41 remote-as 100 ! ip default-network 192.10.) !Router C hostname RouterC ! interface loopback 0 ip address 128.255.10.130 255. which is higher than the IBGP updates coming in from Router A in AS 100.255 area 0 default-information originate metric 1000 ! router bgp 100 no synchronization network 203.5 route-map LOCALONLY in neighbor 203.0.255.208.255.0.0 192.0 ip as-path access-list 1 permit ^300 500$ ip as-path access-list 2 permit ^300$ ! route-map LOCALONLY permit 10 match as-path 1 set local-preference 300 ! route-map LOCALONLY permit 20 match as-path 2 The configuration for Router B sets the local preference for updates coming from AS 300 having an AS_path attribute of 300.incomplete Network Next Hop Metric LocPrf Weight Path *> 192.208.208. ? . e .255 area 0 network 192.252 router ospf 10 redistribute bgp 100 metric 1000 subnets passive-interface serial 1 network 203.250.252 ! router bgp 200 network 128.internal Origin codes: i .250. This arrangement causes Router A to be preferred.255. Router B is used to reach routes local to AS 300.0.0.2 Status code: s suppressed. you can use ^300_[0-9]* as the regular expression. because of the length of the AS_path attribute.EGP.63. d damped.255.10.213.15.13. h history.10. Any updates whose AS_path attribute does not match are dropped.208. i . * valid. Note that Router B accepts the local routes of AS 300 and AS 500 only.252 ! interface serial 2/1 ip address 128. Further.5 remote-as 300 neighbor 192.6 255.2 255.192 ! interface serial 2/0 ip address 128.208.0 0. Practical Design Example ip address 192.0 Using the Border Gateway Protocol for Interdomain Routing 12-61 .0.250.255. local router ID is 203.255.208.255.

192 ! interface serial 0/0 ip address 192.15.1 255.255.10.63.10.208. you have to filter routes coming into AS 100 on Router A.255 area 0 12-62 Internetworking Case Studies .252 ! router bgp 300 network 192. Following are the final configurations for Routers F and G.255.255.6 remote-as 400 ! access-list 1 deny 195. Following are the final configurations for Routers D and E.213.255.1 remote-as 500 neighbor 192.5 remote-as 200 neighbor 195.208.10.0/16.200.250.Practical Design Example aggregate-address 128.208.5 255.250.250.1 distribute-list 1 out neighbor 128.213.0.0.213.0 255.1 remote-as 100 neighbor 128.10.255.255.6 255.0 ! interface serial 1 ip address 203.0 neighbor 192. (New or modified commands are in bold.213.213.255.14.10.0 0.211.10.255.10.255.0 interface serial 0 ip address 195.0 255.255.0/16 and specifies the routes that are to be injected into AS 100.255.0.0 0.211.252 ! router bgp 400 network 200.200.63.255.0.255.255.63.10.211.10.255 access-list 1 permit any The configuration for Router C aggregates network 128.0.1 remote-as 500 Router E is aggregating network 200. If the ISP refuses to do this task.2 255.2 255.252 ! interface serial 0/1 ip address 192.174 255.0 summary-only neighbor 128.255.63.) !Router F hostname RouterF ! interface ethernet 0 ip address 203.0 aggregate-address 200.208.255.0. (New or modified commands are in bold.2 255.208.63.255.) !Router D hostname RouterD ! interface loopback 0 ip address 192.0.10.208.1 255.0.252 ! interface serial 1 ip address 128.0.255.200.6 remote-as 100 !Router E hostname RouterE ! interface loopback 0 ip address 200.255.0.213.213.252 ! router ospf 10 network 203.255.200.0 summary-only neighbor 128.

208.250.252 ! interface serial 1 ip address 195.10.174 255.0 0.213.EGP.0. local router ID is 203.2 remote-as 300 neighbor 192.255.208.14.0.15.10.0/16 128.255. Router D will not export that route to Router B.213.incomplete Network Next Hop Metric LocPrf Weight Path *> 128.1 255.252 ! router bgp 500 network 195.211.0 203.0.0.208.0 0 32768 i *>i203.211.0.255.208.63.211.0 192.213. i .0.0.0.250.13.2 200 0 200 400 i *> 203. d damped.2 0 200 0 200 i *>i192.255 ! route-map setcommunity permit 10 match ip address 101 set community no-export ! route-map setcommunity permit 20 match ip address 2 The configuration for Router G demonstrates the use of community filtering by adding the no-export community to more specific Class C routes of 195.255.255.192 ! interface serial 0 ip address 192.250.200.5 0 300 0 300 i *> 200.255.10.211.208.0.IGP.211.250.15.10.0 0. > best.0 aggregate-address 195.0/16 that are sent to Router D.255.0 255.63.2 remote-as 400 ! access-list 2 permit any access-list 101 permit ip 195.10.0.10.208.255 255.250. ? .1 255.255.13.0 summary-only neighbor 192.10.10.211. Practical Design Example !Router G hostname RouterG ! interface loopback 0 ip address 195.10.255.10.0 0.0. * valid.2 send-community neighbor 192.211.0 0.0. e . Following is the final content of BGP routing table on Router A: RouterA# show ip bgp table version is 21. h history.41 Status codes: s suppressed.2 0 100 0 i Using the Border Gateway Protocol for Interdomain Routing 12-63 .0.internal Origin codes: i .0 0 32768 i *> 203.2 route-map setcommunity out neighbor 195.0 128.255. This way.

15. 2 subnets.0.250.1. S .255. EX . 00:41:25 C 203.0 [20/0] via 128. E2 .0.0 is variably subnetted. Ethernet0 O 203. Ethernet0 O E2 200.14.208.255. 00:41:25.0 255. R . M . 2 masks O 203.255.250. Serial1 Note that on Router F. 00:03:47. 00:41:25.255. the default advertised by Router A will kick in with a MED attribute of 2000.255 [110/65] via 203. 01:12:09.0 255.IS-IS level-2.15.0. 2 masks O E2 192. If something happens to the connection between Router B and Router D. E .14.213.255.250.255.0 [110/1000] via 203.250.14.2.0 is directly connected. * .14.candidate default Gateway of last resort is 203. 2 subnets.208. 2 subnets.250.2.0. such as 192. Serial1 203. S .14.255.0. Loopback0 203.10.0 are to be reached via Router B.IS-IS.0 255. 2 masks O E2 128.0 is variably subnetted.208.10.0 0.connected.15. 3 masks O 203.4 255.0. L2 . 3 subnets.208.213.0 [110/1000] via 203.0.0 are to be reached via Router A. 01:12:09.250. I .10.2.0 [110/2000] via 203.250. such as 200.EIGRP.0.15. 00:02:38 Following is the final content of IP routing table on Router F: RouterF# show ip route Codes: C .255.connected.1.250.2.213.OSPF inter area E1 .13.250. 2 subnets. Ethernet0 B 203.2 to network 200.2.63.15. 00:45:01.63. Ethernet0 C 203.213.250.0 [200/0] via 203.252 [110/138] via 203. the routing table indicates that networks local to AS 300.15.OSPF external type 1.2 to network 0.250. R .208.0 255.10 255.2.250.0. E2 .0 255. Serial0 B* 200.255.0.0.255.252 [110/74] via 203. IA .10 255.0 is variably subnetted.10. Ethernet0 203.15.200.1. L2 .255.250.255.200.213.IS-IS.0.15. 00:03:33.EIGRP external.0 [110/1000] via 203.EGP i .63. IA .208.0.0 255.255.255 [110/11] via 203.0.250. Serial1 C 203.0 255.255.1.0.10.OSPF.250.250.EGP i .252 [110/128] via 203.255.15.255.0 is variably subnetted.0.OSPF inter area E1 .RIP.13. Ethernet0 O E2 203. The gateway of last resort is set to Router B.255.BGP D . 2 masks B 128. 00:48:50.OSPF external type 2.250. 00:41:26 C 128. * .RIP. M . L1 . 12-64 Internetworking Case Studies .BGP D . 2 subnets.OSPF external type 1.0 is variably subnetted.IS-IS level-2.0 is variably subnetted.0 is variably subnetted.0 192. Ethernet0 O 192. L1 .255 [110/75] via 203.0 [20/0] via 128.mobile.EIGRP.0 [110/1000] via 203. EX .14.2.250.14.2. 00:41:25.0 255. 01:12:09.10.255.200.static. Ethernet0 128. 2 masks O 203.IGRP. I .mobile.0 255.2.213.41 255. Ethernet0 O*E2 0.250.10.255.208.2.250.250. 01:12:09.15.4 255. B .15. Other known networks.213.IGRP.0 [110/2000] via 203.14.0 255.2. E .213. 00:41:25.255.250. Ethernet0 128.13.255. Serial1 O 192. 2 masks O E2 192.static.250.IS-IS level-1.252 is directly connected.14. 2 subnets.63.255.255.OSPF.14. O .0 is directly connected.15.0 192. O .13.EIGRP external.0 255.250.250. B .255.0.IS-IS level-1.255.255.255.candidate default Gateway of last resort is 128.0.0 is directly connected.0.250.Practical Design Example Following is the final content of the IP routing table on Router A: RouterA# show ip route Codes: C .OSPF external type 2.200.

213.14.41 0 100 0i *>i203.15. i . R .255 [110/65] via 203.IS-IS level-1. 01:15:40. * valid.OSPF external type 1.0 0.13.213.250.0 192.IGP.250.200.255.255.10 Status codes: s suppressed. local router ID is 203.static.EIGRP.208. such as route.15. S .incomplete Network Next Hop Metric LocPrf Weight Path *>i128.208.208. M .2 0 200 0 200 i *> 192. Serial1 203.15.13.213. B .255 [110/75] via 203.0 203. ? . * .14.5 0 300 0 300 i *>i200.15. e . L1 .13. and route reflectors.255.0.15.0 is variably subnetted.41 0 100 0i *> 203.OSPF external type 2.10.connected. 00:50:46 C 192. Ethernet0 128. h history. Serial0 O 203.250.0 is variably subnetted.255.2 200 0 200 400 i *>i203. 01:20:33.14.5. 2 masks O 203.0 is directly connected.213. Loopback1 C 203.208. E .EGP.0 255.250.10.250.0 [110/2000] via 203.0 128.250.250.15.250.BGP D .IGRP.255.0 255. IA .10 255.0.10.250.IS-IS.0.0.0.250. Serial0 Summary The primary function of a BGP system is to exchange network reachability information with other BGP systems.0 255. > best. 2 masks B* 192.RIP.OSPF.mobile.15. 2 subnets.0 * 192.10. Serial0 128.0 is variably subnetted. 2 masks O E2 128.10.0/16 128. 2 subnets. BGP provides a number of techniques for controlling the flow of BGP updates.10. I .255.250. E2 . Serial0 203.IS-IS level-2.250.0 [110/2000] via 203. BGP is a powerful tool for providing loop-free interdomain routing within and between ASs.250.15. It also provides techniques for consolidating routing information. 00:46:55.252 is subnetted.10.255.255. confederations. Summary Following is the final content of BGP routing table on Router B: RouterB# show ip bgp table version is 14.250.250.41 255.2 to network 192. 01:12:09.250.0 255.OSPF inter area E1 .255. EX .252 is directly connected. 2 subnets.0 is directly connected.13.1.15. such as CIDR aggregation. Serial1 C 203.255.13. and community filtering.0.213. path.15.208. 2 subnets.255.internal Origin codes: i . 2 subnets C 203.0 [110/74] via 203.0 255.208. This information is used to construct a graph of AS connectivity from which routing loops are pruned and with which AS-level policy decisions are enforced. O . Using the Border Gateway Protocol for Interdomain Routing 12-65 .1.0 0 32768 i Following is the final content of the IP routing table on Router B: RouterF# show ip route Codes: C .255.0 [20/0] via 192.250. 2 masks O 203.8 id directly connected. 01:20:33.15. d damped. Serial0 O E2 203.0.63.EGP i .1. L2 .255.15.250.63.208.0.0.255.250.213.250.13.0 203.EIGRP external.250.candidate default Gateway of last resort is 203.4 255.1.2.0 is variably subnetted.

Summary 12-66 Internetworking Case Studies .