BGP no-export

简介:

【实验要求】

使用 community 中的No-Export 属性配置AS2,保证AS3与AS1通告的网络之间不能互相访问,
本实验主要为了在多个bgp出口存在的情况下如何不把从一个AS学习的路由传递给其他AS。

 

 
【实验拓扑】

 

【实验基本配置】
R1:
interface FastEthernet0/0
ip address 155.1.146.1 255.255.255.0
interface Serial0/0
ip address 155.1.13.1 255.255.255.0
clock rate 2000000
router eigrp 2
network 155.1.13.1 0.0.0.0
no auto-summary
!
router bgp 2
no synchronization
bgp log-neighbor-changes
neighbor 155.1.13.3 remote-as 2
neighbor 155.1.13.3 next-hop-self
neighbor 155.1.23.2 remote-as 2
neighbor 155.1.23.2 next-hop-self
neighbor 155.1.146.4 remote-as 3
no auto-summary
R2:
interface Serial0/0
ip address 155.1.23.2 255.255.255.0
clock rate 2000000
interface Serial0/1
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
router eigrp 2
network 155.1.23.2 0.0.0.0
auto-summary
!
router bgp 2
no synchronization
bgp log-neighbor-changes
neighbor 155.1.0.5 remote-as 1
neighbor 155.1.13.1 remote-as 2
neighbor 155.1.13.1 next-hop-self
neighbor 155.1.23.3 remote-as 2
neighbor 155.1.23.3 next-hop-self
R3: (注意R3不用配置next-hop-self,因为它不不是边界路由器)
interface Loopback0
ip address 155.1.37.3 255.255.255.0
interface Serial0/0
ip address 155.1.13.3 255.255.255.0
clock rate 2000000
interface Serial0/1
ip address 155.1.23.3 255.255.255.0
clock rate 2000000
router eigrp 2
network 155.1.13.3 0.0.0.0
network 155.1.23.3 0.0.0.0
auto-summary
!
router bgp 2
no synchronization
bgp log-neighbor-changes
network 155.1.37.0 mask 255.255.255.0
neighbor 155.1.13.1 remote-as 2
neighbor 155.1.23.2 remote-as 2
no auto-summary
R4:
interface Loopback0
ip address 204.12.1.4 255.255.255.0
!
interface FastEthernet0/0
ip address 155.1.146.4 255.255.255.0
router bgp 3
no synchronization
bgp log-neighbor-changes
network 204.12.1.0
neighbor 155.1.146.1 remote-as 2
no auto-summary
R5:
interface Loopback0
ip address 155.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.2 502 broadcast
router bgp 1
no synchronization
bgp log-neighbor-changes
network 155.1.5.0 mask 255.255.255.0
neighbor 155.1.0.2 remote-as 2
no auto-summary

 
【实验前验证】
验证的目的是在同步关闭的情况下,AS1、AS2、AS3 之间通告的网络都可以学习到,而且可以互相ping通
R4:
R4#show ip bgp 我们看到AS3学习到了AS1和AS2通告的路由,如下高亮部分
<省略部分输出结果>
Network Next Hop Metric LocPrf Weight Path
*> 155.1.5.0/24 155.1.146.1 0 2 1 i
*> 155.1.37.0/24 155.1.146.1 0 2 i
*> 204.12.1.0 0.0.0.0 0 32768 i

 
R4:
R4#ping 155.1.5.5 source 204.12.1.4 并且R4能够ping通AS1所通告的155.1.5.5 的地址

 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 155.1.5.5, timeout is 2 seconds:
Packet sent with a source address of 204.12.1.4
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 76/100/124 ms

 

【实验配置】

R1:
route-map NO_EXPORT permit 10
set community no-export
router bgp 2
neighbor 155.1.146.4 route-map NO_EXPORT in
neighbor 155.1.23.2 send-community
R2:
route-map NO_EXPORT permit 10
set community no-export
router bgp 2
neighbor 155.1.0.5 route-map NO_EXPORT in
neighbor 155.1.13.1 send-community
注意:上面配置为什么是in,因为是为了让学习到的路由进来的时候带上no-export的标记
send community no-export 只发给边界路由器

 
【实验后验证】
我们此时需要验证,在AS1与AS3之间能否相互学习到对方通告的地址即可
R1#show ip bgp 204.12.1.0
BGP routing table entry for 204.12.1.0/24, version 4
Paths: (1 available, best #1, table Default-IP-Routing-Table, not advertised to EBGP peer)
Flag: 0x820
Advertised to update-groups:
2 3
3
155.1.146.4 from 155.1.146.4 (204.12.1.4)
Origin IGP, metric 0, localpref 100, valid, external, best
Community: no-export  我们在R1上可以看到从AS3学习到的路由带上了 community:no-export 标记


R4#show ip bgp  我们看到AS3无法学习到了AS1所通告的路由,如下高亮部分
<省略部分输出结果>
Network Next Hop Metric LocPrf Weight Path
*> 155.1.37.0/24 155.1.146.1 0 2 i
*> 204.12.1.0 0.0.0.0 0 32768 i

本文转自zcm8483 51CTO博客,原文链接:http://blog.51cto.com/haolun/992833
相关文章
|
Kubernetes 持续交付 Docker
利用 Docker 和 Kubernetes 实现微服务部署
【10月更文挑战第2天】利用 Docker 和 Kubernetes 实现微服务部署
|
4月前
|
NoSQL 测试技术 Redis
Redis批量删除Key的三种方式
Redis批量删除Key是优化数据库性能的重要操作,本文介绍三种高效方法:1) 使用通配符匹配(KEYS/SCAN+DEL),适合不同数据规模;2) Lua脚本实现原子化删除,适用于需要事务保障的场景;3) 管道批量处理提升效率。根据实际需求选择合适方案,注意操作不可逆,建议先备份数据,避免内存溢出或阻塞。
|
数据库 开发者
|
设计模式 Java
Java“不能转换的类型”解决
在Java编程中,“不能转换的类型”错误通常出现在尝试将一个对象强制转换为不兼容的类型时。解决此问题的方法包括确保类型间存在继承关系、使用泛型或适当的设计模式来避免不安全的类型转换。
1458 7
|
Python
Python软件包及环境管理器conda实战篇
详细介绍了如何使用conda进行Python软件包管理及环境管理,包括查看、安装、卸载软件包,切换源,管理不同版本的Python环境,以及解决使用过程中可能遇到的错误。
521 2
Python软件包及环境管理器conda实战篇
|
机器学习/深度学习 调度 计算机视觉
CompVis
【9月更文挑战第23天】
187 3
vscode——Prettier插件保存自动格式化
vscode——Prettier插件保存自动格式化
548 0
|
10月前
|
缓存 Linux
解决CentOS 7停止更新后yum源失效问题【图文教程】
以上步骤完成后,你的 CentOS 7 系统就会使用阿里云的 yum 源,更换yum以后就可以正常使用啦。
9101 2
在Linux中,ps aux 中的 VSZ 代表什么意思?RSS 代表什么意思?
在Linux中,ps aux 中的 VSZ 代表什么意思?RSS 代表什么意思?
|
自然语言处理 搜索推荐 机器人
云上数字客服:重塑客户服务体验的智能化转型
技术成熟度:目前云上数字客服技术仍在不断发展和完善中,技术成熟度有待提高。 数据安全与隐私保护:随着客户数据的不断增加,如何确保数据的安全性和隐私性成为亟待解决的问题。 人机交互体验:虽然智能客服机器人已经取得了很大进展,但在某些复杂场景下仍难以完全替代人工客服,需要不断优化人机交互体验。 五、未来展望 随着技术的不断进步和市场环境的不断变化,云上数字客服将迎来更加广阔的发展前景。未来,云上数字客服将更加注重技术的创新和应用场景的拓展,不断提升服务质量和效率;同时加强数据安全和隐私保护,确保客户信息的安全性;此外还将积极探索与其他智能系统的融合应用,如智能营销、智能供应链等,为企业提供更全面的
961 7