CCIE SP—MPLS VPN Basic 2
过滤vpnv4的路由
最好设置export来控制,比较直接,更改import是被动的。
以下只是简单说明了过滤的基本用法,具体问题还要具体分析,但方法是一样的。
Rack1R3(config)#ip prefix-list per7 permit 10.1.7.0/24
Rack1R3(config)#route-map per7
Rack1R3(config-route-map)#match ip add prefix-list per7
Rack1R3(config-route-map)#set extcommunity rt 1:68
Rack1R3(config-route-map)#set extcommunity rt 1:68 ?
ASN:nn or IP-address:nn VPN extended community
additive Add to the existing extcommunity
<cr>
Rack1R3(config-route-map)#set extcommunity rt 1:68 add
Rack1R3(config-route-map)#end
Rack1R3#
Rack1R3(config)#ip vrf r5-sw1
Rack1R3(config-vrf)#export map per7
Rack1R3(config-vrf)#end
Rack1R3#clear ip bgp * sof
========================================================
Rack1R4#sh ip bgp vpn all
BGP table version is 30, local router ID is 10.1.4.4
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 Metric LocPrf Weight Path
Route Distinguisher: 1:57 (default for vrf r5-sw1)
*>i10.1.7.0/24 150.1.3.3 0 100 0 ?
Route Distinguisher: 1:68 (default for vrf r6-sw2)
*> 10.1.6.6/32 10.1.46.6 0 32768 ?
*>i10.1.7.0/24 150.1.3.3 0 100 0 ?
Rack1R4#
Rack1R4#
Rack1R4#sh ip bgp vpn all 10.1.7.0
BGP routing table entry for 1:57:10.1.7.0/24, version 26
Paths: (1 available, best #1, table r5-sw1)
Not advertised to any peer
Local
150.1.3.3 (metric 130) from 150.1.3.3 (150.1.3.3)
Origin incomplete, metric 0, localpref 100, valid, internal, best
Extended Community: RT:1:57 RT:1:68,
mpls labels in/out nolabel/25
BGP routing table entry for 1:68:10.1.7.0/24, version 27
Paths: (1 available, best #1, table r6-sw2)
Not advertised to any peer
Local, imported path from 1:57:10.1.7.0/24
150.1.3.3 (metric 130) from 150.1.3.3 (150.1.3.3)
Origin incomplete, metric 0, localpref 100, valid, internal, best
Extended Community: RT:1:57 RT:1:68,
mpls labels in/out nolabel/25
CE与PE跑BGP常见问题
CE1(AS 65001)—PE1—(AS 1)—PE2—(AS 65001)CE2
这种情况下,CE2是收不到CE1的路由的,因为AS Path中有重复,所以CE2会拒绝CE1的路由,有2种方法可以解决此问题:
1、在PE2上用as-override,此命令可以使ISP的AS覆盖用户的AS;命令配在PE2上,默认情况从PE2发出路由时AS Patch是“65001|1”,由于配置了此命令,AS Patch变更为“1|1”。但是此命令需要在ipv4 vrf的地址族下启动。
2、在CE2上用allowas-in xxx,此命令是使CE2允许相同AS的路由,后面的参数是有几个相同的AS号。
用了以上命令破坏了BGP原有的防环机制,有可能会产生环路(双CE单PE时),所以需要弥补这种问题:
应用Site of Orign, BGP防环属性。
route-map xxx permit seq
match conditions
set extcommunity sso yyy
router(config-router-af)#nei ip-adress route-map xxx in
CE与PE跑RIP常见问题
(config)router rip
(config-router)ver 2
(config-router)add ipv4 vrf XXX
(config-router-af)network classful-net
(config-router-af)no auto
(config-router-af)redistribute bgp AS-Num metric transparent
!—注意把BGP重分布到RIP中时,一定要更改Metric,因为RIP的Metric最大只有16
!—transparent的意思是RIP中的Metric在BGP透明传输,如果一个站点用RIP,另一个站点用OSPF,那么不建议用此参数。
(config-router-af)router bgp XXX
(config-router)add ipv4 vrf XXX
(config-router-af)red rip
!—把RIP重分布到BGP时不需要更改Metric