




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、BGP Case StudiesDocument ID: 26634Introduction PrerequisitesRequirements Components Used ConventionsBGP Case Studies 1How Does BGP Work? eBGP and iBGP Enable BGP Routing Form BGP NeighborsBGP and Loopback Interfaces eBGP MultihopeBGP Multihop (Load Balancing)Route Mapsmatch and set Configuration Com
2、mands network CommandRedistributionStatic Routes and Redistribution iBGPThe BGP Decision AlgorithmBGP Case Studies 2 AS_PATH Attribute Origin AttributeBGP Next Hop Attribute BGP Backdoor SynchronizationWeight AttributeLocal Preference Attribute Metric Attribute Community AttributeBGP Case Studies 3B
3、GP FilteringAS Regular ExpressionBGP Neighbors and Route MapsBGP Case Studies 4CIDR and Aggregate Addresses BGP ConfederationRoute Reflectors Route Flap DampeningHow BGP Selects a PathBGP Case Studies 5Practical Design ExampleRelated InformationIntroductionThis document contains five Border Gateway
4、Protocol (BGP) case studies.PrerequisitesRequirementsThere are no specific requirements for this document.Components UsedThis document is not restricted to specific software and hardware versions.ConventionsRefer to Cisco Technical Tips Conventions for more information on document conventions.BGP Ca
5、se Studies 1The BGP, which RFC 1771 defines, allows you to create loopfree interdomain routing between autonomous systems (ASs). An AS is a set of routers under a single technical administration. Routers in an AS can use multiple Interior Gateway Protocols (IGPs) to exchange routing information insi
6、de the AS. The routers can use an exterior gateway protocol to route packets outside the AS.How Does BGP Work?BGP uses TCP as the transport protocol, on port 179. Two BGP routers form a TCP connection between one another. These routers are peer routers. The peer routers exchange messages to open and
7、 confirm the connection parameters.BGP routers exchange network reachability information. This information is mainly an indication of the full paths that a route must take in order to reach the destination network. The paths are BGP AS numbers. This information helps in the construction of a graph o
8、f ASs that are loopfree. The graph also shows where to apply routing policies in order to enforce some restrictions on the routing behavior.Any two routers that form a TCP connection in order to exchange BGP routing information are peers or neighbors. BGP peers initially exchange the full BGP routin
9、g tables. After this exchange, the peers send incremental updates as the routing table changes. BGP keeps a version number of the BGP table. The version number is the same for all the BGP peers. The version number changes whenever BGP updates the table with routing information changes. The send of k
10、eepalive packets ensures that the connection between the BGP peers is alive. Notification packets go out in response to errors or special conditions.eBGP and iBGPIf an AS has multiple BGP speakers, the AS can serve as a transit service for other ASs. As the diagram in this section shows, AS200 is a
11、transit AS for AS100 and AS300.In order to send the information to external ASs, there must be an assurance of the reachability for networks. In order to assure network reachability, these processes take place: Internal BGP (iBGP) peering between routers inside an AS Redistribution of BGP informatio
12、n to IGPs that run in the ASWhen BGP runs between routers that belong to two different ASs, this is called exterior BGP (eBGP). When BGP runs between routers in the same AS, this is called iBGP.Enable BGP RoutingComplete these steps in order to enable and configure BGP.Assume that you want to have t
13、wo routers, RTA and RTB, talk via BGP. In the first example, RTA and RTB are in different ASs. In the second example, both routers belong to the same AS.1. Define the router process and the AS number to which the routers belong.Issue this command to enable BGP on a router:routerbgpautonomoussystemRT
14、A#routerbgp100RTB#routerbgp200These statements indicate that RTA runs BGP and belongs to AS100. RTB runs BGP and belongs to AS200.2. Define BGP neighbors.The BGP neighbor formation indicates the routers that attempt to talk via BGP. The section Form BGP Neighbors explains this process.Form BGP Neigh
15、borsTwo BGP routers become neighbors after the routers establish a TCP connection between each other. The TCP connection is essential in order for the two peer routers to start the exchange of routing updates.After the TCP connection is up, the routers send open messages in order to exchange values.
16、 The values that the routers exchange include the AS number, the BGP version that the routers run, the BGP router ID, and the keepalive hold time. After the confirmation and acceptance of these values, establishment of the neighbor connection occurs. Any state other than Established is an indication
17、 that the two routers did not become neighbors and that the routers cannot exchange BGP updates.Issue this neighbor command to establish a TCP connection:neighbor ipaddress remoteas numberThe number in the command is the AS number of the router to which you want to connect with BGP. Theipaddress is
18、the next hop address with direct connection for eBGP. For iBGP, ipaddress is any IP address on the other router.The two IP addresses that you use in the neighbor command of the peer routers must be able to reach one another. One way to verify reachability is an extended ping between the two IP addre
19、sses. The extended ping forces the pinging router to use as source the IP address that the neighbor command specifies. The router must use this address rather than the IP address of the interface from which the packet goes.If there are any BGP configuration changes, you must reset the neighbor conne
20、ction to allow the new parameters to take effect. clear ip bgp addressNote: The address is the neighbor address. clear ip bgp *This command clears all neighbor connections.By default, BGP sessions begin with the use of BGP version 4 and negotiate downward to earlier versions, if necessary. You can p
21、revent negotiations and force the BGP version that the routers use to communicate with a neighbor. Issue this command in router configuration mode:neighbor ip address | peergroupname versionvalueHere is an example of the neighbor command configuration:RTA#router bgp 100neighbor remoteas
22、200RTB#router bgp 200neighbor remoteas 100neighbor remoteas 200RTC#router bgp 200neighbor remoteas 200In this example, RTA and RTB run eBGP. RTB and RTC run iBGP. The remote AS number points to either an external or an internal AS, which indicates either eBGP or
23、 iBGP. Also, the eBGP peers have direct connection, but the iBGP peers do not have direct connection. iBGP routers do not need to have direct connection. But, there must be some IGP that runs and allows the two neighbors to reach one another.This section provides an example of the information that t
24、he show ip bgp neighbors command displays.Note: Pay special attention to the BGP state. Anything other than the state Established indicates that the peers are not up.Note: Also, notice these items: The BGP version, which is 4 The remote router IDThis number is the highest IP address on the router or
25、 the highest loopback interface, if existent. The table versionThe table version provides the state of the table. Any time that new information comes in, the table increases the version. A version that continues to increment indicates that there is some route flap that causes the continuous update o
26、f routes.# show ip bgp neighborsBGP neighbor is , remote AS 200, external link BGP version 4, remote router ID BGP state = Established, table version = 3, up for 0:10:59Last read 0:00:29, hold time is 180, keepalive interval is 60 seconds Minimum time between advertisement run
27、s is 30 secondsReceived 2828 messages, 0 notifications, 0 in queueSent 2826 messages, 0 notifications, 0 in queueConnections established 11; dropped 10BGP and Loopback InterfacesThe use of a loopback interface to define neighbors is common with iBGP, but is not common with eBGP. Normally, you use th
28、e loopback interface to make sure that the IP address of the neighbor stays up and is independent of hardware that functions properly. In the case of eBGP, peer routers frequently have direct connection, and loopback does not apply.If you use the IP address of a loopback interface in the neighbor co
29、mmand, you need some extra configuration on the neighbor router. The neighbor router needs to inform BGP of the use of a loopback interface rather than a physical interface to initiate the BGP neighbor TCP connection. In order to indicate a loopback interface, issue this command:neighbor ipaddress u
30、pdatesource interfaceThis example illustrates the use of this command:RTA#router bgp 100neighbor remoteas 100neighbor updatesource loopback 1RTB#router bgp 100neighbor remoteas 100In this example, RTA and RTB run iBGP inside AS100. In the neighbor command, RTB u
31、ses the loopback interface of RTA, . In this case, RTA must force BGP to use the loopback IP address as the source in the TCP neighbor connection. In order to force this action, RTA adds updatesource interfacetypeinterfacenumber so that the command is neighbor updatesource lo
32、opback 1. This statement forces BGP to use the IP address of the loopback interface when BGP talks to neighbor .Note: RTA has used the physical interface IP address of RTB, , as a neighbor. Use of this IP address is why RTB does not need any special configuration. Refer to Sa
33、mple Configuration for iBGP and eBGP With or Without a Loopback Address for a complete network scenario sample configuration.eBGP MultihopIn some cases, a Cisco router can run eBGP with a thirdparty router that does not allow direct connection of the two external peers. To achieve the connection, yo
34、u can use eBGP multihop. The eBGP multihop allows a neighbor connection between two external peers that do not have direct connection. The multihop is only for eBGP and not for iBGP. This example illustrates eBGP multihop:RTA#router bgp 100neighbor remoteas 300neighbor ebgp
35、multihopRTB#router bgp 300neighbor remoteas 100RTA indicates an external neighbor that does not have direct connection. RTA needs to indicate its use of the ebgpmultihop command. On the other hand, RTB indicates a neighbor that has direct connection, which is . Because of this
36、 direct connection, RTB does not need the ebgpmultihop command. You should also configure an IGP or static routing to allow the neighbors without connection to reach each other.The example in the eBGP Multihop (Load Balancing) section shows how to achieve load balancing with BGP in a case where you
37、have eBGP over parallel lines.eBGP Multihop (Load Balancing)RTA#int loopback 0ip address router bgp 100neighbor neighbor neighbor network remoteas 200 ebgpmultihop updatesource loopback0ip route ip route RTB#int loo
38、pback 0 ip address router bgp 200neighbor neighbor neighborremoteas 100 updatesource loopback ebgpmultihop0network ip route ip route This exa
39、mple illustrates the use of loopback interfaces, updatesource, and ebgpmultihop. The example is a workaround in order to achieve load balancing between two eBGP speakers over parallel serial lines. In normal situations, BGP picks one of the lines on which to send packets, and load balancing does not
40、 happen. With the introduction of loopback interfaces, the next hop for eBGP is the loopback interface. You use static routes, or an IGP, to introduce two equalcost paths to reach the destination. RTA has two choices to reach next hop : one path via and the other path via .
41、RTB has the same choices.Route MapsThere is heavy use of route maps with BGP. In the BGP context, the route map is a method to control and modify routing information. The control and modification of routing information occurs through the definition of conditions for route redistribution from one rou
42、ting protocol to another. Or the control of routing information can occur at injection in and out of BGP. The format of the route map follows:routemap maptag permit | deny | sequencenumberThe map tag is simply a name that you give to the route map. You can define multiple instances of the same route
43、 map, or the same name tag. The sequence number is simply an indication of the position that a new route map is to have in the list of route maps that you have already configured with the same name.In this example, there are two instances of the route map defined, with the name MYMAP. The first inst
44、ance has a sequence number of 10, and the second has a sequence number of 20. routemap MYMAP permit 10 (The first set of conditions goes here.) routemap MYMAP permit 20 (The second set of conditions goes here.)When you apply route map MYMAP to incoming or outgoing routes, the first set of conditions
45、 are applied via instance 10. If the first set of conditions is not met, you proceed to a higher instance of the route map.match and set Configuration CommandsEach route map consists of a list of match and set configuration commands. The match specifies a matchcriteria, and set specifies a set actio
46、n if the criteria that the match command enforces are met.For example, you can define a route map that checks outgoing updates. If there is a match for IP address , the metric for that update is set to 5. These commands illustrate the example:match ip address set metric 5Now, if the ma
47、tch criteria are met and you have a permit, there is a redistribution or control of the routes, as the set action specifies. You break out of the list.If the match criteria are met and you have a deny, there is no redistribution or control of the route. You break out of the list.If the match criteri
48、a are not met and you have a permit or deny, the next instance of the route map is checked. For example, instance 20 is checked. This nextinstance check continues until you either break out or finish all the instances of the route map. If you finish the list without a match, the route is not accepte
49、d nor forwarded.In Cisco IOS Software releases earlier than Cisco IOS Software Release 11.2, when you use route maps to filter BGP updates rather than redistribute between protocols, you cannot filter on the inbound when you use a match command on the IP address. A filter on the outbound is acceptab
50、le. Cisco IOS Software Release 11.2 and later releases do not have this restriction.The related commands for match are: match aspath match community match clns match interface match ip address match ip nexthop match ip routesource match metric match routetype match tagThe related commands for set ar
51、e: set aspath set clns set automatictag set community set interface set default interface set ip default nexthop set level set localpreference set metric set metrictype set nexthop set origin set tag set weightLook at some route map examples:Example 1Assume that RTA and RTB run Routing Information P
52、rotocol (RIP), and RTA and RTC run BGP. RTA gets updates via BGP and redistributes the updates to RIP. Suppose that RTA wants to redistribute to RTB routes about with a metric of 2 and all other routes with a metric of 5. In this case, you can use this configuration:RTA#router rip network
53、 network network passiveinterface Serial0redistribute bgp 100 routemap SETMETRICrouter bgp 100neighbor remoteasnetwork 300routemap SETMETRIC permit match ipaddress 1set metric 210routemap SETMETRIC permitset metric 520accesslist 1 permit
54、55In this example, if a route matches the IP address , the route has a metric of 2. Then, you break out of the route map list. If there is no match, you proceed down the route map list, which indicates setting everything else to metric 5.Note: Always ask the question What happens to routes
55、 that do not match any of the match statements? These routes drop, by default.Example 2Suppose that, in Example 1, you do not want AS100 to accept updates about . You cannot apply route maps on the inbound when you match with an IP address as the basis. Therefore, you must use an outbound
56、route map on RTC:RTC#router bgp 300network neighbor remoteas 100neighbor routemap STOPUPDATES outroutemap STOPUPDATES permit 10 match ip address 1accesslist 1 deny 55accesslist 1 permit 55Now that you feel more comfortable with how t
57、o start BGP and how to define a neighbor, look at how to start the exchange of network information.There are multiple ways to send network information with use of BGP. These sections go through the methods one by one: network Command Redistribution Static Routes and Redistributionnetwork CommandThe format of the network command is:network networknumber mask networkmaskThe network command controls the networks that originate from this box. This concept is different than the familiar configuration with Interior Gateway Routing Protocol (IGRP) and
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 牙膏批發(fā)企業(yè)數(shù)字化轉(zhuǎn)型與智慧升級(jí)戰(zhàn)略研究報(bào)告
- 道路汛期加固施工方案
- 地磅拆除施工方案
- 廚房排煙 施工方案
- 機(jī)械沖孔樁施工方案
- 2025年度物流配送中心信息化改造與技術(shù)支持合同
- 二零二五年度環(huán)保材料研發(fā)人員勞動(dòng)合同
- 二零二五年度農(nóng)機(jī)租賃與農(nóng)業(yè)廢棄物處理全產(chǎn)業(yè)鏈合作合同
- 2025年度鐵路貨運(yùn)代理運(yùn)輸勞務(wù)服務(wù)協(xié)議
- 二零二五年度房屋買賣違約責(zé)任補(bǔ)充協(xié)議
- 2025年遼寧現(xiàn)代服務(wù)職業(yè)技術(shù)學(xué)院單招職業(yè)技能測試題庫(含答案)
- 2025年服裝制版師(中級(jí))職業(yè)技能鑒定考試題(附答案)
- 高考模擬作文“中國游”“city不city”導(dǎo)寫及范文
- 福建省福州市2024-2025學(xué)年九年級(jí)上學(xué)期期末語文試題(解析版)
- 一年級(jí)下冊綜合實(shí)踐活動(dòng)教案2
- 九年級(jí)主題班會(huì)課件:遇見最好的自己(開學(xué)第一課)
- 2025版股權(quán)投資基金股份收購與退出機(jī)制協(xié)議3篇
- 【營銷方案】2025小紅書平臺(tái)營銷通案
- 2025年江西電力職業(yè)技術(shù)學(xué)院高職單招職業(yè)適應(yīng)性測試近5年??及鎱⒖碱}庫含答案解析
- 2025年棗莊科技職業(yè)學(xué)院高職單招語文2018-2024歷年參考題庫頻考點(diǎn)含答案解析
- 2025年吉安職業(yè)技術(shù)學(xué)院高職單招職業(yè)技能測試近5年常考版參考題庫含答案解析
評(píng)論
0/150
提交評(píng)論