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
相关文章
|
3月前
|
存储 网络协议 网络虚拟化
BGP路由协议学习一
BGP路由协议学习一
52 0
|
4月前
|
网络协议 网络虚拟化
BGP EVPN(一)
BGP EVPN(一)
|
4月前
|
网络架构
|
5月前
|
网络协议
OSPF,RIP和BGP的路由汇总
OSPF,RIP和BGP的路由汇总
66 0
|
5月前
|
负载均衡 网络协议 算法
IP路由协议(RIP、IGRP、OSPF、IS-IS、BGP)
1、路由分类 路由产生方式: 直接路由:路由器会自动生成本路由器激活端口所在网段的路由条目 静态路由:网络管理员手工配置,静态路由信息在缺省的情况下私有的,不会传递给其他的路由器
|
网络协议 算法 数据库
概述、 BGP AS 、BGP 邻居、 BGP 更新源 、BGP TTL 、BGP路由表、 BGP 同步(上)
文章目录 系列文件 概述 BGP AS BGP 邻居 BGP 更新源 BGP TTL BGP路由表 BGP 同步
365 0
概述、 BGP AS 、BGP 邻居、 BGP 更新源 、BGP TTL 、BGP路由表、 BGP 同步(上)
|
网络协议 网络架构 iOS开发
概述、 BGP AS 、BGP 邻居、 BGP 更新源 、BGP TTL 、BGP路由表、 BGP 同步(下)
文章目录 系列文件 概述 BGP AS BGP 邻居 BGP 更新源 BGP TTL BGP路由表 BGP 同步
445 0
概述、 BGP AS 、BGP 邻居、 BGP 更新源 、BGP TTL 、BGP路由表、 BGP 同步(下)
|
网络协议 数据库 网络架构
|
网络协议 网络架构