如果需要的话,完成下面的步骤
o重分布静态、RIP、或者OSPF路由
o重分布直连的路由
oActivate和CE路由器间的BGP邻居
3.进入address-familyvpnv4模式,完成下面的配置:
oActivatetheneighbors.Activate邻居
o指定必须使用扩展community,这是必须的.
配置
本例中的5台路由器配置如下:
Pescara
Currentconfiguration:
!
version12.2
!
hostnamePescara
!
ipcef
!
!
---Customer_A的配置.
ipvrfCustomer_A
!
---启用Customer_A的VPN路由和转发表(VRF).
rd100:
110
!
---Routedistinguishercreatesroutingandforwarding
!
---tablesforaVRF.
route-targetexport100:
1000
!
---Createslistsofimportandexportroute-targetextended
!
---communitiesforthespecifiedVRF.
route-targetimport100:
1000
!
!
---Customer_B配置.
ipvrfCustomer_B
rd100:
120
route-targetexport100:
2000
route-targetimport100:
2000
!
interfaceLoopback0
ipaddress10.10.10.4255.255.255.255
iprouterisis
!
---Customer_A的配置.
interfaceLoopback101
ipvrfforwardingCustomer_A
!
---将一个接口或者自接口和一个VRF实例关联起来.
ipaddress200.0.4.1255.255.255.0
!
---Loopback101和102使用相同的IP地址200.0.4.1.这是准许的,因为它们属于2个不用
客户的VRF
noipdirected-broadcast
!
!
---Customer_B的配置.
interfaceLoopback102
ipvrfforwardingCustomer_B
ipaddress200.0.4.1255.255.255.0
!
---Loopback101和102使用相同的IP地址200.0.4.1.这是准许的,因为它们属于2个不用
客户的VRF
noipdirected-broadcast
!
interfaceSerial2/0
noipaddress
noipdirected-broadcast
encapsulationframe-relay
nofair-queue
!
interfaceSerial2/0.1point-to-point
descriptionlinktoPauillac
bandwidth512
ipaddress10.1.1.14255.255.255.252
noipdirected-broadcast
iprouterisis
tag-switchingip
frame-relayinterface-dlci401
!
routerisis
net49.0001.0000.0000.0004.00
is-typelevel-1
!
routerbgp100
bgplog-neighbor-changes
!
---启用BGP邻居关系中断的记录.
neighbor10.10.10.6remote-as100
neighbor10.10.10.6update-sourceLoopback0
!
---配置BGP邻居.
!
!
---CustomerAandBcommands.
address-familyvpnv4
!
---进入address-familyvpnv4配置模式,配置和PE/P路由器间的MP-BGP路由会话。
neighbor10.10.10.6activate
neighbor10.10.10.6send-communityboth
!
---SendsthecommunityattributetoaBGPneighbor.
exit-address-family
!
!
---CustomerBcommands.
address-familyipv4vrfCustomer_B
!
---进入address-familyipv4的配置模式下,配置和CE间的路由会话,
redistributeconnected
noauto-summary
nosynchronization
exit-address-family
!
!
---CustomerAcommands.
address-familyipv4vrfCustomer_A
redistributeconnected
noauto-summary
nosynchronization
exit-address-family
!
ipclassless
!
end
Pesaro
Currentconfiguration:
!
version12.1
!
hostnamePesaro
!
!
---CustomerAcommands.
ipvrfCustomer_A
rd100:
110
route-targetexport100:
1000
route-targetimport100:
1000
!
!
---CustomerBcommands.
ipvrfCustomer_B
rd100:
120
route-targetexport100:
2000
route-targetimport100:
2000
!
ipcef
!
interfaceLoopback0
ipaddress10.10.10.6255.255.255.255
iprouterisis
!
---CustomerAcommands.
interfaceLoopback101
ipvrfforwardingCustomer_A
ipaddress200.0.6.1255.255.255.0
!
!
---CustomerBcommands.
interfaceLoopback102
ipvrfforwardingCustomer_B
ipaddress200.0.6.1255.255.255.0
!
!
---CustomerAcommands.
interfaceLoopback111
ipvrfforwardingCustomer_A
ipaddress200.1.6.1255.255.255.0
!
interfaceSerial0/0
noipaddress
encapsulationframe-relay
noipmroute-cache
random-detect
!
interfaceSerial0/0.1point-to-point
descriptionlinktoPomerol
bandwidth512
ipaddress10.1.1.22255.255.255.252
iprouterisis
tag-switchingip
frame-relayinterface-dlci603
!
routerisis
net49.0001.0000.0000.0006.00
is-typelevel-1
!
routerbgp100
neighbor10.10.10.4remote-as100
neighbor10.10.10.4update-sourceLoopback0
!
!
---CustomerBcommands.
address-familyipv4vrfCustomer_B
redistributeconnected
noauto-summary
nosynchronization
exit-address-family
!
!
---CustomerAcommands.
address-familyipv4vrfCustomer_A
redistributeconnected
noauto-summary
nosynchronization
exit-address-family
!
!
---CustomerAandBcommands.
address-familyvpnv4
neighbor10.10.10.4activate
neighbor10.10.10.4send-communityboth
exit-address-family
!
ipclassless
!
end
Pomerol
Currentconfiguration:
!
version12.0
!
hostnamePomerol
!
ipcef
!
interfaceLoopback0
ipaddress10.10.10.3255.255.255.255
iprouterisis
!
interfaceSerial0/1
noipaddress
noipdirected-broadcast
encapsulationframe-relay
random-detect
!
interfaceSerial0/1.1point-to-point
descriptionlinktoPauillac
ipaddress10.1.1.6255.255.255.252
noipdirected-broadcast
iprouterisis
tag-switchingmtu1520
tag-switchingip
frame-relayinterface-dlci301
!
interfaceSerial0/1.2point-to-point
descriptionlinktoPulligny
ipaddress10.1.1.9255.255.255.252
noipdirected-broadcast
iprouterisis
tag-switchingip
frame-relayinterface-dlci303
!
interfaceSerial0/1.3point-to-point
descriptionlinktoPesaro
ipaddress10.1.1.21255.255.255.252
noipdirected-broadcast
iprouterisis
tag-switchingip
frame-relayinterface-dlci306
!
routerisis
net49.0001.0000.0000.0003.00
is-typelevel-1
!
ipclassless
!
end
Pulligny
Currentconfiguration:
!
version12.1
!
hostnamePulligny
!
!
ipcef
!
!
interfaceLoopback0
ipaddress10.10.10.2255.255.255.255
!
interfaceSerial0/1
noipaddress
encapsulationframe-relay
random-detect
!
interfaceSerial0/1.1point-to-point
descriptionlinktoPauillac
ipaddress10.1.1.2255.255.255.252
iprouterisis
tag-switchingip
frame-relayinterface-dlci201
!
interfaceSerial0/1.2point-to-point
descriptionlinktoPomerol
ipaddress10.1.1.10255.255.255.252
iprouterisis
tag-switchingip
frame-relayinterface-dlci203
!
routerisis
passive-interfaceLoopback0
net49.0001.0000.0000.0002.00
is-typelevel-1
!
ipclassless
!
end
Pauillac
Currentconfiguration:
!
version12.1
!
hostnamepauillac
!
ipcef
!
interfaceLoopback0
ipaddress10.10.10.1255.255.255.255
iprouterisis
!
interfaceSerial0/0
noipaddress
encapsulationframe-relay
noipmroute-cache
tag-switchingip
nofair-queue
!
interfaceSerial0/0.1point-to-point
descriptionlinktoPomerol
bandwith512
ipaddress10.1.1.1255.255.255.252
iprouterisis
tag-switchingip
frame-relayinterface-dlci102
!
interfaceSerial0/0.2point-to-point
descriptionlinktoPullignyipaddress10.1.1.5255.255.255.252
iprouterisis
tag-switchingip
frame-relayinterface-dlci103
!
interfaceSerial0/0.3point-to-point
descriptionlinktoPescara
bandwidth512
ipaddress10.1.1.13255.255.255.252
iprouterisis
tag-switchingip
frame-relayinterface-dlci104
!
routerisis
net49.0001.0000.0000.0001.00
is-typelevel-1
!
ipclassless
!
end
检验
本节讲述了如何检查你的配置是否工作正常.
·showipvrf-VerifiesthatthecorrectVRFexists.
·showipvrfinterfaces-Verifiestheactivatedinterfaces.
·showiproutevrfCustomer_A-VerifiestheroutinginformationonthePErouters.
·traceroutevrfCustomer_A200.0.6.1-VerifiestheroutinginformationonthePErouters.
·showipbgpvpnv4tag-VerifiestheBGP.
·showipcefvrfCustomer_A200.0.6.1detail-VerifiestheroutinginformationonthePErouters.
更多的排错命令详见:
MPLSVPNSolutionTroubleshootingGuide.
下面的输出是命令showipvrf的结果
Pescara#showipvrf
NameDefaultRDInterfaces
Customer_A100:
110Loopback101
Customer_B100:
120Loopback102
下面的输出是命令showipvrfinterfaces的结果.
Pesaro#showipvrfinterfaces
InterfaceIP-AddressVRFProtocol
Loopback101200.0.6.1Customer_Aup
Loopback111200.1.6.1Customer_Aup
Loopback102200.0.6.1Customer_Bup
下面的showiproutevrf命令的结果显示在2个VPNl里面都有相同的网段200.0.6.0/24.这是因为两个VPN客户Customer_A和Customer_B使用了重叠的IP地址.
Pescara#showiproutevrfCustomer_A
Codes:
C-connected,S-static,I-IGRP,R-RIP,M-mobile,B-BGP
D-EIGRP,EX-EIGRPexternal,O-OSPF,IA-OSPFinterarea
N1-OSPFNSSAexternaltype1,N2-OSPFNSSAexternaltype2
E1-OSPFexternaltype1,E2-OSPFexternaltype2,E-EGP
i-IS-IS,L1-IS-ISlevel-1,L2-IS-ISlevel-2,ia-IS-ISinterarea
*-candidatedefault,U-per-userstaticroute,o-ODR
Gatewayoflastresortisnotset
C200.