BGP实验
BGP配置
R1
#
bgp 1
router-id 1.1.1.1
peer 12.1.1.2 as-number 2
#
R2
#
bgp 2
router-id 2.2.2.2
peer 3.3.3.3 as-number 2
peer 3.3.3.3 connect-interface LoopBack0
peer 4.4.4.4 as-number 2
peer 4.4.4.4 connect-interface LoopBack0
peer 12.1.1.1 as-number 1
#
R3
#
bgp 2
router-id 3.3.3.3
peer 2.2.2.2 as-number 2
peer 2.2.2.2 connect-interface LoopBack0
peer 4.4.4.4 as-number 2
peer 4.4.4.4 connect-interface LoopBack0
#
R4
#
bgp 2
router-id 4.4.4.4
peer 2.2.2.2 as-number 2
peer 2.2.2.2 connect-interface LoopBack0
peer 3.3.3.3 as-number 2
peer 3.3.3.3 connect-interface LoopBack0
peer 5.5.5.5 as-number 3
peer 5.5.5.5 ebgp-max-hop 2
peer 5.5.5.5 connect-interface LoopBack0
#
R5
#
bgp 3
router-id 5.5.5.5
peer 4.4.4.4 as-number 2
peer 4.4.4.4 ebgp-max-hop 2
peer 4.4.4.4 connect-interface LoopBack0
#
## 宣告BGP表
R1
[R1-bgp]network 1.1.1.0 24
显示优且可用,表示该条目本地可以加路由表还可以传给本地的BGP邻居
IBGP水平分割 但是AS-BY-AS 一条条目在AS内部传递其属性不变,所以给R2说一声,把路由给R3的时候下一跳改成自己
[R2]bgp 2
[R2-bgp]peer 3.3.3.3 next-hop-local
显示优且可用,所以3可以加表了
R4也一样,所以R2跟R4建邻居
R2
[R2-bgp]peer 4.4.4.4 as-number 2
R2-bgp]peer 4.4.4.4 connect-interface LoopBack 0
[R2-bgp]peer 4.4.4.4 next-hop-local
R4
[R4]bgp 2
[R4-bgp]peer 2.2.2.2 as-number 2
[R4-bgp]peer 2.2.2.2 connect-interface LoopBack 0
测试