333
# Create a cross-connect group named vpnb, create a local site named site 1, create a BGP
PW from site 1 to the remote site site 2, and bind Ethernet service instance 10 on
GigabitEthernet 1/0/1 to the PW.
[PE1] xconnect-group vpnb
[PE1-xcg-vpnb] auto-discovery bgp
[PE1-xcg-vpnb-auto] route-distinguisher 2:2
[PE1-xcg-vpnb-auto] vpn-target 2:2 export-extcommunity
[PE1-xcg-vpnb-auto] vpn-target 2:2 import-extcommunity
[PE1-xcg-vpnb-auto] site 1 range 10 default-offset 0
[PE1-xcg-vpnb-auto-1] connection remote-site-id 2
[PE1-xcg-vpnb-auto-1-2] ac interface GigabitEthernet 1/0/1 service-instance 10
[PE1-xcg-vpnb-auto-1-2] return
3. Configure P:
# Configure an LSR ID.
<P> system-view
[P] interface loopback 0
[P-LoopBack0] ip address 192.4.4.4 32
[P-LoopBack0] quit
[P] mpls lsr-id 192.4.4.4
# Enable LDP globally.
[P] mpls ldp
[P-ldp] quit
# Configure VLAN-interface 20 (the interface connected to PE 1), and enable LDP on the
interface.
[P] interface vlan-interface 20
[P-Vlan-interface20] ip address 10.1.1.2 24
[P-Vlan-interface20] mpls enable
[P-Vlan-interface20] mpls ldp enable
[P-Vlan-interface20] quit
# Configure VLAN-interface 30 (the interface connected to PE 2), and enable LDP on the
interface.
[P] interface vlan-interface 30
[P-Vlan-interface30] ip address 10.2.2.2 24
[P-Vlan-interface30] mpls enable
[P-Vlan-interface30] mpls ldp enable
[P-Vlan-interface30] quit
# Enable OSPF for LSP establishment.
[P] ospf
[P-ospf-1] area 0
[P-ospf-1-area-0.0.0.0] network 10.1.1.2 0.0.0.255
[P-ospf-1-area-0.0.0.0] network 10.2.2.2 0.0.0.255
[P-ospf-1-area-0.0.0.0] network 192.4.4.4 0.0.0.0
[P-ospf-1-area-0.0.0.0] quit
[P-ospf-1] quit
4. Configure PE 2:
# Configure an LSR ID.
<PE2> system-view
[PE2] interface loopback 0