353
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
# Configure VLAN-interface 20 (the interface connected to PE 1), and enable MPLS 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] quit
# Configure VLAN-interface 30 (the interface connected to PE 2), and enable MPLS 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] quit
# Configure a static LSP to forward packets from PE 1 to PE 2.
[P] static-lsp transit pe1-pe2 in-label 201 nexthop 10.2.2.1 out-label 202
# Configure a static LSP to forward packets from PE 2 to PE 1.
[P] static-lsp transit pe2-pe1 in-label 102 nexthop 10.1.1.1 out-label 101
4.
Configure PE 2:
# Configure an LSR ID.
<PE2> system-view
[PE2] interface loopback 0
[PE2-LoopBack0] ip address 192.3.3.3 32
[PE2-LoopBack0] quit
[PE2] mpls lsr-id 192.3.3.3
# Enable L2VPN.
[PE2] l2vpn enable
# Configure VLAN-interface 30 (the interface connected to P), and enable MPLS on the interface.
[PE2] interface vlan-interface 30
[PE2-Vlan-interface30] ip address 10.2.2.1 24
[PE2-Vlan-interface30] mpls enable
[PE2-Vlan-interface30] quit
# Create VLAN 10 and assign Ten-GigabitEthernet 1/0/1 to the VLAN.
[PE2] vlan 10
[PE2-vlan10] port ten-gigabitethernet 1/0/1
[PE2-vlan10] quit
# Create Ethernet service instance 10 on Ten-GigabitEthernet 1/0/1 to match packets that have
an outer VLAN ID of 10.
[PE2] interface ten-gigabitethernet 1/0/1
[PE2-Ten-GigabitEthernet1/0/1] service-instance 10
[PE2-Ten-GigabitEthernet1/0/1-srv10] encapsulation s-vid 10