BGP 基本配置实验

实验拓扑

实验需求

  1. 按照图示配置 IP 地址,R1 和 R5 上使用环回口模拟业务网段,R2,R3,R4 的环回口用于配置 Router-id 和建立 IBGP 邻居
  2. AS 200 运行 OSPF 实现内部网络互通
  3. R1,R2,R4,R5 运行 BGP,R1 和 R2 建立 EBGP 邻居,R4 和 R5 建立 EBGP 邻居,R2 和 R4 建立 IBGP 邻居。要求 EBGP 邻居使用直连接口建立邻居,IBGP 邻居使用环回口建立邻居
  4. R1 和 R5 把业务网段宣告进 BGP
  5. 在 R2 和 R4 上把 BGP 引入到 IGP 解决 BGP 路由黑洞问题
  6. 业务网段可以互通

实验过程

按照图示配置 IP 地址,R1 和 R5 上使用环回口模拟业务网段,R2,R3,R4 的环回口用于配置 Router-id 和建立 IBGP 邻居

2.AS 200 运行 OSPF 实现内部网络互通

04-R2\]ospf router-id 2.2.2.2 \[04-R2-ospf-1\]a 0 \[04-R2-ospf-1-area-0.0.0.0\]net 100.1.1.0 0.0.0.255 \[04-R2-ospf-1-area-0.0.0.0\]net 100.2.2.0 0.0.0.255 \[04-R2-ospf-1-area-0.0.0.0\]net 2.2.2.2 0.0.0.0 \[04-R3\]ospf router-id 3.3.3.3 \[04-R3-ospf-1\]a 0 \[04-R3-ospf-1-area-0.0.0.0\]net 100.2.2.0 0.0.0.255 \[04-R3-ospf-1-area-0.0.0.0\]net 100.3.3.0 0.0.0.255 \[04-R3-ospf-1-area-0.0.0.0\]net 3.3.3.3 0.0.0.0 \[04-R4\]ospf router-id 4.4.4.4 \[04-R4-ospf-1\]a 0 \[04-R4-ospf-1-area-0.0.0.0\]net 4.4.4.4 0.0.0.0 \[04-R4-ospf-1-area-0.0.0.0\]net 100.3.3.0 0.0.0.255 \[04-R4-ospf-1-area-0.0.0.0\]net 100.4.4.0 0.0.0.255 ## 3.R1,R2,R4,R5 运行 BGP,R1 和 R2 建立 EBGP 邻居,R4 和 R5 建立 EBGP 邻居,R2 和 R4 建立 IBGP 邻居。要求 EBGP 邻居使用直连接口建立邻居,IBGP 邻居使用环回口建立邻居 **步骤 1:在 R1,R2,R4,R5 上配置 BGP,建立邻居关系** \[04-R1\]bgp 100 \[04-R1-bgp-default\]peer 100.1.1.2 as 200 \[04-R1-bgp-default\]address-family ipv4 \[04-R1-bgp-default-ipv4\]peer 100.1.1.2 enable \[04-R2\]bgp 200 \[04-R2-bgp-default\]peer 100.1.1.1 as 100 \[04-R2-bgp-default\]peer 4.4.4.4 as 200 \[04-R2-bgp-default\]peer 4.4.4.4 connect-interface l0 \[04-R2-bgp-default\]address-family ipv4 \[04-R2-bgp-default-ipv4\]peer 100.1.1.1 enable \[04-R2-bgp-default-ipv4\]peer 4.4.4.4 enable \[04-R2-bgp-default-ipv4\]peer 4.4.4.4 next-hop-local \[04-R4\]bgp 200 \[04-R4-bgp-default\]peer 100.4.4.5 as 300 \[04-R4-bgp-default\]peer 2.2.2.2 as 200 \[04-R4-bgp-default\]peer 2.2.2.2 connect-interface l0 \[04-R4-bgp-default\]address-family ipv4 \[04-R4-bgp-default-ipv4\]peer 100.4.4.5 enable \[04-R4-bgp-default-ipv4\]peer 2.2.2.2 enable \[04-R4-bgp-default-ipv4\]peer 2.2.2.2 next-hop-local \[04-R5\]bgp 300 \[04-R5-bgp-default\]peer 100.4.4.4 as 200 \[04-R5-bgp-default\]add \[04-R5-bgp-default\]address-family ipv4 \[04-R5-bgp-default-ipv4\]peer 100.4.4.4 en \[04-R5-bgp-default-ipv4\]peer 100.4.4.4 enable **效果测试:使用命令** **display bgp peer ipv4** **检查邻居是否正确建立** ![](https://i-blog.csdnimg.cn/direct/ad86d9cd45834734b4e58668a975dbaa.png) ![](https://i-blog.csdnimg.cn/direct/ffe74da7ecdc4991a5dd8c52fbb1b305.png) ![](https://i-blog.csdnimg.cn/direct/3e10dfa5c4f24451ba4fb8373dca1a0b.png) 1. ## 4.R1 和 R5 把业务网段宣告进 BGP **步骤 1:在 R1 和 R5 上把业务网段宣告进 BGP 的 IPv4 地址族模式** \[04-R1-bgp-default-ipv4\]net 192.168.1.0 24 \[04-R5-bgp-default-ipv4\]net 192.168.2.0 24 ## 5.在 R2 和 R4 上把 BGP 引入到 IGP 解决 BGP 路由黑洞问题 **步骤 1:在 R2 和 R4 上分别把 BGP 引入到 OSPF** \[04-R2-ospf-1\]import-route bgp \[04-R4-ospf-1\]import-route bgp **效果测试:在 R3 上查看 IP 路由表,发现已经学习到业务网段的路由,来源为 OSPF 外部路由** ## 6.业务网段可以互通 ![](https://i-blog.csdnimg.cn/direct/f84f90c8d6fc4bd6a3de3d957ac53172.png)

相关推荐
LH_R17 小时前
OneTerm开源堡垒机实战(四):访问授权与安全管控
运维·后端·安全
Raymond运维18 小时前
MariaDB源码编译安装(二)
运维·数据库·mariadb
JuiceFS1 天前
从 MLPerf Storage v2.0 看 AI 训练中的存储性能与扩展能力
运维·后端
chen9452 天前
mysql 3节点mgr集群部署
运维·后端
LH_R2 天前
OneTerm开源堡垒机实战(三):功能扩展与效率提升
运维·后端·安全
dessler2 天前
Hadoop HDFS-高可用集群部署
linux·运维·hdfs
少妇的美梦2 天前
logstash教程
运维
chen9452 天前
k8s集群部署vector日志采集器
运维
chen9452 天前
aws ec2部署harbor,使用s3存储
运维
christine-rr3 天前
linux常用命令(4)——压缩命令
linux·服务器·redis