【实验要求】

使用 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


 

转载于:https://blog.51cto.com/haolun/992833

BGP no-export相关推荐

  1. 详细了解BGP—边界网关协议

    BGP 一.BGP基本概念 1.自治系统 2.BGP路由协议的特点 3.BGP分类 4.BGP工作原理 4.1.5种报文 4.2.BGP6种状态机 4.3.BGP对等体之间的9个交互原则 5.建立对等 ...

  2. BGP小实验——选路不困难,只要有方法

    BGP小实验--选路不困难,只要有方法 前言 一.需求 二.命令 1.先配置基础命令,完成全网通 R1 R2 R3 R4 R5 2.查看BGP路由表 R1 R4 3.择路(我们用两种方式) R1 R3 ...

  3. 初识BGP外部网关协议(二)

    初识BGP外部网关协议(二) 前言 一.BGP路径属性 1.BGP路径分类 2.路径选择原则 二.BGP选路及配置(比较多,12种,我选出常见的3种讲解) 1.根据Local_preference控制 ...

  4. BGP综合认知及配置

    文章目录 BGP概念 自治系统AS BGP路由协议的特点: BGP分类: BGP的路由器号(Router-ID): BGP的工作原理: BGP的 5种报文: BGP的6种状态机: BGP对等体之间的9 ...

  5. BGP------BGP工作原理、BGP属性及选路原则

    BGP工作原理 一.BGP报文 1.open报文 作用:建立邻居.协商参数 open报文只在邻居建立时发送,不会周期发送 内容: version:BGP版本 My AS:自身的AS号 hold tim ...

  6. 网络基础之BGP(边界网关协议)

    这里写目录标题 一.BGP概念 1.自治系统AS 2.BGP路由协议的特点 3.BGP分类 4.BGP的路由器号(Router-ID) 5.BGP工作原理 1)BGP的5种报文 2)BGP的6种状态机 ...

  7. BGP路由之BGP选路规则

    BGP路由之BGP选路规则 一. BGP路由之BGP选路规则 1. 分类 2. BGP选路原则 3. BGP属性选路配置 3.1 根据local-prefernce控制选路( 越大越优) 3.2 使用 ...

  8. 华为路由器配置命令汇总

    VRP系统基本使用,与交换机基本相同 信息中心配置 Log.Trap.Debug信息的输出,对设备的维护与监管至关重要 配置Log信息输出,即配置指定模块的Log信息输出到Log缓冲区.日志文件.控制 ...

  9. 华为设备路由策略配置命令

    (一)配置过滤器命令 配置地址前缀列表命令 [Huawei]ip ip-prefix a1 permit 10.1.1.0 24 //配置地址前缀列表 [Huawei]ip ip-prefix a2 ...

  10. 细节决定能全网PING通————网络实验记录

    1.链路聚合(10分):SW1和SW2之间使用链路聚合互连,要求2条活跃,1条备用. 使用dis trunkmembership eth-trunk 1 验证结果. 2.MSTP(10分):正常情况下 ...

最新文章

  1. java批量下载文件为zip包
  2. AsyncTask使用方式一
  3. python基础7 (来自廖雪峰的官方网站)
  4. html传递json中文乱码,解决后台传数据到前台中文乱码问题,使用@ResponseBody返回json 中文乱码...
  5. 交换机短路_融商通达变频器功率模块短路维修故障案例
  6. Postgres 9.2.4的升级方案与步骤
  7. AutoMap1.0发布
  8. 中国水平板式过滤器行业市场供需与战略研究报告
  9. 如何才能在jsp文件中使用el表达式
  10. 杭州电子科技大学考研经验贴
  11. 微信开通检测软件的原理及使用方法
  12. 前端访问后端本地资源
  13. 猫哥教你写爬虫 008--input()函数
  14. python构建配对t检验(Paired Student’s t-test)
  15. 基于java火车购票系统
  16. 麦克阿瑟天才奖得主解码计算机视觉“原罪”:AI 如何认识人类世界
  17. edge浏览器仿真IE时发现的问题
  18. 2009北京市小学生程序设计友谊赛详细答案
  19. Resolume与MA2连接问题
  20. 可重构/大规模智能反射表面reconfigurable/large intelligent surface综述

热门文章

  1. 04-课后作业1-字符串加密
  2. 使用iperf进行设备吞吐量测试
  3. JPA 系列教程3-单向多对一
  4. C++ CGI Helloword
  5. git: command not found
  6. 浅述几年建站SEO之路的失败与反思
  7. error LNK2001: unresolved external symbol _WinMain@16
  8. QML与Qt C++ 交互机制详解
  9. C#中使用MD5对用户密码加密与解密
  10. MFC VC 双缓冲绘图基本原理与实现,详细解释