当前位置: 首页 > news >正文

BGP分解实验·19——BGP选路原则之起源

当用不同的方式为BGP注入路由时,起源代码将标识路由的来源。

(在BGP表中,Network为“i”,重分布是“?”)

实验拓扑如下:

R2上将来自IGP的路由10.3.3.3/32用network指令注入BGP;在R4上将来自IGP的路由10.3.3.3/32使用重分布的方式引入BGP。

完成实验拓扑的基础配置R1如下:

hostname R1
!
interface Loopback0
 ip address 10.1.0.1 255.255.255.0
!
interface Loopback1
 ip address 10.1.1.1 255.255.255.0
!
interface Ethernet0/0
 ip address 10.12.1.1 255.255.255.0
 no sh
!
router bgp 100
 bgp router-id 1.1.1.1
 network 10.1.0.0 mask 255.255.255.0
 network 10.1.1.0 mask 255.255.255.0
 aggregate-address 10.1.0.0 255.255.0.0 summary-only
 neighbor 10.12.1.2 remote-as 234
!
end

R2的配置如下:

hostname R2
!
interface Loopback1
 ip address 2.2.2.2 255.255.255.255
!
interface Ethernet0/0
 ip address 10.12.1.2 255.255.255.0
 no sh
!
interface Ethernet0/1
 ip address 10.23.0.2 255.255.255.0
 no sh
!
router eigrp 10
 network 0.0.0.0
 passive-interface default
 no passive-interface Ethernet0/1
!
router bgp 234
 bgp router-id 2.2.2.2
 network 10.3.3.3 mask 255.255.255.255
 neighbor IBGP peer-group
 neighbor IBGP remote-as 234
 neighbor IBGP update-source Loopback1
 neighbor IBGP next-hop-self
 neighbor 3.3.3.3 peer-group IBGP
 neighbor 4.4.4.4 peer-group IBGP
 neighbor 10.12.1.1 remote-as 100
!
end

R3的配置如下:

hostname R3
!
interface Loopback0
 ip address 10.3.3.3 255.255.255.255
!
interface Loopback1
 ip address 3.3.3.3 255.255.255.255
!
interface Ethernet0/0
 ip address 10.23.0.3 255.255.255.0
 no sh
!
interface Ethernet0/1
 ip address 10.34.0.3 255.255.255.0
 no sh
!
router eigrp 10
 network 0.0.0.0
!
router bgp 234
 bgp router-id 3.3.3.3
 neighbor IBGP peer-group
 neighbor IBGP remote-as 234
 neighbor IBGP update-source Loopback1
 neighbor 2.2.2.2 peer-group IBGP
 neighbor 4.4.4.4 peer-group IBGP
!
end

R4的配置如下:

hostname R4
!
interface Loopback1
 ip address 4.4.4.4 255.255.255.255
!
interface Ethernet0/0
 ip address 10.45.2.4 255.255.255.0
 no sh
!
interface Ethernet0/1
 ip address 10.34.0.4 255.255.255.0
 no sh
!
router eigrp 10
 network 0.0.0.0
 passive-interface Ethernet0/0
!
router bgp 234
 bgp router-id 4.4.4.4
 redistribute eigrp 10 route-map RED
 neighbor IBGP peer-group
 neighbor IBGP remote-as 234
 neighbor IBGP update-source Loopback1
 neighbor IBGP next-hop-self
 neighbor 2.2.2.2 peer-group IBGP
 neighbor 3.3.3.3 peer-group IBGP
 neighbor 10.45.2.5 remote-as 500
!
ip prefix-list RED seq 5 permit 10.3.3.3/32
!
route-map RED permit 10
 match ip address prefix-list RED
!

R5的配置如下:

hostname R5
!
interface Loopback2
 ip address 10.1.2.5 255.255.255.0
!
interface Loopback3
 ip address 10.1.3.5 255.255.255.0
!
interface Ethernet0/0
 ip address 10.45.2.5 255.255.255.0
 no sh
!
router bgp 500
 bgp router-id 5.5.5.5
 network 10.1.2.0 mask 255.255.255.0
 network 10.1.3.0 mask 255.255.255.0
 aggregate-address 10.1.0.0 255.255.0.0 summary-only
 neighbor 10.45.2.4 remote-as 234
!
end

在R3上查看网络10.3.3.3/32的BGP表和路由详细信息如下:

其他路由器的BGP表和路由查看略。

当通过起源代码做BGP选路决策时,可以看到IGP的“i”是由于重分布的“?”的选路规则。

另外,在操作本AS的多宿主环境的BGP网络出站流量时,使用本地优先级控制更合适。(随后的实验将逐步演示。)

相关文章:

  • 深度学习-126-LangGraph之基础知识(三)添加记忆和Human_in_the_loop的聊天机器人
  • 解决每次 Maven Rebuild 后 Java 编译器版本变为 1.5
  • 微信小程序 - 自定义实现分页功能
  • 特辣的海藻!2
  • 达梦数据库学习笔记@1
  • 05C语言——数组
  • 开源工具推荐:监控工具NetData
  • 【NLP算法面经】本科双非,头条+腾讯 NLP 详细面经(★附面题整理★)
  • 【java】类声明的两种形式
  • 7777777777
  • ChatGPT各模型版本对比分析
  • 《论基于构件的软件开发方法及其应用》审题技巧 - 系统架构设计师
  • 深入xtquant:实时行情订阅与数据获取的实战指南
  • 一、哈希——1. 两数之和
  • HTML之JavaScript DOM操作元素(2)
  • 【Opensim】软件显示问题(比例不对,按键遮挡,显示不完整)
  • 深入浅出MySQL:概述与体系结构解析
  • DBAPI如何优雅的实现分页查询功能
  • 根据音频中的不同讲述人声音进行分离音频 | 基于ai的说话人声音分离项目
  • Python|OpenCV-实现人物眨眼检测(21)
  • “乐购浦东”消费券明起发放,多个商家同期推出折扣促销活动
  • 北京公园使用指南
  • 上海出台灵活就业人员公积金新政:不限户籍、提取自由,6月起施行
  • 在差异中建共鸣,《20世纪美国文学思想研究》丛书出版
  • 文旅部:推动离境退税购物便利化有利于更多国内优质商品走出去
  • 俄罗斯准备在没有先决条件的情况下与乌克兰进行谈判