您的位置:首页 > 其它

深入理解BGP peer ip-address route-policy ceshi export/import

2017-02-22 15:53 811 查看
1、理解BGP 路由引入与宣告的含义

2 试验拓扑



3 在AR3上修改路由的local-pref 属性 使 AR4到2.2.2.2 从AR3过;

AR3配置:

[AR3]acl number 2000

[AR3-acl-basic-2000]rule 5 permit source 2.0.0.0 0.255.255.255

route-policy test1 permit node 10 

 if-match acl 2000 

 apply local-preference 2000 

#

route-policy test1 permit node 20 

 apply local-preference 10 

[AR3-bgp]peer 10.4.4.1 route-policy test1 import  

此时 AR3的路由表:

<AR3>dis bgp rout

 BGP Local router ID is 10.3.3.3 

 Status codes: * - valid, > - best, d - damped,

               h - history,  i - internal, s - suppressed, S - Stale

               Origin : i - IGP, e - EGP, ? - incomplete

 Total Number of Routes: 2

      Network            NextHop        MED        LocPrf    PrefVal Path/Ogn

 *>   1.0.0.0            10.4.4.1        0          10         0      100i

 *>   2.0.0.0            10.4.4.1        0          2000       0      100i

<AR3> ----------------local-pre 属性发生改变,说明在入接口(import )修改属性会改变本设备(AR3)的路由属性

<AR4>dis bgp rout  ---同时查看AR4路由表的属性,发现AR3修改的属性传至AR4。

 *>i  2.0.0.0            10.3.3.3        0          2000       0      100i

<AR4>

-------------

进一步,配置策略让 AR4到1.1.1.1 走AR2 ,再出接口使用export修改属性,发现不会改变本设备(AR2)上的路由,只是在发出去时修改,故AR4接收到时也是修改的

AR2上配置

acl number 2000  

 rule 10 permit source 1.0.0.0 0.255.255.255  //----为什么是source ?

#

route-policy test2 permit node 10 

 if-match acl 2000 

 apply local-preference 110 

#

bgp 200

 peer 10.1.1.1 as-number 100 

 peer 10.2.2.4 as-number 200 

 #

 ipv4-family unicast

  undo synchronization

  peer 10.1.1.1 enable

  peer 10.2.2.4 enable

  peer 10.2.2.4 route-policy test2 export    -------//(AR4接收)

  peer 10.2.2.4 next-hop-local 

----------------------------------------------------------------------------------

查看AR2 路由表

<AR2>dis bgp rout 

 BGP Local router ID is 10.1.1.2 

 Status codes: * - valid, > - best, d - damped,

               h - history,  i - internal, s - suppressed, S - Stale

               Origin : i - IGP, e - EGP, ? - incomplete

 Total Number of Routes: 2

      Network            NextHop        MED        LocPrf    PrefVal Path/Ogn

 *>   1.0.0.0            10.1.1.1        0                     0      100i

 *>   2.0.0.0            10.1.1.1        0                     0      100i

<AR2>   ------// 路由表属性没有变化

查看AR2向AR4发布的路由:

<AR2>dis bgp rout peer 10.2.2.4 advertised-routes 

 BGP Local router ID is 10.1.1.2 

 Status codes: * - valid, > - best, d - damped,

               h - history,  i - internal, s - suppressed, S - Stale

               Origin : i - IGP, e - EGP, ? - incomplete

 Total Number of Routes: 1

      Network            NextHop        MED        LocPrf    PrefVal Path/Ogn

 *>   1.0.0.0            10.2.2.2        0          110        0      100i

<AR2>

查看AR4   -----// 已修改路由表属性

<AR4>dis bgp rou 

 BGP Local router ID is 10.3.3.4 

 Status codes: * - valid, > - best, d - damped,

               h - history,  i - internal, s - suppressed, S - Stale

               Origin : i - IGP, e - EGP, ? - incomplete

 Total Number of Routes: 3

      Network            NextHop        MED        LocPrf    PrefVal Path/Ogn

 *>i  1.0.0.0            10.2.2.2        0          110       0      100i

 * i                     10.3.3.3        0          10         0      100i

 *>i  2.0.0.0            10.3.3.3        0          2000       0      100i

<AR4>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: