BGP实验

一、实验需求

  1. IP 地址配置:按照图中给定的网络拓扑和网段信息,正确配置五台路由器(AR1 - AR5)各接口的 IP 地址。同时,为每台路由器配置环回地址。
  2. 路由协议配置:在 AS 200 内部(AR2、AR3、AR4 之间)运行 OSPF 协议,实现区域内路由。在自治系统边界(AR1 与 AR2、AR4 与 AR5 之间)配置外部网关协议(如 BGP ),实现跨自治系统的路由。
  3. 网络连通性:确保五台路由器的环回地址之间能够相互 ping 通,即实现全网可达。

二、需求分析

  1. 自治系统内通信:AS 200 内使用 OSPF 协议,它是链路状态型的内部网关协议。需合理规划 OSPF 区域,配置相关参数,使 AR2、AR3、AR4 之间建立邻居关系并同步链路状态数据库,以实现区域内路由计算和可达。
  2. 自治系统间通信:不同自治系统(AS 100、AS 200、AS 300)有各自管理域,需在边界路由器(AR1 与 AR2、AR4 与 AR5 )上配置 BGP 等外部网关协议,建立邻居关系并交换路由信息,实现跨自治系统的路由通告和数据包转发。
  3. IP 地址与环回地址:准确配置接口 IP 地址是网络通信基础,环回地址用于模拟路由器上的虚拟网络节点,配置后需通过路由协议将其通告出去,保证全网可达。

三、实验步骤

1、基础配置

1、R1 配置

interface GigabitEthernet0/0/0

ip address 12.0.0.1 255.255.255.0

interface LoopBack0

ip address 1.1.1.1 255.255.255.255

2、R2 配置

interface GigabitEthernet0/0/0

ip address 12.0.0.2 255.255.255.0

interface GigabitEthernet0/0/1

ip address 23.0.0.2 255.255.255.0

interface LoopBack0

ip address 2.2.2.2 255.255.255.255

3、R3 配置

interface GigabitEthernet0/0/0

ip address 23.0.0.3 255.255.255.0

interface GigabitEthernet0/0/1

ip address 34.0.0.3 255.255.255.0

interface LoopBack0

ip address 3.3.3.3 255.255.255.255

4、 R4 配置

interface GigabitEthernet0/0/0

ip address 34.0.0.4 255.255.255.0

interface GigabitEthernet0/0/1

ip address 45.0.0.4 255.255.255.0

interface LoopBack0

ip address 4.4.4.4 255.255.255.255

5、R5 配置

interface GigabitEthernet0/0/0

ip address 45.0.0.5 255.255.255.0

interface LoopBack0

ip address 5.5.5.5 255.255.255.255

2、配置IGP

bash 复制代码
R2
[r2]ospf 1
[r2-ospf-1]a 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 23.0.0.2 0.0.0.0


R3
[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]a 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 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


R4
[r4]ospf 1 router-id 4.4.4.4
[r4-ospf-1]a 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 34.0.0.4 0.0.0.0

3、BGP的配置

R1:

bash 复制代码
[r1]bgp 100
[r1-bgp]router-id 1.1.1.1
[r1-bgp]peer 12.0.0.2 as-number 200

R2:

bash 复制代码
[r2]bgp 200
[r2-bgp]router-id 2.2.2.2
[r2-bgp]peer 12.0.0.1 as-number 100	
[r2]bgp 200	
[r2-bgp]peer 3.3.3.3 as-number 200	
[r2-bgp]peer 4.4.4.4 as-number 200
[r2-bgp]peer 3.3.3.3 connect-interface LoopBack 0
[r2-bgp]peer 4.4.4.4 connect-interface LoopBack 0

R3:

bash 复制代码
[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 LoopBack 0
[r3-bgp]peer 4.4.4.4 as-number 200
[r3-bgp]peer 4.4.4.4 connect-interface LoopBack 0

R4:

bash 复制代码
[r4]bgp 200
[r4-bgp]router-id 4.4.4.4
[r4-bgp]peer 3.3.3.3 as-number 200
[r4-bgp]peer 3.3.3.3 connect-interface LoopBack 0
[r4-bgp]peer 2.2.2.2 as-number 200
[r4-bgp]peer 2.2.2.2 connect-interface LoopBack 0
[r4]bgp 200 
[r4-bgp]peer 45.0.0.5 as-number 300

R5:

bash 复制代码
[r5]bgp 300
[r5-bgp]router-id 5.5.5.5
[r5-bgp]peer 45.0.0.4 as-number 200

4、修改下一跳

R2:

bash 复制代码
[r2-bgp]peer  3.3.3.3 next-hop-local
[r2-bgp]peer 4.4.4.4 next-hop-local

R4:

bash 复制代码
[r4-bgp]peer  3.3.3.3 next-hop-local
[r4-bgp]peer 2.2.2.2 next-hop-local

5、宣告并引入路由

R1:

r1-bgp\]network 1.1.1.0 24 R5: \[r5-bgp\]network 5.5.5.0 24 R2: \[r2-bgp\]import-route ospf 1

四、测试结果

只ping出了r1.2.3

相关推荐
Ether IC Verifier42 分钟前
TCP三次握手与四次挥手详解
网络·网络协议·tcp/ip·计算机网络
星寂樱易李8 小时前
iperf3 + Python-- 网络带宽、网速、网络稳定性
开发语言·网络·python
随身数智备忘录11 小时前
什么是设备管理体系?设备管理体系包含哪些核心模块?
网络·数据库·人工智能
第五文修11 小时前
手机OTG转TTL网口实现ping功能
网络·智能手机
云边云科技_云网融合12 小时前
企业大模型时代的网络架构五层演进:从连接到智能的范式重构
网络·重构·架构
xhbh66613 小时前
代理ARP (Proxy ARP) 是如何实现跨网段通信的?在Linux下如何配置?
服务器·网络·智能路由器·端口映射·映射
数智化管理手记15 小时前
精益生产3步实操,让现场从混乱变标杆
大数据·运维·网络·人工智能·精益工程
XiYang-DING15 小时前
【Java EE】TCP—可靠传输
网络·tcp/ip·java-ee
沃虎电子15 小时前
片式网络变压器:从“手工品”到“SMD元件”的产业跨越
网络·片式网络变压器
神奇小梵15 小时前
关于finalshell的使用
linux·服务器·网络