深入理解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>
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>
相关文章推荐
- Cisco secondary ip address 理解
- 深入理解BGP同步
- 深入理解Linux网络技术内幕——L4层协议与Raw IP的处理
- 结合Wireshark捕获分组深入理解TCP/IP协议之IP协议
- 深入理解 Python import
- 路由配置:理解secondary ip address
- 深入理解HTTP一:网络基础TCP/IP
- 深入理解动态选路协议——RIP、OSPF和BGP协议
- 转_结合Wireshark捕获分组深入理解TCP/IP协议之IP协议
- 深入理解node.js的module.export 和 export方法的区别
- ip policy route-map 和 ip local policy route-map 的区别?
- 深入理解HTTP TCP/IP Socket
- TCP/IP体系结构深入理解
- 路由配置:理解secondaryipaddress
- 深入理解BGP的几个路由特性(试读连载六) 推荐
- 深入理解BGP的几个路由特性(试读连载六)
- 结合Wireshark捕获分组深入理解TCP/IP协议之IP协议
- 深入理解CSS中的@import
- 深入理解编译注解(五)RetentionPolicy.SOURCE 和 RetentionPolicy.CLASS区别讨论