HCIP-BGP基础实验

编写实验报告:
1、拓扑信息
2、要求及分析
3、配置截图
4、测试

1、拓扑信息

2、要求及分析

1.通过使用BGP来实现所有设备的环回都能ping通

2.完成所有路由器的IGP配置
3.使用直连接口建立EBGP对等体关系
4.使用环回接口建立IBGP对等体关系
5.使用connect-interface命令修改IBGP的源IP地址
6.使用next-hop-local命令修改路由传递的下一跳属性
7.如果存在使用环回接口建立EBGP对等体,需要使用ebgp-max-hop命令修改TTL数值(选)

 3、配置截图

AS200内部依靠OSPF互通
R2配置

[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]area 0
[r2-ospf-1-area-0.0.0.0]network 23.0.0.2 0.0.0.0
[r2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0

R3配置

[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]area 0 
[r3-ospf-1-area-0.0.0.0]network 23.0.0.3 0.0.0.0
[r3-ospf-1-area-0.0.0.0]network 34.0.0.3 0.0.0.0
[r3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0

R4配置

[r4]ospf 1 router-id 4.4.4.4
[r4-ospf-1]area 0
[r4-ospf-1-area-0.0.0.0]network 34.0.0.4 0.0.0.0
[r4-ospf-1-area-0.0.0.0]network 4.4.4.4 0.0.0.0

BGP建立邻居关系
R1配置

[r1]bgp 100
[r1-bgp]router-id 1.1.1.1
[r1-bgp]peer 12.0.0.2 as-number 200

R2配置

[r2]bgp 200
[r2-bgp]router-id 2.2.2.2
[r2-bgp]peer 12.0.0.1 as-number 100

IBGP建邻

IBGP邻居要求使用环回口建立,根据IBGP邻居建立条件,需要修改IBGP邻居更新源为对应环回接口

[r2-bgp]peer 3.3.3.3 as-number 200
[r2-bgp]peer 3.3.3.3 connect-interface l 0

BGP防环,构建全互联的IBGP对等体关系

[r2-bgp]peer 4.4.4.4 as-number 200
[r2-bgp]peer 4.4.4.4 connect-interface l 0

在给3.3.3.3/4.4.4.4传递路由信息时,将下一跳属性修改为本地(一般配置在边界路由器上)

[r2-bgp]peer 3.3.3.3 next-hop-local
[r2-bgp]peer 4.4.4.4 next-hop-local

R3配置

[r3]bgp 200
[r3-bgp]router-id 3.3.3.3
[r3-bgp]peer 2.2.2.2 as-number 200
[r3-bgp]peer 2.2.2.2 connect-interface l 0
[r3-bgp]peer 4.4.4.4 as-number 200
[r3-bgp]peer 4.4.4.4 connect-interface l 0

R4配置

[r4]bgp 200
[r4-bgp]router-id 4.4.4.4
[r4-bgp]peer 2.2.2.2 as-number 200
[r4-bgp]peer 2.2.2.2 connect-interface l 0
[r4-bgp]peer 3.3.3.3 as-number 200
[r4-bgp]peer 3.3.3.3 connect-interface l 0
[r4-bgp]peer 5.5.5.5 as-number 300
[r4-bgp]peer 5.5.5.5 connect-interface l 0

在给3.3.3.3/2.2.2.2传递路由信息时,将下一跳属性修改为本地(一般配置在边界路由器上)

[r4-bgp]peer 3.3.3.3 next-hop-local
[r4-bgp]peer 2.2.2.2 next-hop-local

此时R4与R5没有学习对方的路由,需要写一条静态

[r4]ip route-static 5.5.5.5 32 45.0.0.5

修改TTL=2,如果不加参数,则修改为255

[r4]bgp 200
[r4-bgp]peer 5.5.5.5 ebgp-max-hop 2

R5配置

此时R4与R5没有学习对方的路由,需要写一条静态

[r5]ip route-static 4.4.4.4 32 45.0.0.4

[r5]bgp 300
[r5-bgp]router-id 5.5.5.5
[r5-bgp]peer 4.4.4.4 as-number 200
[r5-bgp]peer 4.4.4.4 connect-interface l 0

修改TTL=2,如果不加参数,则修改为255

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

BGP的路由发布
R1配置

[r1]bgp 100
[r1-bgp]network 1.1.1.1 32

R2配置

[r2]bgp 200  
[r2-bgp]network 2.2.2.2 32

R3配置

[r3]bgp 200 
[r3-bgp]network 3.3.3.3 32

R4配置

[r4]bgp 200

[r4-bgp]network 4.4.4.4 32

R5配置

[r5]bgp 300
[r5-bgp]network 10.1.1.1 24

通过重发布的方式发布路由
R2配置

[r2]bgp 200

[r2-bgp]import-route ospf 1

4、测试

  • 6
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值