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)

相关推荐
Wy_编程1 小时前
Linux-文本搜索工具grep
linux·运维·服务器
qq998991 小时前
AAA服务器技术
运维·服务器
xujiangyan_1 小时前
linux的sysctl系统以及systemd系统。
linux·服务器·网络
Lovyk1 小时前
Linux Shell 常用操作与脚本示例详解
linux·运维·服务器
iCan_qi2 小时前
【Mac】【Minecraft】关于如何在Mac上搭建基岩版MC服务器的方法
运维·服务器·macos·minecraft
ezreal_pan4 小时前
Kubernetes 负载均衡现象解析:为何同一批次请求集中于单个 Pod
运维·云原生·k8s·traefik
朱皮皮呀4 小时前
Spring Cloud——服务注册与服务发现原理与实现
运维·spring cloud·eureka·服务发现·php
xixingzhe24 小时前
多人同时导出 Excel 导致内存溢出
服务器·设计
云手机掌柜4 小时前
Tumblr长文运营:亚矩阵云手机助力多账号轮询与关键词布局系统
大数据·服务器·tcp/ip·矩阵·流量运营·虚幻·云手机
云边云科技6 小时前
零售行业新店网络零接触部署场景下,如何选择SDWAN
运维·服务器·网络·人工智能·安全·边缘计算·零售