283
[PE1-bgp-a] quit
[PE1–bgp] ipv4-family vpn-instance b
[PE1-bgp-b] import-route ospf 3
[PE1-bgp-b] import-route direct
[PE1-bgp-b] quit
[PE1–bgp] ipv4-family vpnv4
[PE1–bgp-af-vpnv4] peer 1.1.1.4 enable
[PE1–bgp-af-vpnv4] quit
[PE1–bgp] quit
With BGP peers configured on PE 1, the interfaces MTI 0 and MTI 1 will automatically obtain IP
addresses, which are the loopback interface addresses specified in the BGP peer configuration.
The PIM mode running on MTI 0 is the same as on the interfaces in VPN instance a, and the
PIM mode running on MTI 1 is the same as on the interfaces in VPN instance b.
# Configure OSPF.
[PE1] ospf 1
[PE1-ospf-1] area 0.0.0.0
[PE1-ospf-1-area-0.0.0.0] network 1.1.1.1 0.0.0.0
[PE1-ospf-1-area-0.0.0.0] network 10.10.0.0 0.0.255.255
[PE1-ospf-1-area-0.0.0.0] quit
[PE1-ospf-1] quit
[PE1] ospf 2 vpn-instance a
[PE1-ospf-2] import-route bgp
[PE1-ospf-2] area 0.0.0.0
[PE1-ospf-2-area-0.0.0.0] network 10.11.0.0 0.0.255.255
[PE1-ospf-2-area-0.0.0.0] quit
[PE1-ospf-2] quit
[PE1] ospf 3 vpn-instance b
[PE1-ospf-3] import-route bgp
[PE1-ospf-3] area 0.0.0.0
[PE1-ospf-3-area-0.0.0.0] network 10.11.0.0 0.0.255.255
[PE1-ospf-3-area-0.0.0.0] quit
[PE1-ospf-3] quit
2.
Configure PE 2:
# Configure a Router ID, enable IP multicast routing on the public network, configure an MPLS
LSR ID, and enable the LDP capability.
<PE2> system-view
[PE2] router id 1.1.1.2
[PE2] multicast routing-enable
[PE2] mpls lsr-id 1.1.1.2
[PE2] mpls
[PE2-mpls] quit
[PE2] mpls ldp
[PE2-mpls-ldp] quit
# Configure an IP address, and enable PIM-SM and LDP capability on the public network
interface VLAN-interface 2.
[PE2] interface vlan-interface 2
[PE2-Vlan-interface2] ip address 10.10.1.2 24
[PE2-Vlan-interface2] pim sm
[PE2-Vlan-interface2] mpls