[R2-vpn-instance-site1]route-distinguisher 1:1 >定义RD[R2-vpn-instance-site1-af-ipv4]q
[R2-vpn-instance-site1]vpn-target 1:2 export-extcommunity ###定义rt
EVT Assignment result:
Info: VPN-Target assignment is successful.
[R2-vpn-instance-site1]vpn-target 2:1 im
IVT Assignment result:
Info: VPN-Target assignment is successful.
[R2-vpn-instance-site1]q
[R2]int e0/0/0
[R2-Ethernet0/0/0]ip binding vpn-instance site1 ####把接口加入到vpn-instance
[R2-Ethernet0/0/0]ip add 12.1.1.2 255.255.255.0
[R4]ip vpn-instance site2
[R4-vpn-instance-site2]route-distinguisher 2:2
[R4-vpn-instance-site2-af-ipv4]q
[R4-vpn-instance-site2]vpn-target 1:2 import-extcommunity
IVT Assignment result:
Info: VPN-Target assignment is successful.
[R4-vpn-instance-site2]vpn-target 2:1 export
[R4]int e0/0/1
[R4-Ethernet0/0/1]ip binding vpn-instance site2
④启用pe-ce路由协议
CE配置
[R1]ospf 1 rou 1.1.1.1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]net 10.1.1.0 0.0.0.255
[R1-ospf-1-area-0.0.0.0]net 1.1.1.1 0.0.0.0
[R1-ospf-1-area-0.0.0.0]net 12.1.1.1 0.0.0.0
[R5]ospf 1 rou 5.5.5.5
[R5-ospf-1]area 0
[R5-ospf-1-area-0.0.0.0]net 5.5.5.5 0.0.0.0
[R5-ospf-1-area-0.0.0.0]net 45.1.1.0 0.0.0.255
[R5-ospf-1-area-0.0.0.0]net 10.1.2.0 0.0.0.255
PE配置
[R2]ospf 2 vpn site1
[R2-ospf-2]area 0
[R2-ospf-2-area-0.0.0.0]net 12.1.1.2 0.0.0.0
[R2-ospf-2-area-0.0.0.0]q
[R4]ospf 2 vpn-instance site2
[R4-ospf-2]area 0
[R4-ospf-2-area-0.0.0.0]net 45.1.1.4 0.0.0.0
查看ospf邻居
[R1]dis ospf peer b
OSPF Process 1 with Router ID 1.1.1.1
Peer Statistic Information
----------------------------------------------------------------------------
Area Id Interface Neighbor id State
0.0.0.0 Ethernet0/0/0 12.1.1.2Full
----------------------------------------------------------------------------
[R5] dis ospf peer
OSPF Process 1 with Router ID 5.5.5.5
Neighbors
Area 0.0.0.0 interface 45.1.1.5(Ethernet0/0/0)'s neighbors
Router ID: 45.1.1.4 Address: 45.1.1.4
State: Full Mode:Nbr is Master Priority: 1
DR: 45.1.1.5 BDR: 45.1.1.4 MTU: 0
Dead timer due in 40 sec
Retrans timer interval: 5
Neighbor is up for 00:21:19