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-bgpnetwork 1.1.1.0 24
R5:

r5-bgpnetwork 5.5.5.0 24
R2:

r2-bgpimport-route ospf 1

四、测试结果

只ping出了r1.2.3

相关推荐
数据知道12 小时前
邮件安全实战:SPF/DKIM/DMARC 配置与钓鱼绕过
网络·安全·web安全·网络安全·邮件安全
王莎莎-MinerU12 小时前
MCP 解决的是工具接入,科研 Agent 还缺的是科学证据接口标准化
开发语言·网络·人工智能·深度学习·pdf·c#·php
Chloeis Syntax13 小时前
JAVAEE初阶 --- 构造HTTP请求
网络·网络协议·http·postman
砚凝霜13 小时前
软考网络工程师|第 1 章 计算机网络基础 完整备考笔记
网络·笔记·计算机网络
rcms1527026921813 小时前
NIKON 4S019-394 接口模块
网络
某不知名網友14 小时前
Linux Socket 编程完整讲解
网络
ICT系统集成阿祥14 小时前
不用复杂命令,快速定位二层 / 三层网络故障
网络·网络排查·二层故障·三层故障
CHANG_THE_WORLD14 小时前
1.简单的服务端和客户端(仅作为内容补充)
linux·服务器·网络
学术小白人14 小时前
【倒计时4个月】-AI赋能图像处理与计算机视觉技术国际学术研讨会
网络·人工智能·神经网络·数据分析·光学
无锡耐特森15 小时前
解决网关数据异常EtherNetIP 转Modbus TCP专用动态监测
网络·网络协议·tcp/ip