189
# Enable LDP globally.
[PE2] mpls ldp
[PE2-mpls-ldp] quit
# Configure the peer relationship with PE 1 so that the LDP remote session can be established
between them.
[PE2] mpls ldp remote-peer 2
[PE2-mpls-ldp-remote-2] remote-ip 192.2.2.2
[PE2-mpls-ldp-remote-2] quit
# Configure the interface connected with the P device, namely GigabitEthernet 5/0/2, and
enable LDP on the interface.
[PE2] interface GigabitEthernet 5/0/2
[PE2-GigabitEthernet5/0/2] port link-mode route
[PE2-GigabitEthernet5/0/2] ip address 10.2.2.1 24
[PE2-GigabitEthernet5/0/2] mpls
[PE2-GigabitEthernet5/0/2] mpls ldp
[PE2-GigabitEthernet5/0/2] quit
# Configure OSPF on PE 2 for establishing LSPs.
[PE2] ospf
[PE2-ospf-1] area 0
[PE2-ospf-1-area-0.0.0.0] network 192.3.3.3 0.0.0.0
[PE2-ospf-1-area-0.0.0.0] network 10.2.2.0 0.0.0.255
[PE2-ospf-1-area-0.0.0.0] quit
[PE2-ospf-1] quit
# On the interface connected to CE 2, namely GigabitEthernet 5/0/1, create a Martini MPLS
L2VPN connection. The interface requires no IP address.
[PE2] interface GigabitEthernet 5/0/1
[PE2-GigabitEthernet5/0/1] port link-mode route
[PE2-GigabitEthernet5/0/1] mpls l2vc 192.2.2.2 101
[PE2-GigabitEthernet5/0/1] quit
5.
Configure CE 2.
<Sysname> system-view
[Sysname] sysname CE2
[CE2] interface GigabitEthernet 5/0/1
[CE2-GigabitEthernet5/0/1] port link-mode route
[CE2-GigabitEthernet5/0/1] ip address 100.1.1.2 24
6.
Verify your configuration.
Display L2VPN connection information on PE 1 or PE 2. You can see an L2VC has been
established. CE 1 and CE 2 can ping each other.
# Display L2VPN connection information on PE 1.
[PE1] display mpls l2vc
Total ldp vc : 1 1 up 0 down 0 blocked
Transport Client Service VC Local Remote
VC ID Intf ID State VC Label VC Label
101 GE5/0/1 -- up 65880 65674
# Display L2VPN connection information on PE 2.
[PE2] display mpls l2vc