BGP no-advertise

简介:
实验前推介阅读

 

 

【实验要求】

在R2上使用 community 的No-Advertise 确保 AS1、AS2、AS3能够访问互相通告的地址,并且只有R2能够访问R5的Loopback1地址155.1.58.0/24

 
【实验拓扑】

 

【实验基本配置】
1:
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 Loopback1
ip address 155.1.58.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
network 155.1.58.0 mask 255.255.255.0
neighbor 155.1.0.2 remote-as 2
no auto-summary

 
【实验前验证】
R4#show ip bgp  下面输出结果中存在155.1.58.0
<隐藏部分输出结果>
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
*> 155.1.58.0/24 155.1.146.1 0 2 1 i
*> 204.12.1.0 0.0.0.0 0 32768 i

 
R3#show ip bgp R3同样能够学习到 155.1.58.0/24 地址
<隐藏部分输出结果>
Network Next Hop Metric LocPrf Weight Path
*>i155.1.5.0/24 155.1.23.2 0 100 0 1 i
*> 155.1.37.0/24 0.0.0.0 0 32768 i
*>i155.1.58.0/24 155.1.23.2 0 100 0 1 i
*>i204.12.1.0 155.1.13.1 0 100 0 3 i

【实验配置】
注意下面的route-map配置,必须增加一条 permit20 否则route-map的默认规则是阻断所有。
在R2上配置确保匹配到 155.1.58.0/24 网络,将其community设置为no-advertise 即 不通告该路由到任何对等体(包括internel和External)
R2:
route-map NO_ADVERTISE permit 10
match ip address prefix-list VLAN58
set community no-advertise
!
route-map NO_ADVERTISE permit 20
!
router bgp 2
neighbor 155.1.0.5 route-map NO_ADVERTISE in
!
ip prefix-list VLAN58 permit 155.1.58.0/24
!
【实验验证】
R3#show ip bgp  结果中没有155.1.58.0/24 的网络
<隐藏部分输出结果>
Network Next Hop Metric LocPrf Weight Path
*>i155.1.5.0/24 155.1.23.2 0 100 0 1 i
*> 155.1.37.0/24 0.0.0.0 0 32768 i
*>i204.12.1.0 155.1.13.1 0 100 0 3 i
R4#show ip bgp  结果中没有155.1.58.0/24 的网络
<隐藏部分输出结果>
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
R1#show ip bgp
<隐藏部分输出结果>  结果中没有155.1.58.0/24 的网络
Network Next Hop Metric LocPrf Weight Path
*>i155.1.5.0/24 155.1.23.2 0 100 0 1 i
*>i155.1.37.0/24 155.1.13.3 0 100 0 i
*> 204.12.1.0 155.1.146.4 0 0 3 i
R2#show ip bgp  R2 可以学习到155.1.58.0/24的网络,但它不传给其他对等体
<隐藏部分输出结果>
Network Next Hop Metric LocPrf Weight Path
*> 155.1.5.0/24 155.1.0.5 0 0 1 i
*>i155.1.37.0/24 155.1.23.3 0 100 0 i
*> 155.1.58.0/24 155.1.0.5 0 0 1 i
*>i204.12.1.0 155.1.13.1 0 100 0 3 i
R2#show ip bgp 155.1.58.0 注意下面R2学习到的155.1.58.0 网络的community已经被标记为no-advertise
BGP routing table entry for 155.1.58.0/24, version 4
Paths: (1 available, best #1, table Default-IP-Routing-Table, not advertised to any peer)
Not advertised to any peer
1
155.1.0.5 from 155.1.0.5 (155.1.5.5)
Origin IGP, metric 0, localpref 100, valid, external, best
Community: no-advertise


本文转自zcm8483 51CTO博客,原文链接:http://blog.51cto.com/haolun/992825

相关文章
|
编解码 数据可视化
Google Earth Engine —— MODIS影像数据集分析
Google Earth Engine —— MODIS影像数据集分析
338 2
|
存储 JavaScript 前端开发
架构-单一代码库-monorepo-pnpm-workspace:基本使用
架构-单一代码库-monorepo-pnpm-workspace:基本使用
1278 0
|
11月前
|
弹性计算 负载均衡 安全
【上云基础系列-02】企业推荐!必学必会的上云标准架构(弹性架构)
本文介绍上云标准弹性架构,针对企业业务发展需求,推荐使用多服务器的弹性架构而非单体架构。方案包含负载均衡、NAT网关、云服务器ECS、云数据库RDS等组件,确保业务的负载分担、冗余备份及平滑扩展。通过统一公网暴露面管理和VPC网络设计,保障架构的稳定性、安全性和可扩展性。该架构适用于中小企业上云,避免性能瓶颈和迭代升级困难,支持业务持续发展。更多内容可参考下方演进说明总览。
|
人工智能 自然语言处理 算法
Jarvis×百炼,打造大模型智慧出行客服
本次分享由哈啰集团高级算法专家郭佳盛主讲,主题为“Jarvis×百炼,打造大模型智慧出行客服”。内容涵盖AI在智慧出行领域的应用探索、AI加持客服全链路解决方案、哈罗智能客服的大模型应用、大模型在C端与B端的应用探索,以及企业内部大模型构建与运营。通过实例和经验分享,展示了哈啰如何将大模型应用于实际业务,提升用户体验和运营效率。
|
存储 安全 算法
解密现代密码学:从基础到实战
在数字时代,保护信息安全变得至关重要。本文将带你深入探索密码学的奥秘,从基础的加密算法到现代的加密技术,揭示如何在日常开发中实现数据的安全传输和存储。我们将一起学习加密的基本原理,探讨常见的加密技术,并提供实用的代码示例,帮助你在项目中实施强大的安全措施。
|
小程序 前端开发
【非常全】微信小程序下载图片到相册,微信小程序自动获取分享图片到相册
【非常全】微信小程序下载图片到相册,微信小程序自动获取分享图片到相册
1337 3
|
机器学习/深度学习 测试技术 网络架构
YOLOv8改进 | 主干篇 | ConvNeXtV2全卷积掩码自编码器网络
YOLOv8改进 | 主干篇 | ConvNeXtV2全卷积掩码自编码器网络
682 1
YOLOv8改进 | 主干篇 | ConvNeXtV2全卷积掩码自编码器网络
|
关系型数据库 网络安全 数据库
PGPool-II+PG流复制实现HA主备切换
基于PG的流复制能实现热备切换,但是是要手动建立触发文件实现,对于一些HA场景来说,需要当主机down了后,备机自动切换,经查询资料知道pgpool-II可以实现这种功能。
3391 0
|
JavaScript
宝塔面板部署vue项目
宝塔面板部署vue项目
1798 0
|
存储 运维 Kubernetes
Kubernetes日志采集原理全方位剖析
本文将主要介绍SLS对于Kubernetes日志采集的基本原理,便于大家在实践中能够更好的规划使用方式。
3269 0
Kubernetes日志采集原理全方位剖析