基于eNSP的BGP小综合实验

目录

一、实验拓扑

二、实验需求

三、实验思路

四、实验配置

五、测试


一、实验拓扑

 

二、实验需求

 

三、实验思路

1、配置ip如图所示

2、搭建ospf,由于只有环回接口,导致路由器之间的路由会以32位主机路由传递,所以为解决这一问题,将用户网段的接口工作方式改为broadcast。配置静态路由。

3、建立邻居关系,有条件打破水平分割,路由反射器选择R3和R6作为RR反射器 R2和R5为客户端。建立联邦AS2划分为两个小的AS区域。将R2/3/4划分为AS64512,将R5/6/7划分为AS64513。

5、宣告ospf中可以直接先做空接口,然后再宣告空接口网段。R1和R8正常宣告用户网段。

四、实验配置

1、配置接口ip地址

 

 

 

 

 

 

 

 2、搭建ospf,环回接口1工作方式改为broadcast。配置静态路由。

[R2]ospf
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]net 172.16.0.0 0.0.255.255
[R2]int lo1
[R2-LoopBack1] ospf network-type broadcast

R3/4/5/6/7同理


[R1] ip route-static 172.16.224.1 255.255.255.255 12.1.1.2
R2/7/8同理

3、建立邻居关系,有条件打破水平分割,采用联邦和路由反射器。

[R1]bgp 1
[R1-bgp] router-id 10.1.1.1
[R1-bgp] peer 172.16.224.1 as-number 2 
[R1-bgp] peer 172.16.224.1 ebgp-max-hop 255 
[R1-bgp] peer 172.16.224.1 connect-interface LoopBack0
R8路由器同理


[R2]bgp 64512
[R2-bgp]  router-id 2.2.2.2
[R2-bgp]  confederation id 2
[R2-bgp]  confederation peer-as 64513  告知本地直连的其他小AS号
[R2-bgp]  peer 1.1.1.1 as-number 1 
[R2-bgp]  peer 1.1.1.1 ebgp-max-hop 255  
[R2-bgp]  peer 1.1.1.1 connect-interface LoopBack0
[R2-bgp]  peer 172.16.224.2 as-number 64512 
[R2-bgp]  peer 172.16.224.2 connect-interface LoopBack0
[R2-bgp]  peer 172.16.224.4 as-number 64513 
[R2-bgp]  peer 172.16.224.4 ebgp-max-hop 255  
[R2-bgp]  peer 172.16.224.4 connect-interface LoopBack0
[R2-bgp]  peer 172.16.224.2 next-hop-local 将下一跳改为本地
[R2-bgp]  peer 172.16.224.4 next-hop-local
R7路由器同理 


[R3]bgp 64512
[R3-bgp] router-id 3.3.3.3
[R3-bgp] confederation id 2
[R3-bgp] peer 172.16.224.1 as-number 64512 
[R3-bgp] peer 172.16.224.1 connect-interface LoopBack0
[R3-bgp] peer 172.16.224.3 as-number 64512 
[R3-bgp] peer 172.16.224.3 connect-interface LoopBack0
[R3-bgp] peer 172.16.224.1 reflect-client  将R2设为客户端,自己为RR反射器 
R6路由器同理

[R5]bgp 64513
[R5-bgp] router-id 5.5.5.5
[R5-bgp]  confederation id 2
[R5-bgp]  confederation peer-as 64512
[R5-bgp]  peer 172.16.224.1 as-number 64512
[R5-bgp]  peer 172.16.224.1 ebgp-max-hop 255  因为与R2为EBGP关系默认ttl为1所以要改ttl值
[R5-bgp]  peer 172.16.224.1 connect-interface LoopBack0
[R5-bgp]  peer 172.16.224.5 as-number 64513 
[R5-bgp]  peer 172.16.224.5 connect-interface LoopBack0
R3路由器同理

5、R2和R7中可以直接先做空接口,然后再宣告空接口网段。R1和R8正常宣告用户网段。

[R1-bgp] network 2.2.2.0 255.255.255.0 

[R8-bgp]  network 9.9.9.0 255.255.255.0 


[R2]ip route-static 172.16.0.0 255.255.0.0 NULL 0
[R2-bgp]  network 172.16.0.0 16
R7路由器同理

五、测试

1、查看ospf邻接关系表

 

2、查看BGP邻居表

 

 

 

 

3、查看BGP表

 

4、测试用户网段的互通

 

 

 

  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值