BGP实验

1.实验拓扑




2.关键技术
2.1 IBGP 的配置  #R2上配置 BGP
 [R2] bgp 64512
 [R2-bgp] router-id 10.0.2.2
 [R2-bgp] peer 10.0.3.3 as-number 64512
 [R2-bgp] peer 10.0.3.3 connect-interface LoopBack0
 [R2-bgp] peer 10.0.4.4 as-number 64512
 [R2-bgp] peer 10.0.4.4 connect-interface LoopBack0 

2.2 EBGP 的配置
 #配置 R1、R2 之间的 EBGP 对等体
 [R1] bgp 64513
 [R1-bgp] router-id 10.0.1.1
 [R1-bgp] peer 10.0.2.2 as-number 64512
 [R1-bgp] peer 10.0.2.2 ebgp-max-hop 2
 [R1-bgp] peer 10.0.2.2 connect-interface LoopBack0
 EBGP 连接允许的最大跳数为 1,这导致 EBGP 对等体之间只能使用直连链路建立EBGP 对等体关系,为使用环回口作为更新源需要手动修改 EBGP 连接允许的最大跳数。 

2.3 BGP 的邻居表
 检查:dis bgp peer 

2.4 BGP 路由下一条
 R3 上已经学习到 R1、R5 上发布的 BGP 路由,但是都是非有效路由,这是因为它们的下一跳在 R3 上都不可达,为此可以在 R2、R4 上通过 ext-hop-local 命合修改下一跳地址为 R2、R4 的更新源地址。
 #在 R2、R4 上将路由的下一跳地址修改为自身
 [R2]bgp 64512
 [R2-bgp] peer 10.0.3.3 next-hop-local
 [R2-bgp] peer 10.0.4.4 next-hop-local  

2.5 EBGP 多跳的配置
 [R1] bgp 64513
 [R1-bgp] router-id 10.0.1.1
 [R1-bgp] peer 10.0.2.2 as-number 64512
 [R1-bgp] peer 10.0.2.2 ebgp-max-hop 2
 [R1-bgp] peer 10.0.2.2 connect-interface LoopBack0
 EBGP 连接允许的最大跳数为 1,这导致 EBGP 对等体之间只能使用直连链路建立EBGP 对等体关系,为使用环回口作为更新源需要手动修改 EBGP 连接允许的最大跳数。