【网络实验】-BGP-EBGP的基本配置

实验拓扑

实验要求:

使用两种方式建立不同AS号的BGP邻居,不同AS号路由器之间建立的邻居称为EBGP邻居

实验目的:

熟悉使用物理口和环回口建立邻居的方式

IP地址规划:

路由器 接口 IP地址
AR1 G0/0/0 12.1.1.1/24
AR1 Loopback 0 1.1.1.1/24
AR2 G0/0/0 12.1.1.2/24
AR2 G0/0/1 23.1.1.2/24
AR2 Loopback 0 2.2.2.2/24
AR3 G0/0/1 23.1.1.3/24
AR3 Loopback 0 3.3.3.3/24

实验配置:

物理接口方式:

shell 复制代码
AR1:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R1
[R1]un in en 
Info: Information center is disabled.
[R1]int g 0/0/0
[R1-GigabitEthernet0/0/0]ip add 12.1.1.1 24
[R1-GigabitEthernet0/0/0]int loo0
[R1-LoopBack0]ip add 1.1.1.1 24
[R1-LoopBack0]bgp 10
[R1-bgp]peer 12.1.1.2 as 20
[R1-bgp]network 12.1.1.0 24
[R1-bgp]network 1.1.1.0 24
shell 复制代码
AR2:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R2
[R2]un in en 
Info: Information center is disabled.
[R2]int g 0/0/1
[R2-GigabitEthernet0/0/1]ip add 12.1.1.2 24
[R2-GigabitEthernet0/0/1]int g 0/0/0
[R2-GigabitEthernet0/0/0]ip add 23.1.1.2 24
[R2-GigabitEthernet0/0/0]int loo0
[R2-LoopBack0]ip add 2.2.2.2 24
[R2-LoopBack0]bgp 20
[R2-bgp]peer 12.1.1.1 as 10
[R2-bgp]peer 23.1.1.3 as 30
[R2-bgp]net 12.1.1.0 24
[R2-bgp]net 23.1.1.0 24
[R2-bgp]net 2.2.2.0 24
shell 复制代码
AR3:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R3
[R3]un in en 
Info: Information center is disabled.
[R3]int g 0/0/1
[R3-GigabitEthernet0/0/1]ip add 23.1.1.3 24
[R3-GigabitEthernet0/0/1]int loo0
[R3-LoopBack0]ip add 3.3.3.3 24
[R3-LoopBack0]bgp 30
[R3-bgp]peer 23.1.1.2 as 20
[R3-bgp]net 23.1.1.0 24
[R3-bgp]net 3.3.3.0 24

环回口方式:

重启路由器,恢复初始配置

shell 复制代码
AR1:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R1
[R1]un in en 
[R1]ip route-static 2.2.2.0 24 12.1.1.2
Info: Information center is disabled.
[R1]int g 0/0/0
[R1-GigabitEthernet0/0/0]ip add 12.1.1.1 24
[R1-GigabitEthernet0/0/0]int loo0
[R1-LoopBack0]ip add 1.1.1.1 24
[R1-LoopBack0]bgp 10
[R1-bgp]peer 2.2.2.2 as-number 20
[R1-bgp]peer 2.2.2.2 connect-interface LoopBack 0
[R1-bgp]peer 2.2.2.2 ebgp-max-hop
[R1-bgp]network 12.1.1.0 24
[R1-bgp]network 1.1.1.0 24
shell 复制代码
AR2:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R2
[R2]un in en 
Info: Information center is disabled.
[R2]ip route-static 1.1.1.0 24 12.1.1.1
[R2]ip route-static 3.3.3.0 24 23.1.1.3
[R2]int g 0/0/1
[R2-GigabitEthernet0/0/1]ip add 12.1.1.2 24
[R2-GigabitEthernet0/0/1]int g 0/0/0
[R2-GigabitEthernet0/0/0]ip add 23.1.1.2 24
[R2-GigabitEthernet0/0/0]int loo0
[R2-LoopBack0]ip add 2.2.2.2 24
[R2-LoopBack0]bgp 20
[R2-bgp]peer 1.1.1.1 as-number 10
[R2-bgp]peer 1.1.1.1 connect-interface LoopBack 0
[R2-bgp]peer 1.1.1.1 ebgp-max-hop
[R2-bgp]peer 3.3.3.3 as-number 30
[R2-bgp]peer 3.3.3.3 connect-interface LoopBack 0
[R2-bgp]peer 3.3.3.3 ebgp-max-hop
[R2-bgp]net 2.2.2.0 24
[R2-bgp]net 23.1.1.0 24
[R2-bgp]net 12.1.1.0 24
shell 复制代码
AR3:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R3
[R3]un in en 
Info: Information center is disabled.
[R3]ip route-static 2.2.2.0 24 23.1.1.2
[R3]int g 0/0/1
[R3-GigabitEthernet0/0/1]ip add 23.1.1.3 24
[R3-GigabitEthernet0/0/1]int loo0
[R3-LoopBack0]ip add 3.3.3.3 24
[R3-LoopBack0]bgp 30
[R3-bgp]peer 2.2.2.2 as-number 20
[R3-bgp]peer 2.2.2.2 connect-interface LoopBack 0
[R3-bgp]peer 2.2.2.2 ebgp-max-hop
[R3-bgp]net 23.1.1.0 24
[R3-bgp]net 3.3.3.0 24

验证:

通过display bgp peer命令查看BGP邻居关系,以AR2为例,可以看到状态为Established,证明EBGP邻居已经建立完成。

通过display bgp routing-table查看BGP路由情况,可以看到已经学习到了其他区域发送过来的路由条目。

注意事项:

实验结论:

EBGP既可以通过物理口建立邻居,也可以通过环回口建立邻居

相关推荐
搬码临时工31 分钟前
外网访问内网服务器常用的三种简单操作步骤方法,本地搭建网址轻松让公网连接
服务器·网络·智能路由器
Fortinet_CHINA43 分钟前
引领AI安全新时代 Accelerate 2025北亚巡展·北京站成功举办
网络·安全
dustcell.1 小时前
Cisco Packer Tracer 综合实验
网络
量子-Alex3 小时前
【反无人机检测】C2FDrone:基于视觉Transformer网络的无人机间由粗到细检测
网络·transformer·无人机
Jeremy_Lee1234 小时前
grafana 批量视图备份及恢复(含数据源)
前端·网络·grafana
洛神灬殇5 小时前
【LLM大模型技术专题】「入门到精通系列教程」基于ai-openai-spring-boot-starter集成开发实战指南
网络·数据库·微服务·云原生·架构
上海云盾第一敬业销售5 小时前
高防IP可以防护什么攻击类型?企业网络安全的第一道防线
网络·tcp/ip·web安全
christine-rr6 小时前
征文投稿:如何写一份实用的技术文档?——以软件配置为例
运维·前端·网络·数据库·软件构建
happyh h h h p p p p7 小时前
部署DNS从服务器
运维·服务器·网络
心扬7 小时前
python网络编程
开发语言·网络·python·tcp/ip