zoukankan      html  css  js  c++  java
  • BGP选路第3条原则

    [理论说明]BGP选路原则第三条:优先选择本地产生的BGP路径;而本地产生的BGP有三种方式:1.通过network命令发布的 2.通过aggregate命令汇聚产生的3.通过redistribute命令重发布进来的。


    那么当同一路径通过多种方式产生该选择谁呢?CISCO给出的原则是这样的:


    Local paths that are sourced by the network or redistribute commands are preferred over local aggregates that are sourced by the aggregate-address command.


    [分解实验1]


    验证the local path from the network command is prefer to the local path from the aggregate command

    基本配置:
    R1:
    interface Loopback0
     ip address 1.1.0.1 255.255.255.0 secondary
     ip address 1.1.1.1 255.255.255.0
    !
    interface f0/0
     ip address 12.1.1.1 255.255.255.0
    !
    router bgp 12
     no synchronization
     bgp router-id 1.1.1.1
     network 1.1.0.0 mask 255.255.252.0
     network 1.1.0.0 mask 255.255.255.0
     aggregate-address 1.1.0.0 255.255.252.0
     neighbor 12.1.1.2 remote-as 12
     no auto-summary
    !
    ip classless
    ip route 1.1.0.0 255.255.252.0 Null0


    R2:


    interface f0/0
     ip address 12.1.1.2 255.255.255.0
    !
    router bgp 12
     no synchronization
     bgp router-id 2.2.2.2
     neighbor 12.1.1.1 remote-as 12
     no auto-summary


    在R1上查看BGP路由表


    R1#sh ip bg
    BGP table version is 5, local router ID is 1.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         &am p;nb sp;  Metric LocPrf Weight Path
    *> 1.1.0.0/24       0.0.0.0                    0                   32768 i
    *> 1.1.0.0/22       0.0.0.0                    0                   32768 i
    *                            0.0.0.0                                         32768 i


    R1#sh ip bg 1.1.0.0 255.255.252.0
    BGP routing table entry for 1.1.0.0/22, version 5
    Paths: (2 available, best #1, table Default-IP-Routing-Table)
      Advertised to non peer-group peers:
      12.1.1.2 
      Local
        0.0.0.0 from 0.0.0.0 (1.1.1.1)
          Origin IGP, metric 0, localpref 100, weight 32768, valid, sourced, local, best
      Local, (aggregated by 12 1.1.1.1)
        0.0.0.0 from 0.0.0.0 (1.1.1.1)
          Origin IGP, localpref 100, weight 32768, valid, aggregated, local, atomic-aggregate


    可以看到优先选择了network命令发布的条目,由此证明:network>aggregate-address


    [分解实验2]验证the local path from the redistribute command is prefer to the local path from the aggregate command


    在R1上删除netwok命令,重发布静态进入BGP表


    R1(config)#router bg 12


    R1(config-router)#no network 1.1.0.0 mask 255.255.252.0


    R1(config-router)#redistribute connected static


    这样你可以看到最终的效果如下


    R1#sh ip bg
    BGP table version is 10, local router ID is 1.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         &am p;nb sp;  Metric LocPrf Weight Path
    *> 1.1.0.0/24       0.0.0.0                    0         32768 i
    *> 1.1.0.0/22       0.0.0.0                    0         32768 ?
    *                            0.0.0.0                                32768 i


    R1#sh ip bg 1.1.0.0 255.255.252.0
    BGP routing table entry for 1.1.0.0/22, version 8
    Paths: (2 available, best #1, table Default-IP-Routing-Table)
      Advertised to non peer-group peers:
      12.1.1.2 
      Local
        0.0.0.0 from 0.0.0.0 (1.1.1.1)
          Origin incomplete, metric 0, localpref 100, weight 32768, valid, sourced, best
      Local, (aggregated by 12 1.1.1.1)
        0.0.0.0 from 0.0.0.0 (1.1.1.1)
          Origin IGP, localpref 100, weight 32768, valid, aggregated, local, atomic-aggregate


    由此可以看出redistribute>aggregate-address


    综上所述: network/redistribute>aggregate-address


    注意:当同时起源于local时,network和redistribute是不用比较的,两者不能共存,如上述实验,R1不把 network删除,就重发布静态,redistribute是没有效果的。关于这个问题的补充我会尽快回帖说明

  • 相关阅读:
    socket通信简介
    存储过程多次遍历
    js动态表格笔记
    Java excel导出笔记
    Eclipse快捷键
    oracle表,视图,存储过程,函数,序列.....查询
    Java基础笔记
    Active MQ学习笔记
    linux svn
    html中submit和button的区别
  • 原文地址:https://www.cnblogs.com/cyrusxx/p/12824228.html
Copyright © 2011-2022 走看看