HCIP-DATACOM核心网络技术(BGP综合实验--发布、联邦、聚合、路由反射器等)

HCIP-DATACOM核心网络技术(BGP综合实验--发布、联邦、聚合、路由反射器等)_第1张图片

一、实验要求:

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,减少路由条目数量,避免环路出现

二、实验配置:

1.划分AS2的地址

HCIP-DATACOM核心网络技术(BGP综合实验--发布、联邦、聚合、路由反射器等)_第2张图片

2.规划AS1、AS3的地址

设备 接口 地址
R1 G0/0/0 12.1.1.1/24
LoopBack0 192.168.1.1/24
LoopBack1 10.1.1.0/24
R8 G0/0/0 78.1.1.1/24
LoopBack0 192.168.2.1/24
LoopBack1 11.1.1.0/24

3.配置IP地址

R1:

[R1]interface g0/0/0
[R1-GigabitEthernet0/0/0]ip address 12.1.1.1 24
[R1]interface LoopBack 0
[R1-LoopBack0]ip address 192.168.1.1 24
[R1]interface LoopBack 1
[R1-LoopBack1]ip address 10.1.1.1 24

R2:

[R2]interface g0/0/0
[R2-GigabitEthernet0/0/0]ip address 12.1.1.2 24
[R2-GigabitEthernet0/0/0]q
[R2]interface g0/0/1
[R2-GigabitEthernet0/0/1]ip address 172.16.1.1 29 
[R2-GigabitEthernet0/0/1]q
[R2]interface g0/0/2
[R2-GigabitEthernet0/0/2]ip address 172.16.1.9 29
[R2-GigabitEthernet0/0/2]q
[R2]interface LoopBack 0
[R2-LoopBack0]ip address 172.16.2.1 24

R3:

[R3]interface g0/0/0
[R3-GigabitEthernet0/0/0]ip address 172.16.1.2 29
[R3-GigabitEthernet0/0/0]q
[R3]interface g0/0/1	
[R3-GigabitEthernet0/0/1]ip address 172.16.1.25 29
[R3-GigabitEthernet0/0/1]q
[R3]interface LoopBack 0
[R3-LoopBack0]ip address 172.16.3.1 24

R4:

[R4]interface g0/0/1
[R4-GigabitEthernet0/0/1]ip address 172.16.1.33 29
[R4-GigabitEthernet0/0/1]q
[R4]interface g0/0/0
[R4-GigabitEthernet0/0/0]ip address 172.16.1.26 29
[R4-GigabitEthernet0/0/0]q
[R4]interface LoopBack 0
[R4-LoopBack0]ip address 172.16.4.1 24

R5:

[R5]interface g0/0/0
[R5-GigabitEthernet0/0/0]ip ad	
[R5-GigabitEthernet0/0/0]ip address 172.16.1.10 29
[R5]interface g0/0/1
[R5-GigabitEthernet0/0/1]ip address 172.16.1.41 29
[R5-GigabitEthernet0/0/1]q
[R5]interface LoopBack 0
[R5-LoopBack0]ip address 172.16.5.1 24

R6:

[R6]interface g0/0/0
[R6-GigabitEthernet0/0/0]ip address 172.16.1.42 29
[R6-GigabitEthernet0/0/0]q
[R6]interface g0/0/1
[R6-GigabitEthernet0/0/1]ip address 172.16.1.49 29
[R6-GigabitEthernet0/0/1]q
[R6]interface LoopBack 0
[R6-LoopBack0]ip address 172.16.6.1 24

R7:

[R7]interface g0/0/0
[R7-GigabitEthernet0/0/0]ip address 172.16.1.50 29
[R7-GigabitEthernet0/0/0]q
[R7]interface g0/0/1
[R7-GigabitEthernet0/0/1]ip address 172.16.1.34 29
[R7-GigabitEthernet0/0/1]q
[R7]interface LoopBack 0
[R7-LoopBack0]ip address 172.16.7.1 24
[R7-LoopBack0]q
[R7]interface g0/0/2
[R7-GigabitEthernet0/0/2]ip address 78.1.1.2 24

R8:

[R8]interface g0/0/0
[R8-GigabitEthernet0/0/0]ip address 78.1.1.1 24
[R8-GigabitEthernet0/0/0]q
[R8]interface LoopBack 0
[R8-LoopBack0]ip address 192.168.2.1 24
[R8-LoopBack0]q
[R8]interface LoopBack 1
[R8-LoopBack1]ip address 11.1.1.1 24

4. 给AS2区域中的设备配置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 172.16.0.0 0.0.255.255

R3:

[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255

R4:

[R4]ospf 1 router-id 4.4.4.4
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255

R5:

[R5]ospf 1 router-id 5.5.5.5
[R5-ospf-1]area 0
[R5-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255

R6:

[R6]ospf 1 router-id 6.6.6.6
[R6-ospf-1]area 0
[R6-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255

R7:

[R7]ospf 1 router-id 7.7.7.7
[R7-ospf-1]area 0
[R7-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255

5.配置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 2.2.2.2
[R2-bgp]confederation id 2     //声明大号为AS2
[R2-bgp]confederation peer-as 64513  //与小号64513建邻
[R2-bgp]peer 12.1.1.1 as-number 1   //与AS1建邻
[R2-bgp]peer 172.16.3.1 as-number 64512  
[R2-bgp]peer 172.16.3.1 connect-interface LoopBack 0
[R2-bgp]peer 172.16.5.1 as-number 64513
[R2-bgp]peer 172.16.5.1 connect-interface LoopBack 0
[R2-bgp]peer 172.16.5.1 ebgp-max-hop 

R3:

[R3]bgp 64512
[R3-bgp]router-id 3.3.3.3
[R3-bgp]confederation id 2
[R3-bgp]peer 172.16.2.1 as-number 64512
[R3-bgp]peer 172.16.2.1 connect-interface LoopBack 0
[R3-bgp]peer 172.16.4.1 as-number 64512
[R3-bgp]peer 172.16.4.1 connect-interface LoopBack 0

R4:

[R4]bgp 64512
[R4-bgp]router-id 4.4.4.4
[R4-bgp]confederation id 2
[R4-bgp]confederation peer-as 64513
[R4-bgp]peer 172.16.3.1 as 64512
[R4-bgp]peer 172.16.3.1 connect-interface LoopBack 0
[R4-bgp]peer 172.16.7.1 as-number 64513
[R4-bgp]peer 172.16.7.1 connect-interface LoopBack 0
[R4-bgp]peer 172.16.7.1 ebgp-max-hop

R5:

[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.2.1 as-number 64512
[R5-bgp]peer 172.16.2.1 connect-interface LoopBack 0
[R5-bgp]peer 172.16.2.1 ebgp-max-hop
[R5-bgp]peer 172.16.6.1 as-number 64513
[R5-bgp]peer 172.16.6.1 connect-interface LoopBack 0

R6:

[R6]bgp 64513
[R6-bgp]router-id 6.6.6.6
[R6-bgp]confederation id 2
[R6-bgp]peer 172.16.5.1 as-number 64513
[R6-bgp]peer 172.16.5.1 connect-interface LoopBack 0	
[R6-bgp]peer 172.16.7.1 as-number 64513
[R6-bgp]peer 172.16.7.1 connect-interface LoopBack 0	

R7:

[R7]bgp 64513
[R7-bgp]router-id 7.7.7.7
[R7-bgp]confederation id 2
[R7-bgp]confederation peer-as 64512
[R7-bgp]peer 172.16.6.1 as-number 64513
[R7-bgp]peer 172.16.6.1 connect-interface LoopBack 0
[R7-bgp]peer 172.16.4.1 as-number 64512
[R7-bgp]peer 172.16.4.1 connect-interface LoopBack 0
[R7-bgp]peer 172.16.4.1 ebgp-max-hop
[R7-bgp]peer 78.1.1.1 as 3

R8:

[R8]bgp 3
[R8-bgp]router-id 8.8.8.8
[R8-bgp]peer 78.1.1.2 as-number 2

6.配置好BGP邻居关系并且建立成功后,在R1上通告一条LoopBack 1的路由

R1:

[R1]bgp 1
[R1-bgp]network 10.1.1.0 24

注意:通告后只有R2收到该路由,R3、R5未收到,因为在BGP路由表中的下一跳没有改变,永远是R1的下一跳,所以要在R2上把下一跳改到本地路由中

[R2]bgp 64512
[R2-bgp]peer 172.16.3.1 next-hop-local
[R2-bgp]peer 172.16.5.1 next-hop-local

6.1改完下一跳后,R3、R5、R6收到了路由,然而R4、R7没有收到,这里是由于IBGP水平分割(从IBGP对等体收到的路由,不会发送给其他的IBGP对等体)导致的问题,解决该问题的办法就是把R3、R6作为路由反射器RR,把R2、R5作为客户端,形成俩对反射簇。

R3:

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

R6:

[R6]bgp 64513
[R6-bgp]peer 172.16.5.1 reflect-client 

7.至此,R1把路由成功的传到了R8,但是要实现路由的双向交互,也要在R8上通告一条LoopBack 1的路由

R8:

[R8]bgp 3
[R8-bgp]network 11.1.1.0 24

同理:通告后只有R7收到该路由,其他未收到,因为在BGP路由表中的下一跳没有改变,永远是R8的下一跳,所以要在R7上把下一跳改到本地路由中

[R7]bgp 64513
[R7-bgp]peer 172.16.6.1 next-hop-local
[R7-bgp]peer 172.16.4.1 next-hop-local

8.R1与R8的LoopBack 1环回能够通讯

HCIP-DATACOM核心网络技术(BGP综合实验--发布、联邦、聚合、路由反射器等)_第3张图片
HCIP-DATACOM核心网络技术(BGP综合实验--发布、联邦、聚合、路由反射器等)_第4张图片

9.AS2内部的环回不能互通,所以进行汇总路由(减少路由条目数量)指向空接口(避免环路),然后进行宣告就可以使AS2的环回也可以互通

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

测试:
HCIP-DATACOM核心网络技术(BGP综合实验--发布、联邦、聚合、路由反射器等)_第5张图片
HCIP-DATACOM核心网络技术(BGP综合实验--发布、联邦、聚合、路由反射器等)_第6张图片

10.配置GRE隧道使得R1、R8的LoopBack 0 互通

R1:

[R1]int t0/0/0
[R1-Tunnel0/0/0]ip address 100.1.1.1 24
[R1-Tunnel0/0/0]tunnel-protocol gre 
[R1-Tunnel0/0/0]source 10.1.1.1
[R1-Tunnel0/0/0]destination 11.1.1.1

R8:

[R8]interface Tunnel 0/0/0
[R8-Tunnel0/0/0]ip address 100.1.1.2 24
[R8-Tunnel0/0/0]tunnel-protocol gre 
[R8-Tunnel0/0/0]source 11.1.1.1
[R8-Tunnel0/0/0]destination 10.1.1.1

11、测试:R1与R8的LoopBack 0能够互相通讯

HCIP-DATACOM核心网络技术(BGP综合实验--发布、联邦、聚合、路由反射器等)_第7张图片
![在这里插入图片描述](https://img-blog.csdnimg.cn/0eb16f1a9ddf459e8f08c204215ce69c.pngHCIP-DATACOM核心网络技术(BGP综合实验--发布、联邦、聚合、路由反射器等)_第8张图片

你可能感兴趣的:(网络,linux,服务器)