As described in Using LDP to Signal PW Label Mappings, MPLS and LDP must be properly configured in order to establish the PWs that make up a Layer 2 VPN.
MPLS should be enabled using the enable mpls command and LDP should be enabled using the enable mpls protocol ldp command.
Since the MPLS LSR ID is used as the local endpoint for PWs, it is highly desirable to create a loopback VLAN whose associated IP address is that of the MPLS LSR ID. The configured prefix length should be 32. As described in Establishing LDP LSPs to PW Endpoints, configuring this loopback VLAN for MPLS causes the address to be included in LDP address messages. Use the configure mpls add vlan vlan_name command for this. It is not required that LDP or MPLS be enabled on the VLAN for the address to be advertised by LDP. Use the configure mpls ldp advertise direct lsr-id command to initiate an LDP label mapping for an LDP LSP to the local endpoint.