1 / 25

BGP 基础

BGP 基础. 日期:. 课程目标. 学习完本课程,您应该能够:. BGP 路由协议基本原理. n. 掌握. n. 熟练配置 BGP. 目录. BGP 基本原理. n. 配置 BGP. n. n. BGP 信息显示与调试. BGP 协议概述. BGP 是外部路由协议,用来在 AS 之间传递路由信息 是一种增强的距离矢量路由协议 可靠的路由更新机制 丰富的 Metric 度量方法 从设计上避免了环路的发生 为路由附带属性信息 支持 CIDR (无类别域间选路) 丰富的路由过滤和路由策略. BGP 基本概念. 什么是自治系统( AS )

efia
Download Presentation

BGP 基础

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. BGP基础 日期:

  2. 课程目标 学习完本课程,您应该能够: BGP路由协议基本原理 n 掌握 n 熟练配置BGP

  3. 目录 BGP基本原理 n 配置BGP n n BGP信息显示与调试

  4. BGP协议概述 BGP是外部路由协议,用来在AS之间传递路由信息 是一种增强的距离矢量路由协议 可靠的路由更新机制 丰富的Metric度量方法 从设计上避免了环路的发生 为路由附带属性信息 支持CIDR(无类别域间选路) 丰富的路由过滤和路由策略

  5. BGP基本概念 • 什么是自治系统(AS) • 为什么引入自治系统这一概念 • 自治系统内部的路由协议 • 自治系统之间的路由协议

  6. BGP两种邻居-------IBGP和EBGP AS100 AS300 RTA RTE EBGP EBGP AS200 IBGP RTD RTB RTC

  7. BGP路由通告原则 • 多条路径时,BGP Speaker只选最优的给自己使用 • BGP Speaker只把自己使用的路由通告给相邻体 • BGP Speaker从EBGP获得的路由会向它所有BGP相邻体通告(包括EBGP和IBGP) • 连接一建立,BGP Speaker将把自己所有BGP路由通告给新相邻体

  8. BGP路由属性 一般的,具体的实现按如下方式决定一条路由的Origin属性 某条路由是直接而具体的注入到BGP路由表中的,则origin属性为IGP 路由是通过EGP得到的,则origin属性为EGP 其他情形下,Origin属性都为 Incomplete 起源属性

  9. BGP路由属性 AS路径属性 D(18.0.0.0/8) AS300 AS200 RTA AS400 30.0.0.1 D,dl 400 300 200 30.0.0.2 RTB AS100 AS500 D,d2 500 200 D,d1 400 300 200 >D,d2 500 200

  10. BGP路由属性 下一跳属性 RTA 可经下一跳10.0.0.2到达18.0.0.0/8 可经下一跳10.0.0.3到达20.0.0.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.0.0/8 AS200 RTC RTA EBGP 10.0.0.1 18.0.0.0/8 AS100 21.0.0.2 10.0.0.2 IBGP IBGP 20.0.0.0/8 21.0.0.1 10.0.0.3 RTD 19.0.0.0/8 RTB RTB 可经下一跳10.0.0.2到达18.0.0.0/8 可经下一跳10.0.0.3到达20.0.0.0/8

  11. BGP路由属性 本地优先级属性 AS400 D (18.0.0.0/8) RTF AS200 AS300 RTD 30.0.0.1 20.0.0.1 RTE 30.0.0.2 20.0.0.2 AS100 RTB RTC D,local-pref2 200 D,local-pref1 100 D,local-pref1 100 >D,local-pref2 200 RTA就会优先选择本地 优先级高的local-pref2 RTA

  12. BGP路由属性 MED属性 AS100 >D,metric1 10 D,metric2 20 RTA 30.0.0.1 20.0.0.1 RTA会选择metric值较小 的metric1 D,metric2 20 D,metric1 10 30.0.0.2 20.0.0.2 RTB RTC IBGP D(18.0.0.0/8) AS200

  13. BGP反射器 路由反射器 AS100 AS100 RTA 客户机 IBGP IBGP RTE RTB 非客户机 客户机 RTC RTD EBGP EBGP 非客户机 cluster 在一个AS内,其中一台路由器作为路由反射器RR(Route Reflector),其它路由器作为客户机(Client)与路由反射器之间建立IBGP连接。路由反射器在客户机之间传递(反射)路由信息,而客户机之间不需要建立BGP连接。 既不是反射器也不是客户机的BGP路由器被称为非客户机(Non-Client)。非客户机与路由反射器之间,以及所有的非客户机之间仍然必须建立全连接关系 。

  14. BGP选路规则 综合起来,本地BGP路由选择的过程为: • 如果此路由的下一跳不可达,忽略此路由 • 选择本地优先级较大的路由 • 选择本地路由器始发的路由(本地优先级相同) • 选择AS路径较短的路由 • 依次选择起点类型为IGP,EGP,Incomplete类型的路由 • 选择MED较小的路由 • 选择RouterID较小的路由

  15. 目录 BGP基本原理 n 配置BGP n n BGP信息显示与调试

  16. 配置BGP RT0和RT1之间建立IBGP邻居 组网图如下: BGP AS 65430 G2/1/1 G2/1/1 Ospf AREA 0 RT0 RT1 G3/1/1 G3/1/1 静态路由 静态路由 G3/1/2 G3/1/2 RT2 RT3

  17. 配置BGP 具体配置步骤如下: 1.配置设备RT0 (1)配置与RT1相连接口的IP地址 [Sysname]interface GigabitEthernet 2/1/1 [Sysname-GigabitEthernet2/1/1]ip address 192.168.1.1 30 (2)配置与RT2相连接口的IP地址 [Sysname]interface GigabitEthernet 2/1/2 [Sysname-GigabitEthernet2/1/2]ip address 10.1.1.1 30 (3)配置环回口 [Sysname]interface LoopBack 0 [Sysname-LoopBack0]ip address 1.1.1.1 32

  18. 配置BGP (4)配置OSPF [Sysname]router id 1.1.1.1 [Sysname-ospf-1]area 0 [Sysname-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.3 [Sysname-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.0 (5)配置BGP [Sysname]bgp 65430 [Sysname-bgp] import-route static [Sysname-bgp]peer 2.2.2.2 as-number 65430 [Sysname-bgp]peer 2.2.2.2 connect-interface LoopBack0

  19. 配置BGP 2.配置设备RT1 (1)配置与RT0相连接口的IP地址 [Sysname]interface GigabitEthernet 2/1/2 [Sysname-GigabitEthernet2/1/2]ip address 192.168.1.2 30 (2)配置与RT3相连接口的IP地址 [Sysname]interface GigabitEthernet 2/1/2 [Sysname-GigabitEthernet2/1/2]ip address 20.1.1.1 30 (3)配置环回口 [Sysname]interface LoopBack 0 [Sysname-LoopBack0]ip address 2.2.2.2 32

  20. 配置BGP (4)配置OSPF [Sysname]router id 2.2.2.2 [Sysname-ospf-1]area 0 [Sysname-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.3 [Sysname-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0 (5)配置BGP [Sysname]bgp 65430 [Sysname-bgp] import-route static [Sysname-bgp]peer 1.1.1.1 as-number 65430 [Sysname-bgp]peer 1.1.1.1 connect-interface LoopBack0

  21. 配置BGP 2.配置设备RT2 (1)配置与RT0相连接口的IP地址 [Sysname]interface GigabitEthernet 3/1/1 [Sysname-GigabitEthernet3/1/1]ip address 10.1.1.2 30 (2)配置静态路由 [Sysname] ip route-static 0.0.0.0 0.0.0.0 10.1.1.1 3.配置设备RT3 (1)配置与RT1相连接口的IP地址 [Sysname]interface GigabitEthernet 3/1/1 [Sysname-GigabitEthernet3/1/1]ip address 20.1.1.2 30 (2)配置静态路由 [Sysname] ip route-static 0.0.0.0 0.0.0.0 20.1.1.1

  22. 目录 BGP基本原理 n 配置BGP n n BGP信息显示与调试

  23. 显示BGP邻居信息 该路由器的Router ID [H3C-bgp]display bgp peer BGP local router ID : 1.1.1.1 Local AS number : 65430 Total number of peers : 1 Peers in established state : 1 Peer V AS MsgRcvd MsgSent OutQ PrefRcv Up/Down State 2.2.2.2 4 65430 2 2 0 0 00:00:04 Established 邻居状态 邻居路由器的Router ID 域号

  24. BGP调试

  25. 本章总结 叙述BGP路由协议的原理 配置BGP路由协议 调试和维护BGP协议 处理大规模网络中BGP的应用

More Related