H3C Technologies H3C S10500 Series Switches User Manual
Page 226

215
# Configure the interface connected with the P device and enable LDP on the interface.
[PE1] interface vlan-interface 23
[PE1-Vlan-interface23] ip address 23.1.1.1 24
[PE1-Vlan-interface23] mpls
[PE1-Vlan-interface23] mpls ldp
[PE1-Vlan-interface23] quit
# Configure OSPF.
[PE1] ospf
[PE1-ospf-1] area 0
[PE1-ospf-1-area-0.0.0.0] network 23.1.1.1 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] network 192.2.2.2 0.0.0.0
[PE1-ospf-1-area-0.0.0.0] quit
[PE1-ospf-1] quit
# On the interface connected to CE 1, create a service instance and then establish an MPLS L2VPN
connection.
[PE1] interface ethernet 1/1
[PE1-Ethernet1/1] port access vlan 10
[PE1-Ethernet1/1] service-instance 1000
[PE1-Ethernet1/1-srv1000] encapsulation s-vid 10
[PE1-Ethernet1/1-srv1000] xconnect peer 192.3.3.3 pw-id 1000
[PE1-Ethernet1/1-srv1000] quit
[PE1-Ethernet1/1] quit
3.
Configure the P device.
[Sysname] sysname P
[P] interface loopback 0
[P-LoopBack0] ip address 192.4.4.4 32
[P-LoopBack0] quit
# Configure the MPLS LSR ID and enable MPLS globally.
[P] mpls lsr-id 192.4.4.4
[P] mpls
[P-mpls] quit
# Enable LDP globally.
[P] mpls ldp
[P-mpls-ldp] quit
# Configure the interface connected with PE 1 and enable LDP on the interface.
[P] interface vlan-interface 23
[P-Vlan-interface23] ip address 23.1.1.2 24
[P-Vlan-interface23] mpls
[P-Vlan-interface23] mpls ldp
[P-Vlan-interface23] quit
# Configure the interface connected with PE 2 and enable LDP on the interface.
[P] interface vlan-interface 26
[P-Vlan-interface26] ip address 26.2.2.2 24
[P-Vlan-interface26] mpls
[P-Vlan-interface26] mpls ldp