424
[P-LoopBack0] ip address 192.4.4.4 32
[P-LoopBack0] quit
[P] mpls lsr-id 192.4.4.4
# Enable global LDP.
[P] mpls ldp
[P-ldp] quit
# Configure GigabitEthernet 1/1/1 (the interface connected to PE 1), and enable LDP on the
interface.
[P] interface gigabitethernet 1/1/1
[P-GigabitEthernet1/1/1] ip address 10.1.1.2 24
[P-GigabitEthernet1/1/1] mpls enable
[P-GigabitEthernet1/1/1] mpls ldp enable
[P-GigabitEthernet1/1/1] quit
# Configure GigabitEthernet 1/1/2 (the interface connected to PE 2), and enable LDP on the
interface.
[P] interface gigabitethernet 1/1/2
[P-GigabitEthernet1/1/2] ip address 10.2.2.2 24
[P-GigabitEthernet1/1/2] mpls enable
[P-GigabitEthernet1/1/2] mpls ldp enable
[P-GigabitEthernet1/1/2] quit
# Configure OSPF for LDP to create LSPs.
[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
[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
# Enable global LDP.
[PE2] mpls ldp
[PE2-ldp] quit
# Configure GigabitEthernet 1/1/2 (the interface connected to the P device), and enable LDP on
the interface.
[PE2] interface gigabitethernet 1/1/2
[PE2-GigabitEthernet1/1/2] ip address 10.2.2.1 24
[PE2-GigabitEthernet1/1/2] mpls enable
[PE2-GigabitEthernet1/1/2] mpls ldp enable
[PE2-GigabitEthernet1/1/2] quit
# Configure OSPF for LDP to create LSPs.