版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、BGP配置及其排错, 2003, Cisco Systems, Inc. All rights reserved.,1,BGP掌控着Internet上十多万条路由,之所以这么强悍是因为其深谙无为而治的道理,IGP的协议都有着非常复杂的路由算法(SPF/DUAL),看上去很美的算法反而束缚了这些协议的施展空间,BGP没有算法,有的是可以随心所欲控制的规则(属性) 可怜的IGP不仅要被人鄙视,还要被霸道的BGP利用,它们一方面要为BGP牵线搭桥建立邻居关系,另一方面他们辛苦学习来的路由还要遭受BGP随心所欲的玩弄(控制)。 相对于IGP而言,BGP协议的精髓在于对路由的控制,而不是学习路由。, 2
2、003, Cisco Systems, Inc. All rights reserved.,2,BGP何以如此强大?, 2003, Cisco Systems, Inc. All rights reserved.,3,BGP高度总结,邻居:用loopback接口创建(update-source loopback),保证邻居的可靠冗余 IBGP : 两个地址之间有路由即可 。有两大问题 同步问题 (只要规划合理,no synchronization) 水平分割问题 解决方案有三个 FULL-MESH IBGP (开销太高) Route Reflector (路由反射器) Route Confed
3、erence (路由联盟) EBGP:如果不直连,用静态路由提供IP连接并且修改TTL值(ebgp-multihop 255) 下一跳: 不需要直连,但必须通过IGP可达 默认情况,是指的到达下一个AS的最佳入口地址,当不可达时(Next-HoP-Self),控制数据包的出口路径(在inbound方向的路由上设置) Weight Local-Preference 控制数据包的入口路经(在outbound方向的路由上设置) As-Path prepend Med Community,策略控制,Access-List filter (最传统的控制方法,不灵活) Prefix-List filter
4、 (可以直接引用在Neighbor上, 也可以被distribute-list以及route-map调用) AS-path filter (可以被filter-list或者route-map调用) Community-list filter (可以被route-map调用) Distribute-List (只过滤不做属性控制) Route-Map(过滤,属性控制) 强烈推荐:对于IGP协议,用prefix-list定义路由,通过Distribute-List掉用进行路由过滤。对于BGP协议,用Prefix-List,As-Path List Community-list定义路由,再通过rou
5、te-map进行调用, 2003, Cisco Systems, Inc. All rights reserved.,5,汇总,Network x.x.x.x x.x.x.x (对IGP路由进行汇总宣告此路由必须在路由表中有一个精确匹配的路由) 属于虚假汇总,需要创建指向null 0的静态路由 Aggregate x.x.x.x x.x.x.x (summary-only) (as-set) 真正的汇总,汇总BGP表中的路由,具体路由可以通过summary-only抑制 as-set可以设置被汇总具体路由的AS编号,常见故障汇总,邻居不能建立(AS号码错误,地址不匹配,路由不可达,TTL问)
6、Bgp log-neighbor-change Show ip bgp neighbor x.x.x.x Show ip bgp summary 路由丢失 (next-hop无效,路由未同步,宣告的网络没有与之匹配的IGP路由,汇总时被抑制,做了错误的过滤) Show ip bgp (x.x.x.x) (longer) Show ip route (x.x.x.x)(longer) SHOW IP BGP NEIGHBOR X.X.X.X ADVERTISED-ROUTES SHOW IP BGP NEIGHBOT X.X.X.X RECEIVED-ROUTES SHOW IP BGP NEI
7、GHBOR X.X.X.X ROUTES(需要命令neighbor soft reconfiguration) DEBUG IP BGP DEBUG IP BGP X.X.X.X UPDATE DEBUG IP BGP EVENTS Clear ip bgp (soft in) Clear ip bgp (soft out),BGP基本概念/基本配置回顾BGP路由属性及其策略选路BGP汇总配置BGP过滤配置BGP故障排除,BGP Characteristics,BGP is a distance-vector protocol with the following enhancements:
8、Reliable updates: BGP runs on top of TCP (port 179) Incremental, triggered updates only Periodic keepalive messages to verify TCP connectivity Rich metrics (called path vectors or attributes) Designed to scale to huge internetworks (e.g., the Internet),BGP Characteristics (Cont.),Reliable Updates Us
9、e TCP as transport protocol No periodic updates Periodic keepalives to verify TCP connectivity Triggered updates are batched and rate-limited every 5 seconds for internal peer every 30 seconds for external peer 量太大,批量更新,BGP Databases,Neighbor table (必须双向手工创建) List of BGP neighbors Show ip bgp neighb
10、or (summary) BGP forwarding table/database(不是包含所有路径) List of all networks learned from each neighbor Can contain multiple(不是所有) pathways to destination networks Database contains BGP attributes for each pathway Show ip bgp IP routing table List of best paths to destination networks Show ip route,BGP
11、 Commands,router bgp autonomous-system,Router(config)#,This command, with no subcommands, does not activate BGP.(对BGP而言 Network命令不是必须的) Only one instance of BGP can be configured on the router at a single time. The autonomous system number identifies the autonomous system to which the router belongs
12、. The autonomous system number in this command is compared to the autonomous system numbers listed in neighbor statements to determine if the neighbor is an internal or external neighbor.,BGP neighbor Command,neighbor ip-address | peer-group-name remote-as autonomous-system,Router(config-router)#,Th
13、e neighbor command activates a BGP session with this neighbor. The term remote-as shows what AS this neighbor is in. This AS number is used to determine if the neighbor is internal or external. This command is used for both external and internal neighbors. The IP address specified is the destination
14、 address of BGP packets going to this neighbor. This router must have an IP pathway to reach this neighbor before it can set up a BGP relationship. (IGP对BGP的贡献之一提供TCP连接的路经),Example: BGP neighbor Command,BGP Issues with Source IP Address,When creating a BGP packet, the neighbor statement will be the
15、destination IP address and the outbound interface will be the source IP address.(有需要时可以通过Update-source修改) When a BGP packet is received for a new BGP session, the source address of the packet is compared to the list of neighbor statements. If a match is found, a relationship is established. If no ma
16、tch is found, the packet is ignored. Make sure the source IP address matches the address that the other router has in its neighbor statement.,BGP Neighbor Update Source Address,neighbor ip-address | peer-group-name update-source interface-type interface-number,Router(config-router)#,This command all
17、ows the BGP process to use the IP address of a specified interface as the source IP address of all BGP updates to that neighbor. A loopback interface is usually used, as it will be available as long as the router is operational. The IP address used in this command will be the destination IP address
18、of all BGP updates and should be the loopback interface of the other router. The update-source command is normally used only with IBGP neighbors. The address of an EBGP neighbor must be directly connected by default. The loopback of an EBGP neighbor is not directly connected.,Example: BGP Using Loop
19、back Addresses (保证邻居关系的可靠冗余),Example: ebgp-multihop Command(默认情况下,EBGP邻居必须建立在同一网段上),IBGP and Redistribution,A transit AS should run IBGP on all routers because the full Internet routing table is too large to redistribute into an IGP.(在internet上将BGP路由全部注入IGP将是一件非常恐怖的事情),IBGP Split Horizon Rule,By def
20、ault, routes learned via IBGP are never propagated to other IBGP peers.,Partial Mesh IGP,解决水平分割问题的三种机制 Full-Mesh IBGP Route Reflector Conferderence, 2003, Cisco Systems, Inc. All rights reserved.,21,Route Reflector Split-Horizon Rules,Classic BGP: IBGP routes are not propagated to other IBGP peers F
21、ull mesh of IBGP peers is therefore required,Route reflector can propagate IBGP routes to other IBGP peers. Full mesh of IBGP peers is no longer required,Splitting a Transit AS withBGP Confederations,Splitting a Transit AS withBGP Confederations,Splitting the AS into smaller autonomous systems would
22、 reduce the number of BGP sessions, but extra AS numbers are not available,Splitting the AS into smaller autonomous systems would reduce the number of BGP sessions, but extra AS numbers are not available,Splitting a Transit AS withBGP Confederations,Confederations enable internal AS numbers to be hi
23、dden and announce only one (external) AS number to EBGP neighbors,Splitting a Transit AS withBGP Confederations,Confederations enable internal AS numbers to be hidden and announce only one (external) AS number to EBGP neighbors,Splitting the AS into smaller autonomous systems would reduce the number
24、 of BGP sessions, but extra AS numbers are not available,Splitting a Transit AS withBGP Confederations,Confederations enable internal AS numbers to be hidden and announce only one (external) AS number to EBGP neighbors,Splitting the AS into smaller autonomous systems would reduce the number of BGP s
25、essions, but extra AS numbers are not available,Splitting a Transit AS withBGP Confederations,Confederations enable internal AS numbers to be hidden and announce only one (external) AS number to EBGP neighbors,Splitting the AS into smaller autonomous systems would reduce the number of BGP sessions,
26、but extra AS numbers are not available,AS-Path Propagation Within theBGP Confederation,IBGP session AS path is not changed Intraconfederation EBGP session Intraconfederation AS number is prepended to AS path EBGP session with external peer Intraconfederation AS numbers are removed from the AS path E
27、xternal AS number is prepended to the AS path,AS-Path Propagation Within theBGP Confederation (Cont.),AS-Path Processing inBGP Confederations,Intraconfederation AS path is encoded as a separate segment of the AS path Displayed in parentheses when you are using Cisco IOS show commands All routers wit
28、hin the BGP confederation have to support BGP confederations A router not supporting BGP confederations will reject AS path with unknown segment type,Intraconfederation EBGPSession Properties,Behaves like EBGP session during session establishment EBGP neighbor has to be directly connected, or you ha
29、ve to configure ebgp-multihop on the neighbor Behaves like IBGP session when propagating routing updates Local preference, MED and next-hop attributes are retained The whole confederation can run one IGP, giving optimal routing based on next-hop attribute in BGP routing table,Routing Issues without
30、Fully Meshed IBGP,Router C will drop the packet to network 10.0.0.0. Router C is not running IBGP; therefore, it has not learned about the route to network 10.0.0.0 from router B.(C会扔弃数据包,但F根本不知道C的情况,所以会不停的把数据包发往C,这就是著名的路由黑洞) In this example, router B and router E are not redistributing BGP into OSP
31、F.,BGP Synchronization,Synchronization rule: Do not use or advertise to an external neighbor a route learned by IBGP until a matching route has been learned from an IGP. Avoids black holes within the AS Safe to turn off if all routers in the AS are running full-mesh IBGP,no synchronization (同步规则是用来指
32、导和约束BGP规划和配置,以避免路由黑洞的发生,只要我们能确保黑洞不会发生,我们就可以关闭同步。类似于现实生活中的法律,如果我们遵纪守法,我们不用担心法律的制裁),Router(config-router)#,Disables BGP synchronization so that a router will advertise routes in BGP without learning them in IGP,BGP基本概念/基本配置回顾BGP路由属性及其策略选路BGP汇总配置BGP过滤配置BGP常见排错,BGP Path Attributes,BGP metrics are called
33、 path attributes BGP attributes are categorized as well-known and optional Well-known attributes must be recognized by all compliant implementations Optional attributes are only recognized by some implementations (could be private), expected not to be recognized by everyone,Well-Known BGP Attributes
34、,Well-known attributes are divided into mandatory and discretionary Mandatory well-known attributes must be present in all update messages Discretionary well-known attributes are optional, they could be present in update messages All well-known attributes are propagated to other neighbors,Well-Known
35、 BGP Attributes (Cont.),Mandatory Well-Known Attributes Origin Specifies the origin of a BGP route IGPRoute originated in an IGP EGP Route originated in EGP UnknownRoute was redistributed into BGP AS-path Sequence of AS numbers through which the network is accessible Next-hop IP address of the next-
36、hop router,Well-Known BGP Attributes (Cont.),Discretionary Well-Known Attributes Local preference Used for consistent routing policy within AS Atomic aggregate Informs the neighbor AS that the originating router aggregated routes,Optional BGP Attributes,Optional BGP attributes are transitive or nont
37、ransitive Transitive optional attributes Propagated to other neighbors if not recognized; partial bit set to indicate that the attribute was not recognized Nontransitive optional attributes Discarded if not recognized Recognized optional attributes are propagated to other neighbors based on their me
38、aning (not constrained by transitive bit),Optional BGP Attributes (Cont.),Nontransitive attributes Multi-Exit Discriminator Used to discriminate between multiple entry points to a single autonomous system Transitive attributes Aggregator Specifies IP address and AS number of the router that performe
39、d route aggregation Community(为路由打上标记,对BGP/MPLS VPN的路由隔离有着极为重大的贡献) Used for route tagging,AS-Path Attribute(BGP中用来避免环路的最有效机制),The AS-path attribute is empty when a local route is inserted in the BGP table The AS number of the sender is prepended to the AS-path attribute when the routing update cross
40、es AS boundary The receiver of BGP routing information can use the AS-path to determine through which AS the information has passed An AS that receives routing information with its own AS number in the AS-path silently ignores the information,AS-Path Attribute (Cont.),AS-Path Attribute (Cont.),AS-Pa
41、th Attribute (Cont.),Next-Hop Attribute(到达下一个AS的最佳入口IP地址),The IP address of the next AS to reach a given network: Router A advertises network 172.16.0.0 to router B in EBGP, with a next hop of 10.10.10.3 Router B advertises 172.16.0.0 in IBGP to router C, keeping 10.10.10.3 as the next-hop address T
42、he next-hop attribute is well-known, mandatory,and transitive.,Next-Hop Attribute (Cont.),Next-hop attribute is usually set to the IP address of the sending router,Next-hop processing,Next-Hop Attribute (Cont.),Next-hop processing,Next-hop attribute is usually set to the IP address of the sending ro
43、uter,Next-Hop Attribute (Cont.),If the receiving BGP router is in the same subnet as the current next-hop address, the next-hop address is not changed to optimize packet forwarding,Next-hop processing on shared media,Next-Hop Attribute (Cont.),Next-hop processing on shared media,If the receiving BGP
44、 router is in the same subnet as the current next-hop address, the next-hop address is not changed to optimize packet forwarding,Next-Hop Attribute (Cont.),BGP next-hop processing can break connectivity with improper networkdesigns over partially-meshed WAN networks,Next-hop processing on NBMA netwo
45、rk,Next-Hop Attribute (Cont.),BGP next-hop processing can break connectivity with improper networkdesigns over partially-meshed WAN networks,Next-hop processing on NBMA network,Example: next-hop-self Configuration,Origin Attribute(本地产生BGP路由的方式),IGP (i) network command EGP (e) Redistributed from EGP
46、Incomplete (?) Redistributed from IGP or static,The origin attribute informs all Autonomous Systems in the internetwork how the prefixes were introduced into BGP. The origin attribute is well-known, mandatory, and transitive.,Local Preference Attribute,The local preference attribute is well-known, d
47、iscretionary, and is passed only within the AS.,Paths with highest preference value are most desirable: Local preference is used to advertise to IBGP neighbors about how to leave their AS. The local preference is sent to IBGP neighbors only.,Multiexit Discriminator (MED) Attribute,The paths with the
48、 lowest MED (also called the metric) value are the most desirable: MED is used to advertise to EBGP neighbors how to exit their AS to reach networks owned by this AS. MED is sent to EBGP neighbors only. The MED attribute is optional and nontransitive.,Weight Attribute (Cisco-Only),Paths with highest
49、 weight value are most desirable. Weight not sent to any BGP neighbors,BGP Route Selection,The BGP forwarding table usually has multiple pathways from which to choose for each network. BGP is not designed to perform load balancing: Paths are chosen because of policy. Paths are not chosen based upon
50、bandwidth. The BGP selection process eliminates any multiple pathways through attrition until a single best pathway is left.(纵向:根据attribute逐步筛选找到最佳的BGP路由) That best pathway is submitted to the routing table manager process and evaluated against the methods of other routing protocols for reaching tha
51、t network (administrative distance).(和其他路由进行横向比较根据AD选出最佳路由送入路由表) The routing protocol with the lowest administrative distance will be installed in the routing table.,Building the BGP Table,所有从邻居接收到的路由都会被放入BGP表(被过滤的除外) 所有本地产生的路由也会被放入BGP表,BGP Route Selection Criteria (Cont.),Best routes to the destina
52、tion networks are selected from the BGP table(根据attribute逐步筛选出来),21.0.0.0 应该选择 3.4.5.6作为最佳路由,Route Selection Decision Process,Consider only (synchronized) routes with no AS loops and a valid next hop, and then: Prefer highest weight (local to router) (思科私有属性) Prefer highest local preference (global
53、within AS) Prefer route originated by the local router (next hop = 0.0.0.0) Prefer shortest AS path Prefer lowest origin code (IGP EGP incomplete) Prefer lowest MED (from other AS) Prefer EBGP path over IBGP path Prefer the path through the closest IGP neighbor Prefer oldest route for EBGP paths Pre
54、fer the path with the lowest neighbor BGP router ID,BGP Route Propagation,Best BGP routes are propagated to BGP neighbors(自己未必会使用它,此路由未必会进入到路由表),Building the IP Routing Table,Best BGP routes are copied into the IP routing table based on administrative distance,控制属性进行策略选路,Prefer highest weight (local
55、 to router) (思科私有属性) Prefer highest local preference (global within AS) Prefer shortest AS path Prefer lowest origin code (IGP EGP incomplete) Prefer lowest MED (from other AS) Prefer EBGP path over IBGP path 每个属性均会影响到BGP最佳路由的选择,但影响力度(优先级)是不一样的。,控制数据包的出口路径(在inbound方向的路由上设置) Weight Local-Preference 控
56、制数据包的入口路经(在outbound方向的路由上设置) As-Path prepend Med Community,控制属性进行策略选路 Weight, 2003, Cisco Systems, Inc. All rights reserved.,66,Configuring Per-Neighbor Weights,Routes received from primary ISP should be preferred over routes received from backup ISP,控制属性进行策略选路 Local-preference, 2003, Cisco Systems,
57、 Inc. All rights reserved.,68,Consistent Route SelectionWithin the AS (Cont.),Have the traffic run over the fastest line available,BGP Local Preference,You can use local preference to ensure AS-wide route selection policy Any BGP router can set local preference when processing incoming route updates
58、, when doing redistribution, or when sending outgoing route updates(送给IBGP邻居时) Local preference is used to select routes with equal weight Local preference is stripped in outgoing EBGP updates except in EBGP updates with confederation peers,BGP Local Preference (Cont.),Local preference is the second
59、 strongest BGP route selection parameter Remember the BGP route selection rules: Prefer highest weight (local to router) Prefer highest local preference (global within AS) Other BGP route-selection rules Weights configured on a router override local preference settings To ensure consistent AS-wide route selection: Do not change local preference within the AS(从IBGP邻居来的路由,此值不要改变) Do not use BGP weights,BGP is Designed to Implement Policy Routing,BGP is designed for manipulating routing pathways.,BGP Local Preference,bgp default local-preferen
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 冷库企业检修员装卸作业安全操作规程
- 苏教版小学一年级语文下册《小池塘》水景风光仿写教案
- 2026年主治医师之内科主治真题附答案
- 苏教版小学一年级语文下册《这儿真好》精读教学教案
- 用药护理安全管理
- 装修管理安全培训
- 天猫健康活动方案
- 安全管理专项方案
- 辽宁北票市2026年初级统计师资格考试(统计专业知识和实务)模拟题库及答案
- 监察法测试题库(50道附答案)
- 防暑防汛的培训课件
- 储能电站消防安全培训
- 内蒙古电力建设定额站2025年第二季度配电网设备材料编审指导价
- 2000年山东省青岛市中考数学试题【含答案解析】
- 全媒体运营师职业技能竞赛题(附答案)
- DB65╱T 3285-2011 防雷装置检测技术规范
- 车位抵账合同协议
- 医院临床医学带教老师培训
- 人教版八年级数学上册轴对称《最短路径问题》 教学课件
- 2022年CSCO软组织肉瘤诊疗指南
- 220kV变电站电气设备常规交接试验方案
评论
0/150
提交评论