RD:用来区分本地VRF,该属性仅本地有效 RT:具有全局唯一性,并且只能被一个VPN使用
CE1:(CE3同样操作)
interface LoopBack0
ip address 192.168.1.1 255.255.255.0
interface GigabitEthernet0/0
port link-mode route
combo enable copper
ip address 10.1.1.2 255.255.255.0
ospf 1
area 0.0.0.0
network 10.1.1.0 0.0.0.255
network 192.168.1.0 0.0.0.255
PE1:(PE2同样操作)
ip vpn-instance h3c
route-distinguisher 100:1
vpn-target 100:1 import-extcommunity
vpn-target 100:1 export-extcommunity
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
interface GigabitEthernet0/0
port link-mode route
combo enable copper
ip address 100.1.1.1 255.255.255.0
mpls enable
mpls ldp enable
interface GigabitEthernet0/1
port link-mode route
combo enable copper
ip binding vpn-instance h3c
ip address 10.1.1.1 255.255.255.0
ospf 1
area 0.0.0.0
network 1.1.1.1 0.0.0.0
network 100.1.1.0 0.0.0.255
ospf 2 vpn-instance h3c
import-route bgp 100
area 0.0.0.0
network 10.1.1.0 0.0.0.255
mpls lsr-id 1.1.1.1
quit
mpls ldp
quit
bgp 100
peer 3.3.3.3 as-number 100
peer 3.3.3.3 connect-interface LoopBack0
address-family vpnv4
peer 3.3.3.3 enable
ip vpn-instance h3c
address-family ipv4 unicast
import-route ospf 2
P:
mpls lsr-id 2.2.2.2
quit
mpls ldp
quit
interface LoopBack0
ip address 2.2.2.2 255.255.255.255
interface GigabitEthernet0/0
port link-mode route
combo enable copper
ip address 100.1.1.2 255.255.255.0
mpls enable
mpls ldp enable
interface GigabitEthernet0/1
port link-mode route
combo enable copper
ip address 100.2.2.1 255.255.255.0
mpls enable
mpls ldp enable
ospf 1
area 0.0.0.0
network 2.2.2.2 0.0.0.0
network 100.1.1.0 0.0.0.255
network 100.2.2.0 0.0.0.255