BGP综合实验

 实验要求:

1、AS1存在两个环回接口,一个地址为192.168.1.0/24该地址不能在任何协议中宣告。
AS3存在两个环回接口,一个地址为192.168.2.0/24该地址不能在任何协议中宣告,最终要求这两个环回接口可以互相通讯。
2、整个AS2的IP地址为172.16.0.0/16,请合理划分。
3、AS之间的骨干链路IP地址随意定制。
4、使用BGP协议让整个网络所有设备的环回接口可以互相访问。
5、减少路由条目数量,避免环路出现。                          

实验拓扑:

 实验步骤:

IP地址的配置
 启用OSPF协议
 发布路由
 破除IBGP之间的水平分割,配置路由反射器
 做空接口,宣告汇总
 建立GRE隧道,实现两个环回的连接
 

实验结果以及验证

目录

 实验步骤:

IP地址的配置

 启用OSPF协议

 发布路由

 破除IBGP之间的水平分割,配置路由反射器 做空接口,宣告汇总 建立GRE隧道,实现两个环回的连接 

实验结果以及验证

IP地址的查看 

BGP路由查看

 所有设备之间的互通 

R1与R8之间未宣告环回接口的通讯


IP地址的查看

[R1]int g 0/0/0
[R1-GigabitEthernet0/0/0]ip add 12.0.0.1 24
[R1-GigabitEthernet0/0/0]int l0
[R1-LoopBack0]ip add 192.168.1.1 24
[R1-LoopBack0]int l1
[R1-LoopBack1]ip add 10.0.0.1 24
[R1-LoopBack1]

[R2]int g 0/0/0
[R2-GigabitEthernet0/0/0]ip add 12.0.0.2 24
[R2-GigabitEthernet0/0/0]int l0
[R2-LoopBack0]ip add 172.16.2.1 24
[R2-LoopBack0]int g 0/0/1
[R2-GigabitEthernet0/0/1]ip add 172.16.1.1 29
[R2-GigabitEthernet0/0/1]
[R2-GigabitEthernet0/0/1]int g 0/0/2
[R2-GigabitEthernet0/0/2]ip add 172.16.1.9 29
[R2-GigabitEthernet0/0/2] 

[R3]int g 0/0/0
[R3-GigabitEthernet0/0/0]ip add 172.16.1.2 29
Jul 30 2023 21:36:41-08:00 R3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R3-GigabitEthernet0/0/0]int l0
[R3-LoopBack0]ip add 172.16.3.1 24
[R3-LoopBack0]int g 0/0/1
[R3-GigabitEthernet0/0/1]ip add 172.16.1.17 29
Jul 30 2023 21:37:20-08:00 R3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[R3-GigabitEthernet0/0/1] 

 [R4]int g 0/0/0
[R4-GigabitEthernet0/0/0]ip add 172.16.1.18 29
Jul 30 2023 21:38:40-08:00 R4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R4-GigabitEthernet0/0/0]int g 0/0/1
[R4-GigabitEthernet0/0/1]ip add 172.16.1.25 29
Jul 30 2023 21:38:59-08:00 R4 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[R4-GigabitEthernet0/0/1]int l0
[R4-LoopBack0]ip add 172.16.4.1 24

 [R5]int g 0/0/0
[R5-GigabitEthernet0/0/0]ip add 172.16.1.10 29
Jul 30 2023 21:39:50-08:00 R5 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R5-GigabitEthernet0/0/0]int g 0/0/1
[R5-GigabitEthernet0/0/1]ip add 172.16.1.133 29
[R5-GigabitEthernet0/0/1]
Jul 30 2023 21:40:07-08:00 R5 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[R5-GigabitEthernet0/0/1]int l0
[R5-LoopBack0]ip add 172.16.5.1 24

 [R6]int g 0/0/0
[R6-GigabitEthernet0/0/0]ip add 172.16.1.34 29
Jul 30 2023 21:40:56-08:00 R6 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R6-GigabitEthernet0/0/0]int l0
[R6-LoopBack0]ip add 172.16.6.1 24
[R6-LoopBack0]int g 0/0/1
[R6-GigabitEthernet0/0/1]ip add 172.16.1.41 29
Jul 30 2023 21:41:32-08:00 R6 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state.

 [R7]int g 0/0/0
[R7-GigabitEthernet0/0/0]ip add 172.16.1.42 29
Jul 30 2023 21:42:00-08:00 R7 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R7-GigabitEthernet0/0/0]int l0
[R7-LoopBack0]ip add 172.16.7.1 24
[R7-LoopBack0]int g 0/0/1
[R7-GigabitEthernet0/0/1]ip add 172.16.1.26 29
Jul 30 2023 21:42:37-08:00 R7 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[R7-GigabitEthernet0/0/1]int g 0/0/2
[R7-GigabitEthernet0/0/2]ip add 78.0.0.1 24
[R7-GigabitEthernet0/0/2]
Jul 30 2023 21:42:56-08:00 R7 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP 
on the interface GigabitEthernet0/0/2 has entered the UP state. 

 [Huawei]sysname R8
[R8]int g 0/0/0
[R8-GigabitEthernet0/0/0]ip add 78.0.0.2 24
Jul 30 2023 21:43:34-08:00 R8 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R8-GigabitEthernet0/0/0]int l0
[R8-LoopBack0]ip add 192.168.2.1 24
[R8-LoopBack0]int l1
[R8-LoopBack1]ip add 11.0.0.1 24
[R8-LoopBack1]

 启用OSPF协议

 [R2]os    
[R2]ospf 1 r    
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]a 0
[R2-ospf-1-area-0.0.0.0]ne    
[R2-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255

 [R3]os    
[R3]ospf 1 r    
[R3]ospf 1 router-id  3.3.3.3
[R3-ospf-1]a 0
[R3-ospf-1-area-0.0.0.0]net    
[R3-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255

[R4]ospf 1 r    
[R4]ospf 1 router-id 4.4.4.4
[R4-ospf-1]a 0
[R4-ospf-1-area-0.0.0.0]net 172.16.0.0 0.0.255.255
 

 [R5]os    
[R5]ospf 1 r    
[R5]ospf 1 router-id  5.5.5.5
[R5-ospf-1]a 0
[R5-ospf-1-area-0.0.0.0]net 172.16.0.0 0.0.255.255

 [R6]os 1 r    
[R6]os 1     
[R6]os     
[R6]ospf 1 r    
[R6]ospf 1 router-id 6.6.6.6
[R6-ospf-1]a 0
[R6-ospf-1-area-0.0.0.0]net 172.16.0.0 0.0.255.255

[R7]os    
[R7]ospf 1 r    
[R7]ospf 1 router-id 7.7.7.7
[R7-ospf-1]a 0
[R7-ospf-1-area-0.0.0.0]net 172.16.0.0 0.0.255.255 

 [R2-bgp]rou    
[R2-bgp]router-id 2.2.2.2
[R2-bgp]con    
[R2-bgp]confederation id 2
[R2-bgp]co    
[R2-bgp]con    
[R2-bgp]confederation pee    
[R2-bgp]confederation peer-as 64513
[R2-bgp]peer 12.0.0.1 as 1
[R2-bgp]pe    
[R2-bgp]peer 172.16.3.1 as 64512
[R2-bgp]pee    
[R2-bgp]peer 
Jul 30 2023 22:01:34-08:00 R2 %%01BGP/3/STATE_CHG_UPDOWN(l)[0]:The status of the
 peer 12.0.0.1 changed from OPENCONFIRM to ESTABLISHED. (InstanceName=Public, St
ateChangeReason=Up)  
[R2-bgp]peer 172.16.3.1 conn    
[R2-bgp]peer 172.16.3.1 connect-interface l    
[R2-bgp]peer 172.16.3.1 connect-interface LoopBack 0
[R2-bgp]pe    
[R2-bgp]peer 172.16.5.1 as 64513
[R2-bgp]pee    
[R2-bgp]peer 172.16.5.1 eb    
[R2-bgp]peer 172.16.5.1 ebgp-max-hop 2
[R2-bgp]pee    
[R2-bgp]peer 172.16.3.1 ne    
[R2-bgp]peer 172.16.3.1 next-hop-l    
[R2-bgp]peer 172.16.3.1 next-hop-local 
[R2-bgp]pee    
[R2-bgp]peer 172.16.5.1 ne    
[R2-bgp]peer 172.16.5.1 next-hop-l    
[R2-bgp]peer 172.16.5.1 next-hop-local 

[R1-bgp]rou    
[R1-bgp]router-id 1.1.1.1
[R1-bgp]pee    
[R1-bgp]peer 12.0.0.2 a    
[R1-bgp]peer 12.0.0.2 as 2
[R1-bgp]
 

 [R3]bgp 64512
[R3-bgp]rout    
[R3-bgp]route-i    
[R3-bgp]route    
[R3-bgp]router-id 3.3.3.3
[R3-bgp]con    
[R3-bgp]confederation id 2
[R3-bgp]pee    
[R3-bgp]peer 172.16.2.1 as 64512
[R3-bgp]pee    
[R3-bgp]peer 172.16.2.1 con    
[R3-bgp]peer 172.16.2.1 connect-interface l    
[R3-bgp]peer 172.16.2.1 connect-interface LoopBack 0
[R3-bgp]pee    
[R3-bgp]peer 172.16.4.1 as 64512
[R3-bgp]pee    
[R3-bgp]peer 172.16.4.1 con    
[R3-bgp]peer 172.16.4.1 connect-interface l0

 [R4-bgp]rou    
[R4-bgp]route-i    
[R4-bgp]route-id    
[R4-bgp]route    
[R4-bgp]router-id 4.4.4.4
[R4-bgp]con    
[R4-bgp]confederation id 2
[R4-bgp]con    
[R4-bgp]confederation pee    
[R4-bgp]confederation peer-as 64513
[R4-bgp]pee    
[R4-bgp]peer 172.16.3.1 as 64512
[R4-bgp]pee    
[R4-bgp]peer 172.16.3.1 con    
[R4-bgp]peer 172.16.3.1 connect-interface l0
[R4-bgp]pee    
[R4-bgp]peer 172.16.7.1 as 64513
[R4-bgp]pee    
[R4-bgp]peer 172.16.7.1 con    
[R4-bgp]peer 172.16.7.1 connect-interface l0
[R4-bgp] 
[R4-bgp]peer 172.16.7.1 e    
[R4-bgp]peer 172.16.7.1 ebgp-max-hop 2

 [R5-bgp]rou    
[R5-bgp]router-id 5.5.5.5
[R5-bgp]con    
[R5-bgp]confederation id 2
[R5-bgp]con    
[R5-bgp]confederation pee    
[R5-bgp]confederation peer-as 64512
[R5-bgp]pee    
[R5-bgp]peer 172.16.2.1 as 64512
[R5-bgp]pee    
[R5-bgp]peer 172.16.2.1 con    
[R5-bgp]peer 172.16.2.1 connect-interface l0
[R5-bgp]pee    
[R5-bgp]peer 172.16.2.1 eb    
[R5-bgp]peer 172.16.2.1 ebgp-max-hop 2
[R5-bgp]pee    
[R5-bgp]peer 172.16.6.1 as 64513
[R5-bgp]pee    
[R5-bgp]peer 172.16.6.1 con l0

 [R6-bgp]rou    
[R6-bgp]router-id 6.6.6.6
[R6-bgp]con    
[R6-bgp]confederation id 2
[R6-bgp]pee    
[R6-bgp]peer 172.16.5.1 as 64513
[R6-bgp]pee    
[R6-bgp]peer 172.16.5.1 con    
[R6-bgp]peer 172.16.5.1 connect-interface l0
[R6-bgp]pee    
[R6-bgp]peer  172.16.7.1 as 64513
[R6-bgp]pee    
[R6-bgp]peer 172.16.7.1 con    
[R6-bgp]peer 172.16.7.1 connect-interface l0

 [R7]bgp 64513
[R7-bgp]rou    
[R7-bgp]route-select                        
[R7-bgp]router-id 7.7.7.7   
[R7-bgp]confederation id 2  
[R7-bgp]confederation pee    
[R7-bgp]confederation peer-as 64512   
[R7-bgp]peer 172.16.6.1 as 64513   
[R7-bgp]confederation l0                 
[R7-bgp]peer  172.16.6.1 con    
[R7-bgp]peer  172.16.6.1 connect-interface l0   
[R7-bgp]peer 172.16.4.1 as 64512   
[R7-bgp]peer 172.16.4.1 eb    
[R7-bgp]peer 172.16.4.1 ebgp-max-hop 3
[R7-bgp]peer 172.16.4.1 ebgp-max-hop 2    
[R7-bgp]peer 78.0.0.2 as 3
[R7-bgp]peer 172.16.4.1 ne    
[R7-bgp]peer 172.16.4.1 next-hop-l    
[R7-bgp]peer 172.16.4.1 next-hop-local    
[R7-bgp]peer 172.16.6.1 next-hop-l    
[R7-bgp]peer 172.16.6.1 next-hop-local 

 [R8]bgp 3
[R8-bgp]rou    
[R8-bgp]route    
[R8-bgp]router-id 8.8.8.8
[R8-bgp]pee    
[R8-bgp]peer 78.0.0.1 as 2

 发布路由

 [R1]bgp 1
[R1-bgp]net    
[R1-bgp]network 10.0.0.0 24

[R8-bgp]q
[R8]bgp 3
[R8-bgp]net    
[R8-bgp]network 11.0.0.0 24 

 破除IBGP之间的水平分割,配置路由反射器

[R6]bgp 64513
[R6-bgp]pee    
[R6-bgp]peer 172.16.7.1 re    
[R6-bgp]peer 172.16.7.1 reflect-client 

 [R3]bgp 64512
[R3-bgp]pee    
[R3-bgp]peer 172.16.2.1 re    
[R3-bgp]peer 172.16.2.1 reflect-client 
[R3-bgp]

 做空接口,宣告汇总

 R2]ip route-static 172.16.0.0 21 NULL 0
[R2]bgp 64512
[R2-bgp]net    
[R2-bgp]network 172.16.0.0 21

[R7]ip route-static 172.16.0.0 22 n 0
[R7]bgp 64513
[R7-bgp]net 172.16.0.0 21
 

 建立GRE隧道,实现两个环回的连接

[R1]int t0/0/0
[R1-Tunnel0/0/0]ip add 192.168.10.1 24
[R1-Tunnel0/0/0]tn    
[R1-Tunnel0/0/0]tu    
[R1-Tunnel0/0/0]tunnel-protocol gr    
[R1-Tunnel0/0/0]tunnel-protocol gre 
[R1-Tunnel0/0/0]sou    
[R1-Tunnel0/0/0]source 10.0.0.1
[R1-Tunnel0/0/0]des    
[R1-Tunnel0/0/0]description 11.0.0.1
[R1-Tunnel0/0/0]ip rou    
[R1-Tunnel0/0/0]q
[R1]ip rou    
[R1]ip route-static192.168.1.0 24 99.0.0.2

 [R8]int t0/0/0
[R8-Tunnel0/0/0]ip add 192.168.10.2 24
[R8-Tunnel0/0/0]tun    
[R8-Tunnel0/0/0]tunnel-protocol g    
[R8-Tunnel0/0/0]tunnel-protocol gre 
[R8-Tunnel0/0/0]sou    
[R8-Tunnel0/0/0]source 11.0.0.1
[R8-Tunnel0/0/0]des    
[R8-Tunnel0/0/0]description 10.0.0.1
[R8-Tunnel0/0/0]q
[R8]ip rou    
[R8]ip route-static 192.168.2.0 24 99.0.0.1

 实验结果以及验证

IP地址的查看

 

 

 

 

 

 BGP路由查看

 

 所有设备之间的互通

R1pingR5

 R8pingR3

 R1pingR8

 R1与R8之间未宣告环回接口的通讯

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值