操纵BGP AS-PATH 属性案例(配图+详细验证过程)

简介:


BGP总是优先选择具有最短AS路径的路由。本案例中,我们将配置R1,将1.0.0.0通告给R2、R3之前预先添加两个额外的AS路径到1.0.0.0上(AS300、AS400)
 
具体配置如下:
//// r1 ////
int f2/0
  ip ad 192.1.1.1 255.255.255.0
 
int f3/0
  ip ad 193.1.1.1 255.255.255.0
 
int lo0
  ip ad 1.1.1.1 255.255.255.0
 
int lo1
  ip ad 2.2.2.2 255.255.255.0
 
router bgp 100
  no syn
  neighbor 192.1.1.2 remote-as 200
  neighbor 193.1.1.3 remote-as 200
  network 1.0.0.0
  network 1.0.0.0
   neighbor 193.1.1.3 route-map aspath out
 
access-list 1 permit 1.0.0.0 0.255.255.255
 
route-map aspath 10
  match ip ad 1
  set as-path prepend 300 400
route-map aspath 20
 
 
 
//// r2 ////
int f2/0
  ip ad 192.1.1.2 255.255.255.0
 
int f4/0
  ip ad 194.1.1.2 255.255.255.0
 
router os 1
  netw 0.0.0.0 255.255.255.255 a 0
  passive-interface f2/0
 
router bgp 200
  no syn
  neighbor 192.1.1.1 remote-as 100
  neighbor 194.1.1.4 remote-as 200
  neighbor 195.1.1.3 remote-as 200
  neighbor 194.1.1.4 next-hop-self
 
 
//// r3 ////
int f3/0
  ip ad 193.1.1.3 255.255.255.0
 
int f5/0
  ip ad 195.1.1.3 255.255.255.0
 
router os 1
  netw 0.0.0.0 255.255.255.255 a 0
  passive-interface f3/0
 
router bgp 200
  no syn
  neighbor 193.1.1.1 remote-as 100
  neighbor 195.1.1.4 remote-as 200
  neighbor 195.1.1.4 next-hop-self
  neighbor 194.1.1.2 remote-as 200
 
 
//// r4 ////
int f4/0
  ip ad 194.1.1.4 255.255.255.0
 
int f5/0
  ip ad 195.1.1.4 255.255.255.0
 
int lo0
  ip ad 4.4.4.4 255.255.255.0
 
router os 1
  netw 0.0.0.0 255.255.255.255 a 0
 
router bgp 200
  no syn
  neighbor 194.1.1.2 remote-as 200
  neighbor 195.1.1.3 remote-as 200
  netw 4.0.0.0
 
 
 
验证:
 
r3#sh ip b
   Network          Next Hop            Metric LocPrf Weight Path
*>i1.0.0.0          192.1.1.1                0    100      0 100 i
*                   193.1.1.1                0             0 100 300 400 i
* i2.0.0.0          192.1.1.1                0    100      0 100 i
*>                  193.1.1.1                0             0 100 i
*>i4.0.0.0          195.1.1.4                0    100      0 i
 
 
r3#sh ip ro
B    1.0.0.0/8 [200/0] via 192.1.1.1, 00:05:23
B    2.0.0.0/8 [20/0] via 193.1.1.1, 00:05:23

     4.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
O       4.4.4.4/32 [110/65] via 195.1.1.4, 00:10:38, Serial5/0
B       4.0.0.0/8 [200/0] via 195.1.1.4, 00:10:13
C    193.1.1.0/24 is directly connected, Serial3/0
O    192.1.1.0/24 [110/192] via 195.1.1.4, 00:10:38, Serial5/0
C    195.1.1.0/24 is directly connected, Serial5/0
O    194.1.1.0/24 [110/128] via 195.1.1.4, 00:10:38, Serial5/0









本文转自 ciscodocu51CTO博客,原文链接:http://blog.51cto.com/ciscodocu/52841,如需转载请自行联系原作者
目录
相关文章
|
1月前
|
传感器 运维
【软件设计师备考 专题 】编写外部设计文档:系统配置图和关系图
【软件设计师备考 专题 】编写外部设计文档:系统配置图和关系图
68 1
|
1月前
|
安全 前端开发
SSRF基础原理(浅层面解释 + 演示)
SSRF基础原理(浅层面解释 + 演示)
|
9月前
|
移动开发
微信h5扫码接口范例:多个扫码框支持的办法,通过引入一个参数来区分及使用localStorage保证之前扫到的数据不丢失
微信h5扫码接口范例:多个扫码框支持的办法,通过引入一个参数来区分及使用localStorage保证之前扫到的数据不丢失
86 0
|
前端开发 安全 数据库
【每日渗透笔记】覆盖漏洞+修改隐藏数据实战尝试
【每日渗透笔记】覆盖漏洞+修改隐藏数据实战尝试
64 0
【每日渗透笔记】覆盖漏洞+修改隐藏数据实战尝试
|
测试技术
测试应该如何处理跟开发之间的“敏感”关系?
测试从业者,打交道最多的就是开发,而测试和开发之间的关系在行业内被称为‘天敌’。最近部门内有些产品线成员和开发同事在协作之间也是双方抱怨不断,为此形成此文,算是给大家一些思路参考。 **作为测试工程师,你知道要怎么更好地来处理跟开发之间的关系么?其实对于存在这种所谓的‘敌对’关系,并不难理解。
1334 0