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)

相关推荐
程序猿小D28 分钟前
第16节 Node.js 文件系统
linux·服务器·前端·node.js·编辑器·vim
gsls2008081 小时前
ocrapi服务docker镜像使用
运维·docker·容器
文牧之1 小时前
PostgreSQL 的扩展pg_freespacemap
运维·数据库·postgresql
AWS官方合作商2 小时前
基于AWS Serverless架构:零运维构建自动化SEO内容生成系统
运维·serverless·aws
whp4042 小时前
windows server2019 不成功的部署docker经历
运维·docker·容器
IT界小黑的对象3 小时前
virtualBox部署ubuntu22.04虚拟机 NAT+host only 宿主机ping不通虚拟机
linux·运维·服务器
weixin_527550403 小时前
Linux 环境下高效视频切帧的实用指南
linux·运维·音视频
keson要进步3 小时前
CICD实战(一) -----Jenkins的下载与安装
运维·ci/cd·centos·自动化·jenkins
keson要进步3 小时前
CICD实战(二)-----gitlab的安装与配置
linux·运维·gitlab
我是唐青枫4 小时前
.NET AOT 详解
java·服务器·.net