联邦和反射器实验

拓扑图

一.实验要求

1.AS1存在两个环回,一个地址为192.168.1.0/24,该地址不能在任何协议中宣告

AS3存在两个环回,一个地址为192.168.2.0/24,该地址不能在任何协议中宣告

AS1还有一个环回地址为10.1.1.0/24,AS3另一个环回地址是11.1.1.8/24

最终要求这两个环回可以互相通讯

2.整个AS2的IP地址为172.16.0.0/16

3.AS间的骨干链路IP地址随意分配

4.使用BGP协议让整个网络所有设备的环回可以互相访问

5.减少路由条目数量,避免环路出现

三、实验步骤

1.配置IP

R1

r1\]int g0/0/0 \[r1-GigabitEthernet0/0/0\]ip add 12.0.0.1 30 May 29 2024 00:47:28-08:00 r1 %%01IFNET/4/LINK_STATE(l)\[1\]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state. \[r1-GigabitEthernet0/0/0\]int l 0 \[r1-LoopBack0\]ip add 192.168.1.1 24 \[r1-LoopBack0\]int l 1 \[r1-LoopBack1\]ip add 10.1.1.1 24 R2 \[r2\]int g0/0/0 \[r2-GigabitEthernet0/0/0\]ip add 12.0.0.2 30 May 29 2024 00:48:24-08:00 r2 %%01IFNET/4/LINK_STATE(l)\[0\]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state. \[r2-GigabitEthernet0/0/0\]int g0/0/1 \[r2-GigabitEthernet0/0/1\]ip add 172.16.1.1 30 May 29 2024 00:48:36-08:00 r2 %%01IFNET/4/LINK_STATE(l)\[1\]:The line protocol IP on the interface GigabitEthernet0/0/1 has entered the UP state. \[r2-GigabitEthernet0/0/1\]int g0/0/2 \[r2-GigabitEthernet0/0/2\]ip add 172.16.1.22 30 May 29 2024 00:48:54-08:00 r2 %%01IFNET/4/LINK_STATE(l)\[2\]:The line protocol IP on the interface GigabitEthernet0/0/2 has entered the UP state. \[r2-GigabitEthernet0/0/2\]int l 0 \[r2-LoopBack0\]ip add 2.2.2.2 32 \[r2-LoopBack0\]int l 1 \[r2-LoopBack1\]ip add 172.16.2.1 24 R3 \[r3\]int g0/0/0 \[r3-GigabitEthernet0/0/0\]ip add 172.16.1.2 30 May 29 2024 00:49:54-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 g0/0/1 \[r3-GigabitEthernet0/0/1\]ip add 172.16.1.5 30 May 29 2024 00:50:11-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\]int l 0 \[r3-LoopBack0\]ip add 3.3.3.3 32 \[r3-LoopBack0\]int l 1 \[r3-LoopBack1\]ip add 172.16.3.1 24 R4 \[r4\]int g0/0/0 \[r4-GigabitEthernet0/0/0\]ip add 172.16.1.6 30 May 29 2024 00:51:17-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 g0/0/1 \[r4-GigabitEthernet0/0/1\]ip add 172.16.1.9 30 May 29 2024 00:51:28-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 l 0 \[r4-LoopBack0\]ip add 4.4.4.4 32 \[r4-LoopBack0\]int l 1 \[r4-LoopBack1\]ip add 172.16.4.1 24 R5 \[r5\]int g0/0/0 \[r5-GigabitEthernet0/0/0\]ip add 172.16.1.21 30 May 29 2024 00:52:18-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 g0/0/1 \[r5-GigabitEthernet0/0/1\]ip add 172.16.1.18 30 May 29 2024 00:52:29-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 l 0 \[r5-LoopBack0\]ip add 5.5.5.5 32 \[r5-LoopBack0\]int l 1 \[r5-LoopBack1\]ip add 172.16.5.1 24 \[r6\]int g0/0/0 \[r6-GigabitEthernet0/0/0\]ip add 172.16.1.17 30 May 29 2024 00:53:33-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 g0/0/1 \[r6-GigabitEthernet0/0/1\]ip add 172.16.1.14 30 May 29 2024 00:53:45-08:00 r6 %%01IFNET/4/LINK_STATE(l)\[1\]:The line protocol IP on the interface GigabitEthernet0/0/1 has entered the UP state. \[r6-GigabitEthernet0/0/1\]int l 0 \[r6-LoopBack0\]ip add 6.6.6.6 32 \[r6-LoopBack0\]int l 1 \[r6-LoopBack1\]ip add 172.16.6.1 24 R7 \[r7\]int g0/0/0 \[r7-GigabitEthernet0/0/0\]ip add 172.16.1.10 30 May 29 2024 00:54:41-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 g0/0/1 \[r7-GigabitEthernet0/0/1\]ip add 172.16.1.13 30 May 29 2024 00:54:53-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 g0/0/2 \[r7-GigabitEthernet0/0/2\]ip add 78.0.0.1 30 \[r7-GigabitEthernet0/0/2

May 29 2024 00:55:04-08:00 r7 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP

on the interface GigabitEthernet0/0/2 has entered the UP state.

r7-GigabitEthernet0/0/2\]int l 0 \[r7-LoopBack0\]ip add 7.7.7.7 32 \[r7-LoopBack0\]int l 1 \[r7-LoopBack1\]ip add 172.16.7.1 24 R8 \[r8\]int g0/0/0 \[r8-GigabitEthernet0/0/0\]ip add 78.0.0.2 30 May 29 2024 00:56:02-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 l 0 \[r8-LoopBack0\]ip add 192.168.2.1 24 \[r8-LoopBack0\]int l 1 \[r8-LoopBack1\]ip add 11.1.1.1 24 2.AS2内部配置ospf R2 \[r2\]ospf 1 router-id 2.2.2.2 \[r2-ospf-1\]ar \[r2-ospf-1\]area 0 \[r2-ospf-1-area-0.0.0.0\]network 2.2.2.2 0.0.0.0 \[r2-ospf-1-area-0.0.0.0\]network 172.16.2.0 0.0.0.255 \[r2-ospf-1-area-0.0.0.0\]network 172.16.1.1 0.0.0.0 \[r2-ospf-1-area-0.0.0.0\]network 172.16.1.22 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 3.3.3.3 0.0.0.0 \[r3-ospf-1-area-0.0.0.0\]network 172.16.3.0 0.0.0.255 \[r3-ospf-1-area-0.0.0.0\]network 172.16.1.2 0.0.0.0 \[r3-ospf-1-area-0.0.0.0\]network 172.16.1.5 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 4.4.4.4 0.0.0.0 \[r4-ospf-1-area-0.0.0.0\]network 172.16.4.0 0.0.0.0 \[r4-ospf-1-area-0.0.0.0\]network 172.16.1.6 0.0.0.0 \[r4-ospf-1-area-0.0.0.0\]network 172.16.1.9 0.0.0.0 R5 \[r5\]ospf 1 router-id 5.5.5.5 \[r5-ospf-1\]area 0 \[r5-ospf-1-area-0.0.0.0\]network 5.5.5.5 0.0.0.0 \[r5-ospf-1-area-0.0.0.0\]network 172.16.5.0 0.0.0.255 \[r5-ospf-1-area-0.0.0.0\]network 172.16.1.21 0.0.0.0 \[r5-ospf-1-area-0.0.0.0\]network 172.16.1.18 0.0.0.0 R6 \[r6\]ospf 1 router-id 6.6.6.6 \[r6-ospf-1\]area 0 \[r6-ospf-1-area-0.0.0.0\]network 6.6.6.6 0.0.0.0 \[r6-ospf-1-area-0.0.0.0\]network 172.16.6.0 0.0.0.255 \[r6-ospf-1-area-0.0.0.0\]network 172.16.1.17 0.0.0.0 \[r6-ospf-1-area-0.0.0.0\]network 172.16.1.14 0.0.0.0 R7 \[r7\]ospf 1 router-id 7.7.7.7 \[r7-ospf-1\]area 0 \[r7-ospf-1-area-0.0.0.0\]network 7.7.7.7 0.0.0.0 \[r7-ospf-1-area-0.0.0.0\]network 172.16.7.0 0.0.0.255 \[r7-ospf-1-area-0.0.0.0\]network 172.16.1.10 0.0.0.255 \[r7-ospf-1-area-0.0.0.0\]network 172.16.1.13 0.0.0.0 3. R1与R2建立EBGP R1 \[r1\]bgp 1 \[r1-bgp\]router-id 1.1.1.1 \[r1-bgp\]peer 12.0.0.2 as-number 2 R2 \[r2\]bgp 64512 \[r2-bgp\]router-id 2.2.2.2 \[r2-bgp\]confederation id 2 \[r2-bgp\]peer 12.0.0.1 as-number 1 R7与R8建立EBGP \[r7\]bgp 64513 \[r7-bgp\]router-id 2.2.2.2 \[r7-bgp\]confederation id 2 \[r7-bgp\]peer 78.0.0.2 as-number 3 \[r8\]bgp 3 \[r8-bgp\]router-id 8.8.8.8 \[r8-bgp\]peer 78.0.0.1 as-number 2 4. AS2区域中64512内R2/3/4之间建立联邦 R2 \[r2\]bgp 64512 \[r2-bgp\]peer 3.3.3.3 as-number 64512 \[r2-bgp\]peer 3.3.3.3 connect-interface LoopBack 0 \[r2-bgp\]peer 3.3.3.3 next-hop-local R3 \[r3\]bgp 64512 \[r3-bgp\]confederation id 2 \[r3-bgp\]peer 2.2.2.2 as-number 64512 \[r3-bgp\]peer 2.2.2.2 connect-interface LoopBack 0 \[r3-bgp\]peer 4.4.4.4 as-number 64512 \[r3-bgp\]peer 4.4.4.4 connect-interface LoopBack 0 R4 \[r4\]bgp 64512 \[r4-bgp\]confederation id 2 \[r4-bgp\]peer 3.3.3.3 as-number 64512 \[r4-bgp\]peer 3.3.3.3 connect-interface LoopBack 0 AS2区域中64513内R5/6/7之间建立联邦 R5 \[r5\]bgp 64513 \[r5-bgp\]confederation id 2 \[r5-bgp\]peer 6.6.6.6 as-number 64513 \[r5-bgp\]peer 6.6.6.6 connect-interface LoopBack 0 R6 \[r6\]bgp 64513 \[r6-bgp\]confederation id 2 \[r6-bgp\]peer 7.7.7.7 as-number 64513 \[r6-bgp\]peer 7.7.7.7 connect-interface LoopBack 0 \[r6-bgp\]peer 5.5.5.5 as-number 64513 \[r6-bgp\]peer 5.5.5.5 connect-interface LoopBack 0 R7 \[r7\]bgp 6451 \[r7\]bgp 64513 \[r7-bgp\]peer 6.6.6.6 as-number 64513 \[r7-bgp\]peer 6.6.6.6 connect-interface LoopBack 0 \[r7-bgp\]peer 6.6.6.6 next-hop-local 5. R2与R5建立EBGP R2 \[r2\]bgp 64512 \[r2-bgp\]confederation peer-as 64513 \[r2-bgp\]peer 5.5.5.5 as-number 64513 \[r2-bgp\]peer 5.5.5.5 connect-interface LoopBack 0 \[r2-bgp\]peer 5.5.5.5 ebgp-max-hop \[r2-bgp\]peer 5.5.5.5 next-hop-local R5 \[r5\]bgp 64513 \[r5-bgp\]confederation peer-as 64512 \[r5-bgp\]peer 2.2.2.2 as-number 64512 \[r5-bgp\]peer 2.2.2.2 connect-interface LoopBack 0 \[r5-bgp\]peer 2.2.2.2 ebgp-max-hop R4与R7建立EBGP R4 \[r4\]bgp 64512 \[r4-bgp\]confederation peer-as 64513 \[r4-bgp\]peer 7.7.7.7 as-number 64513 \[r4-bgp\]peer 7.7.7.7 connect-interface LoopBack 0 \[r4-bgp\]peer 7.7.7.7 ebgp-max-hop R7 \[r7\]bgp 64513 \[r7-bgp\]confederation peer-as 64512 \[r7-bgp\]peer 4.4.4.4 as-number 64512 \[r7-bgp\]peer 4.4.4.4 connect-interface LoopBack 0 \[r7-bgp\]peer 4.4.4.4 ebgp-max-hop \[r7-bgp\]peer 4.4.4.4 next-hop-local 6.在R3与R6上配置路由反射器用来打破IBGP的水平分割 R3 \[r3\]bgp 64512 \[r3-bgp\]peer 2.2.2.2 reflect-client R6 \[r6\]bgp 64513 \[r6-bgp\]peer 7.7.7.7 reflect-client 6. 将用户网段宣告进BGP \[r1\]bgp 1 \[r1-bgp\]network 10.1.1.0 24 \[r2\]bgp 64512 \[r2-bgp\]network 172.16.2.0 24 \[r3\]bgp 64512 \[r3-bgp\]network 172.16.3.0 24 \[r4\]bgp 64512 \[r4-bgp\]network 172.16.4.0 24 \[r5\]bgp 64513 \[r5-bgp\]network 172.16.5.0 24 \[r6\]bgp 64513 \[r6-bgp\]network 172.16.6.0 24 \[r7\]bgp 64513 \[r7-bgp\]network 172.16.7.0 24 \[r8\]bgp 3 \[r8-bgp\]network 11.1.1.0 24 7. 创建R1-R8虚拟隧道,使用GRE R1 \[r1\]bgp 1 \[r1-bgp\]network 10.1.1.0 24 \[r1-bgp\]int t 0/0/1 \[r1-Tunnel0/0/1\]ip add 192.168.3.1 24 \[r1-Tunnel0/0/1\]tunnel-protocol gre \[r1-Tunnel0/0/1\]source 10.1.1.1 \[r1-Tunnel0/0/1\]destination 11.1.1.1 May 29 2024 01:45:22-08:00 r1 %%01IFNET/4/LINK_STATE(l)\[0\]:The line protocol IP on the interface Tunnel0/0/1 has entered the UP state. \[r1-Tunnel0/0/1

r1-Tunnel0/0/1\]Q \[r1\]ip route-static 192.168.2.0 24 192.168.3.2 R8 \[r8\]bgp 3 \[r8-bgp\]network 11.1.1.0 24 \[r8-bgp\]int t0/0/1 \[r8-Tunnel0/0/1\]ip add 192.168.3.2 24 \[r8-Tunnel0/0/1\]tunnel-protocol gre \[r8-Tunnel0/0/1\]source 11.1.1.1 \[r8-Tunnel0/0/1\]destination 10.1.1.1 May 29 2024 01:46:40-08:00 r8 %%01IFNET/4/LINK_STATE(l)\[0\]:The line protocol IP on the interface Tunnel0/0/1 has entered the UP state. \[r8-Tunnel0/0/1\]Q \[r8\]ip route-static 192.168.1.0 24 192.168.3.1 8. 路由聚合 R2 \[r2\]ip route-static 172.16.0.0 21 NULL 0 \[r2\]bgp 64512 \[r2-bgp\]aggregate 172.16.0.0 21 detail-suppressed R7 \[r7\]ip route-static 172.16.0.0 21 NULL 0 \[r7\]bgp 64513 \[r7-bgp\]aggregate 172.16.0.0 21 detail-suppressed 四、验证 ![](https://file.jishuzhan.net/article/1795591335802048513/0f120fa339bf3430f91c6a013b8d141f.webp) ![](https://file.jishuzhan.net/article/1795591335802048513/1175a5d2ecb1dc585785289cabae5c17.webp)

相关推荐
qinyia37 分钟前
Wisdom SSH 是一款创新性工具,通过集成 AI 助手,为服务器性能优化带来极大便利。
服务器·人工智能·ssh
MilesShi2 小时前
从 scheduler_tick 到上下文切换:深入解析 Linux 内核的 TIF_NEED_RESCHED 标志设置流程
linux·运维·单片机
liulilittle4 小时前
OPENPPP2 —— IP标准校验和算法深度剖析:从原理到SSE2优化实现
网络·c++·网络协议·tcp/ip·算法·ip·通信
晓衣5 小时前
2025“獬豸杯”全国电子数据取证竞赛-k8s服务器取证wp
服务器·经验分享·程序人生·网络安全·容器·kubernetes·学习方法
我爱云计算5 小时前
K8S详解(5万字详细教程)
linux·运维·云原生·容器·kubernetes
北极光SD-WAN组网7 小时前
从0到1搭建某铝箔智慧工厂网络:5G与WiFi 6助力智能制造
网络·5g·制造
阿昭L7 小时前
HTTP原理
网络·网络协议·http
2301_794333917 小时前
实验室服务器配置|通过Docker实现Linux系统多用户隔离与安全防控
linux·服务器·docker·实验室
hazy1k8 小时前
STM32H750 RTC介绍及应用
网络·stm32·实时音视频
没书读了8 小时前
考研复习-计算机网络-第三章-数据链路层
网络·计算机网络·考研