BGP Allow AS In

简介:
【实验说明】
在R5 配置汇聚路由150.1.0.0/21 并且抑制所有明细路由,但要求邻居as学习到的汇聚路由的as-path包括as  1, 2, 3, 5. 同时使R1、R2、R3 能够安装汇聚路由到自己的bgp路由表中。

 
【实验拓扑】

 

【实验分析】
这是一个帧中继的hub-and-spoke 网络,R1、R2、R3都与R5能够相互访问,但R1、R2、R3 之间不能互相访问,因此在R5上配置汇聚路由后,As1、As2、As3 都能够学习到,但如果让他们能学习到的汇聚路由中as-path包含明细路由as号码,就需要加入as-set命令,但如此配置后,R1、R2、R3 将不会安装汇聚路由到路由表中,原因是汇聚路由中as-path中包含了自己的as号,为了防止环路,他们将汇聚路由丢弃。本实验正是不想让R1、R2、R3 丢掉as-path中包含自己as的汇聚路由。因此使用到allowas-in 命令来允许as-path中包含自己as号码的路由进入。

 
【实验配置步骤】
  • 按照上图配置各个设备
  • 在R1、R2、R3、R5 上配置BGP
  • R5 与 R1, R2, and R3 配置为邻居对等体
  • 在R1上创建Loopback 150.X.1.1/24 并通告到 BGP
  • 在R2上创建Loopback 150.X.2.2/24 并通告到 BGP
  • 在R5上创建Loopback 150.X.5.5/24 并通告到 BGP
  • 在R5上配置 BGP aggregate 150.X.0.0/21
  • 汇聚路由中包含源明细路由的as-path
  • 汇 配置 R1, R2, and R3 接受包含自己as的路由,以确保能够安装汇聚路由到自己的bgp路由表中

 
【实验配置】
R1:
interface Serial0/0
ip address 155.1.0.1 255.255.255.0
encapsulation frame-relay
clock rate 2000000
frame-relay map ip 155.1.0.5 105 broadcast
no frame-relay inverse-arp
!
router bgp 1
network 150.1.1.0 mask 255.255.255.0
neighbor 155.1.0.5 remote-as 5
neighbor 155.1.0.5 allowas-in 1
!
R2:
interface Loopback0
ip address 150.1.2.2 255.255.255.0
!
interface Serial0/0
ip address 155.1.0.2 255.255.255.0
encapsulation frame-relay
clock rate 2000000
frame-relay map ip 155.1.0.5 205 broadcast
no frame-relay inverse-arp
!
router bgp 2
network 150.1.2.0 mask 255.255.255.0
neighbor 155.1.0.5 remote-as 5
neighbor 155.1.0.5 allowas-in 1

R3:
interface Serial0/0
ip address 155.1.0.3 255.255.255.0
encapsulation frame-relay
clock rate 2000000
frame-relay map ip 155.1.0.5 305 broadcast
no frame-relay inverse-arp
router bgp 3
neighbor 155.1.0.5 remote-as 5
neighbor 155.1.0.5 allowas-in 1

R5:
interface Loopback0
ip address 150.1.5.5 255.255.255.0
interface Serial0/0
ip address 155.1.0.5 255.255.255.0
encapsulation frame-relay
clock rate 2000000
frame-relay map ip 155.1.0.3 503 broadcast
frame-relay map ip 155.1.0.2 502 broadcast
frame-relay map ip 155.1.0.1 501 broadcast
no frame-relay inverse-arp
!
router bgp 5
network 150.1.5.0 mask 255.255.255.0
aggregate-address 150.1.0.0 255.255.248.0 as-set summary-only
neighbor 155.1.0.1 remote-as 1
neighbor 155.1.0.2 remote-as 2
neighbor 155.1.0.3 remote-as 3
【实验验证】

 
通过下面R1、R2、R3 的bgp路由表输出结果可以看到他们都安装了汇聚路由到自己的路由表中

R1#show ip bgp
BGP table version is 9, local router ID is 150.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path
*> 150.1.0.0/21 155.1.0.5 0 0 5 {1,2,3} i
*> 150.1.1.0/24 0.0.0.0 0 32768 i
R2#show ip bgp
BGP table version is 11, local router ID is 150.1.2.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path
*> 150.1.0.0/21 155.1.0.5 0 0 5 {1,2,3} i
*> 150.1.2.0/24 0.0.0.0 0 32768 i
R3#show ip bgp
BGP table version is 11, local router ID is 150.1.3.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path
*> 150.1.0.0/21 155.1.0.5 0 0 5 {1,2,3} i
*> 150.1.3.0/24 0.0.0.0 0 32768 i


本文转自zcm8483 51CTO博客,原文链接:http://blog.51cto.com/haolun/992251
相关文章
|
数据可视化 计算机视觉
ICCV2021 | TOOD:任务对齐的单阶段目标检测
单阶段目标检测通常通过优化目标分类和定位两个子任务来实现,使用具有两个平行分支的头部,这可能会导致两个任务之间的预测出现一定程度的空间错位。本文提出了一种任务对齐的一阶段目标检测(TOOD),它以基于学习的方式显式地对齐这两个任务。
ICCV2021 | TOOD:任务对齐的单阶段目标检测
|
数据采集 安全 Java
Web 漏洞扫描之 BurpSuite(一)| 学习笔记
快速学习 Web 漏洞扫描之 BurpSuite(一)
1992 0
Web 漏洞扫描之 BurpSuite(一)| 学习笔记
|
10月前
|
JavaScript API
鸿蒙开发:了解正则表达式
从给出的文本中,按照既定的相关规则,匹配出符合的数据,其中的规则就是正则表达式,使用正则表达式,可以使得我们用简洁的代码就能实现一定复杂的逻辑,比如判断一个邮箱账号是否符合正常的邮箱账号,再比如判断一个手机号是否正常的手机号,等等,正因为有了正则,得以让文本处理起来更加的简单。
209 7
|
11月前
|
安全 Java 编译器
什么是AOP面向切面编程?怎么简单理解?
本文介绍了面向切面编程(AOP)的基本概念和原理,解释了如何通过分离横切关注点(如日志、事务管理等)来增强代码的模块化和可维护性。AOP的核心概念包括切面、连接点、切入点、通知和织入。文章还提供了一个使用Spring AOP的简单示例,展示了如何定义和应用切面。
1298 1
什么是AOP面向切面编程?怎么简单理解?
|
11月前
|
人工智能 弹性计算 关系型数据库
学生免费领取阿里云服务器一年的方法,以及各种活动
学生可以免费领取阿里云服务器一年,新人可获2核4G,非新人2核2G。访问链接注册并完成学生认证,领取300元无门槛优惠券,购买轻量应用服务器。此外,还有多项活动可赢取实物奖品。
4456 2
|
网络协议 Ubuntu Linux
在Linux中, 如何配置网络接口?
在Linux中, 如何配置网络接口?
|
存储 Shell API
Casbin是一个强大的、开源的访问控制库,支持访问控制模型如ACL、RBAC、ABAC等。
Casbin是一个强大的、开源的访问控制库,支持访问控制模型如ACL、RBAC、ABAC等。
|
SQL 关系型数据库 MySQL
支付系统----微信支付18-----创建并连接数据库
支付系统----微信支付18-----创建并连接数据库
|
弹性计算 Java Serverless
Serverless 应用引擎操作报错合集之函数实例健康检查失败,一般是什么导致的
Serverless 应用引擎(SAE)是阿里云提供的Serverless PaaS平台,支持Spring Cloud、Dubbo、HSF等主流微服务框架,简化应用的部署、运维和弹性伸缩。在使用SAE过程中,可能会遇到各种操作报错。以下是一些常见的报错情况及其可能的原因和解决方法。
126 0
|
JavaScript
Nuxt.js 服务端渲染 axios(@nuxtjs/axios) 和 proxy 代理的配置
Nuxt.js 服务端渲染 axios(@nuxtjs/axios) 和 proxy 代理的配置
1148 0