目录

       实验要求

       拓扑设计

       拓扑搭建

        配置

               底层

               路由

               策略

一、实验要求 

      1.R2—R7每台路由器均存在一个环回接口用于建立邻居,同时还存在一个环回代表连接用户的接口,最终这些连接用户的接口网络需要可以和R1/R8的环回通讯。

      2.AS2网段地址172.16.0.0/16,接着减少路由条目数量 

二:拓扑设计

   1.ip地址规划

      172.16.0.0/16

              172.16.0.0/18 ---64512

              172.16.64.0/18---64513

              172.16.128.0/18 ----64512~64513的中间

              172.16.192.0/18-----后期使用

  三、拓扑搭建

BGP实验HCIP

四.配置

1.ip地址

BGP实验HCIP

BGP实验HCIP

 

2.路由

 1)IBGP的路由  

R2

[r2]ospf  1  router-id   172.16.1.1

[r2-ospf-1]area  0

[r2-ospf-1-area-0.0.0.0]network   172.16.0.0 0.0.255.255

查看ospf邻居表:

BGP实验HCIP

2)建立BGP邻居

R1:

[R1]bgp 1

[R1-bgp]router-id   1.1.1.1

[R1-bgp]peer   12.1.1.2  as-number 2

R2:

[r2]bgp  64512

[r2-bgp]router-id  172.16.1.1

[r2-bgp]confederation  id   2

[r2-bgp]peer   12.1.1.1  as-number   1

[r2-bgp]peer    172.16.2.1 as-number   64512

[r2-bgp]peer   172.16.2.1   connect-interface   LoopBack  1

[r2-bgp]confederation   peer-as   64513

[r2-bgp]peer 172.16.64.1 as-number  64513

[r2-bgp]peer   172.16.64.1 connect-interface   LoopBack  1

[r2-bgp]peer   172.16.64.1  ebgp-max-hop  2

R3:

[r3]bgp  64512

[r3-bgp]router-id   172.16.2.1

[r3-bgp]confederation  id   2

[r3-bgp]peer    172.16.1.1 as-number  64512

[r3-bgp]peer  172.16.1.1  connect-interface   LoopBack  1

[r3-bgp]peer    172.16.3.1  as-number   64512

[r3-bgp]peer  172.16.3.1  connect-interface    LoopBack  1

R5:

[r5]bgp   64513

[r5-bgp]router-id 172.16.64.1

[r5-bgp]confederation  id    2

[r5-bgp]confederation  peer-as    64512

[r5-bgp]peer  172.16.1.1  connect-interface  LoopBack  1

[r5-bgp]peer   172.16.65.1  as-number  64513

[r5-bgp]peer   172.16.65.1  connect-interface   LoopBack  1

[r5-bgp]peer   172.16.1.1  ebgp-max-hop  2

 

R6:

[r6]bgp  64513

[r6-bgp]router-id 172.16.65.1

[r6-bgp]confederation  id   2

[r6-bgp]peer    172.16.64.1  as-number   64513

[r6-bgp]peer    172.16.64.1 connect-interface   LoopBack  1

[r6-bgp]peer  172.16.66.1  as-number  64513

[r6-bgp]peer   172.16.66.1  connect-interface   l  

[r6-bgp]peer   172.16.66.1  connect-interface   LoopBack

 1

R4:

[r4]bgp  64512

[r4-bgp]router-id 172.16.3.1 

[r4-bgp]confederation  id  2

[r4-bgp]confederation   peer-as   64513

[r4-bgp]peer  172.16.2.1  as-number 64512

[r4-bgp]peer  172.16.2.1  connect-interface  LoopBack  1

[r4-bgp]peer  172.16.66.1  as-number  64513

[r4-bgp]peer   172.16.66.1 connect-interface   LoopBack  1

 [r4-bgp]peer   172.16.66.1 ebgp-max-hop  2

R7:

[r7]bgp  64513

 [r7-bgp]router-id 172.16.66.1

 [r7-bgp]confederation  id    2

 [r7-bgp]confederation  peer-as    64512

 [r7-bgp]peer    172.16.3.1  as-number  64512

 [r7-bgp]peer   172.16.3.1  connect-interface   LoopBack  1

[r7-bgp]peer    172.16.65.1  as-number  64513

 [r7-bgp]peer   172.16.65.1  connect-interface   LoopBack  1

 [r7-bgp]peer   172.16.3.1   ebgp-max-hop  2

 [r7-bgp]peer  78.1.1.2 as-number  3

R8:

[r8]bgp 3

[r8-bgp]router-id   8.8.8.8

[r8-bgp]peer   78.1.1.1   as-number  2

查看BGP邻居表:

BGP实验HCIP

BGP实验HCIP

通过查看,所有EBGPIBGP邻居关系都已建立。

3)BGP宣告

 AS1的路由宣告

[R1]bgp 1

[R1-bgp]network   1.1.1.0 24

查看R1BGP 表:

BGP实验HCIP

查看R3的BGP 表:

BGP实验HCIP

由上表可以得知导致路由不传递,所以修改R2的下一跳为自己,让其BGP邻居可实现递归,同时由于IBGP水平分割,路由不传递,所以使用反射器打破水平分割.

R2:

[r2]BGP  64512

[r2-bgp]peer    172.16.2.1   next-hop-local

R3:

[r3]bgp  64512

[r3-bgp]peer   172.16.1.1   reflect-client 

查看R8的BGP路由表:

BGP实验HCIP

R5同样修改R2的下一跳为自己,但是R5不用做反射器,因为R2和R5是EBGP关系,又因为R7是EBGP,所以R6有两条1..10/24.分别来自两个方向。

BGP实验HCIP

 

[r8]bgp  3

 [r8-bgp]network 8.8.8.0 24

BGP实验HCIP

测试:

BGP实验HCIP

以上可以得出EBGP之间可以通。

4)IBGP路由宣告

[r2]ip route-static  172.16.0.0 16  NULL  0

[r2]bgp 64512

[r2-bgp]network  172.16.0.0  16

BGP实验HCIP

测试:

BGP实验HCIP

相关文章: