BGPIBGPEBGP RTA RTE EBGP IBGP RTB RTD RTC
BGP两种邻居-IBGP和EBGP RTA RTE EBGP IBGP RTB RTD RTC 7
BGP同步 E 0: 10. 1. 1. 1/24 AS 100 AS 300 RTA S 0: 1. 1/24 RTF EBGP S 0: 1. 1. 1. 2/24 RTB IBGP S 1: 2. 1. 1. 2/24 S 0: 2. 1. 1. 1/24 RTC AS 200 9 RTD RTE
BGP协议的状态机 Connect-Retry timer expiry TCP connection fails Active Connect-Retry timer expiry Connect TCP connection fails Others TCP connection setup Others Start Open-sent Idle Error Correct OPEN packet received Error Open-confirm Keep. Alive timer expiry Established Keep. Alive packet received 19 Error 1. Keep. Alive timer expiry 2. Update received 3. Keep. Alive received
常见BGP路由属性 1、Origin 9、Originator-ID 2、AS-Path 10、Cluster-List 3、Next hop 11、Destination Pref (MCI) 4、MED 12、Advertiser (Baynet) 5、Local-Preference 13、Rcid-Path (Baynet) 6、Atomic-Aggregate 14、MP_Reach_NLRI 7、Aggregator 15、MP_Unreach_NLRI 8、Community 16、Extended_Communities 23
AS路径(AS-Path)属性 D(18. 0. 0. 0/8) AS 300 AS 200 RTA 30. 0. 0. 1 AS 400 D, dl 400 300 200 30. 0. 0. 2 RTB AS 100 AS 500 D, d 2 500 200 D, d 1 400 300 200 >D, d 2 500 25
下一跳(Next Hop)属性 RTA 可经下一跳 10. 0. 0. 2到达 18. 0. 0. 0/8 可经下一跳 10. 0. 0. 3到达 20. 0/8 可经下一跳 21. 0. 0. 1到达 19. 0. 0. 0/8 RTC 可经下一跳 10. 0. 0. 1到达 19. 0. 0. 0/8 可经下一跳 10. 0. 0. 3到达 20. 0/8 RTC RTA AS 100 10. 0. 0. 1 AS 200 EBGP 21. 0. 0. 2 18. 0. 0. 0/8 10. 0. 0. 2 IBGP 21. 0. 0. 1 10. 0. 0. 3 RTD 19. 0. 0. 0/8 RTB 可经下一跳 10. 0. 0. 2到达 18. 0. 0. 0/8 可经下一跳 10. 0. 0. 3到达 20. 0/8 26 20. 0/8
本地优先属性 AS 400 D (18. 0. 0. 0/8) RTF AS 200 RTD AS 300 30. 0. 0. 1 30. 0. 0. 2 20. 0. 0. 1 AS 100 RTB RTE 20. 0. 0. 2 RTC D,local-pref 2 200 D,local-pref 1 100 RTA 27 D,local-pref 1 100 >D,local-pref 2 200 RTA就会优先选择本地 优先级高的local-pref 2
MED(Multi-Exit-DISC)属性 AS 100 >D, metric 1 10 D, metric 2 20 RTA 30. 0. 0. 1 20. 0. 0. 1 RTA会选择metric值较小 的metric 1 D, metric 1 10 RTB 30. 0. 0. 2 20. 0. 0. 2 IBGP AS 200 28 D, metric 2 20 RTC D(18. 0. 0. 0/8)
BGP基本配置 l 启动BGP è l 配置BGP邻居 è l [Quidway] bgp as-number [Quidway-bgp]peer-address as-number BGP路由注入 è network ip-address [ mask ] è import-route protocol [ med ] 32
BGP基本配置举例 E 0: 10. 1. 1. 1/24 AS 100 AS 300 RTA S 0: 1. 1/24 RTF EBGP S 0: 1. 1. 1. 2/24 RTB IBGP S 1: 2. 1. 1. 2/24 S 0: 2. 1. 1. 1/24 RTC AS 200 33 RTD RTE
配置BGP参数 l 配置同伴的BGP版本号 è l 配置BGP定时器 è l [Quidway-bgp]peer-address version-number [Quidway-bgp]timers keepalive-interval holdtime-interval 配置同伴发送update报文的时间间隔 è [Quidway-bgp]peer-address route-update-interval seconds 34
配置BGP路由策略 l 配置对等体的前缀过滤器 è [Quidway-bgp]peer { group-name | peer-address } filter-policy acl-number { import | export } l 配置对等体的AS-Path过滤器 è [Quidway-bgp]peer-address acl aspath-list-number { import | export } l 配置对等体的路由映射 è peer-address route-policy-name { import | export } 35
路由过滤——基于ACL AS 300 RTA 30. 0. 0. 1 30. 0. 0. 2 RTB 19. 0. 0. 0/8 20. 0. 0. 2 18. 0. 0. 0/8 RTC 10. 0. 0. 1 RTD AS 100 20. 0. 0. 1 AS 200 18. 0. 0. 0/8 RTA: [Quidway] acl 1 [Quidway-acl-1] rule deny source 18. 0. 0. 0 0. 255 [Quidway-acl-1] rule permit source 0. 0 255 [RTA-bgp]peer 10. 0. 0. 1 filter-policy 1 export 36
路由过滤——基于AS-Path AS 300 RTA 30. 0. 0. 1 10. 0. 0. 2 20. 0. 0. 2 仅发送 本AS的 路由 RTC RTB 30. 0. 0. 2 仅接受从 AS 100 始发的 路由 10. 0. 0. 1 RTD AS 100 RTA: [RTA] ip as-path acl 1 permit ^$ [RTA-bgp] peer 10. 0. 0. 1 acl 1 export RTD: [RTD] ip as-path acl 1 permit b 100$ [RTD-bgp]peer 20. 0. 0. 2 acl 1 import 37 20. 0. 0. 1 AS 200
路由过滤-基于Route Policy 1. 1. 1. 2 RTC AS 100 1. 1 RTB 19. 0. 0. 0/8 OSPF RTA AS 200 不允许RTB向AS外通告路由 18. 0. 0. 0/8;且所有通告出去 的路由的metric值必须为 888 18. 0. 0. 0/8 [RTB-bgp] peer 1. 1. 1. 2 route-policy deny 18 export [RTB]route-policy deny 18 permit 10 [RTB-route-policy] if-match ip address 1 [RTB-route-policy] apply cost 888 [RTB]acl 1 [RTB-acl-1] rule deny source 18. 0. 0. 0 0. 255 [RTB-acl-1] rule permit source any 38
查看BGP信息 l 显示BGP路由信息 è Display bgp [Quidway-bgp]display bgp BGP local router ID is 1. 1 Status codes: s suppressed, d damped, h history, * valid, > best, i internal Origin codes: i - IGP, e - EGP, ? - incomplete Network *> 1. 1/32 *> 2. 2/32 *> 10. 0/24 * * 10. 0. 0. 1/32 *> 10. 0. 0. 2/32 Next Hop 0. 0 10. 0. 0. 2 0. 0 Metric Loc. Prf Path ? 100 ? ? 40
查看BGP信息 l 显示BGP路由信息 è [Quidway]display bgp summary Neighbor V AS Msg. Rcvd Msg. Sent Out. Q Up/Down State 160. 1. 48. 2 4 100 4 11 0 00: 03: 38 Established 150. 1. 8. 1 4 200 0 00: 09 Active 41
BGP调试命令 [RTA][undo] debugging bgp { all | event | { keepalive | open | packet | update } [ receive | send ] [ verbose ] } l all 表示所有的BGP调试开关 l event 表示BGP事件调试信息开关 l keepalive 表示Keepalive消息调试开关 l open 表示Open消息调试开关 l packet 表示所有BGP消息调试开关 l update 表示Update消息调试开关 42
BGP聚合——只通告聚合路由 AS 100 172. 16. 0. 0/24 172. 16. 1. 0/24 172. 16. 2. 0/24. . . 172. 16. 15. 0/24 RTA AS 200 172. 16. 0. 0/20 EBGP RTB 172. 16. 0. 0/20 [RTA-bgp] aggregate 172. 16. 0. 0 255. 240. 0 detail-suppressed 45
BGP聚合——通告聚合路由和具体路由 AS 100 RTA 172. 16. 0. 0/24 172. 16. 1. 0/24 172. 16. 2. 0/24. . . 172. 16. 15. 0/24 172. 16. 0. 0/20 EBGP RTB 172. 16. 0. 0/20 [RTA-bgp] aggregate 172. 16. 0. 0 255. 240. 0 [RTB-bgp] aggregate 172. 16. 0. 0 255. 240. 0 46 AS 200 172. 16. 0. 0/24 172. 16. 1. 0/24 172. 16. 2. 0/24. . . 172. 16. 15. 0/24 172. 16. 0. 0/20
BGP反射 路由反射器 AS 100 RTA 客户机 AS 100 IBGP RTE RTB 非客户机 RTC EBGP 47 群 RTD 非客户机
BGP联盟 AS 200 RTA RTG 30. 0. 0. 2 30. 0. 0. 1 20. 0. 0. 2 RTB 40. 0. 0. 1 AS 65050 RTD AS 65060 40. 0. 0. 2 RTF RTC RTE AS 100 48
BGP衰减 惩罚值 抑制门限 RTB 再使用 门限 AS 200 D(18. 0. 0. 0/8) 时间 RTA BGP路由衰减过程 AS 100 [RTA-bgp]dampening 15 15 500 1000 8000 49
BGP典型组网图 AS 500 RTE EBGP RIP RTG AS 400 OSPF EBGP AS 100 RTA IBGP 逻辑全连接 RTB EBGP RTC RTD EBGP RTF AS 200 AS 300 OSPF RTH 50 RIP
华为 3 Com技术有限公司 华为 3 Com公司网址: www. huawei-3 com. com 华为 3 Com技术论坛网址: forum. huawei-3 com. com 52
- Slides: 52