
#configure terminal  | Enter configure mode.  | 
(config)#interface lo  | Enter interface mode.  | 
(config-if)#ip address 2.2.2.2/32 secondary  | Assign the IPv4 address.  | 
(config-if)#exit  | Exit interface mode.  | 
(config)#ip vrf vrf1  | Create a new VRF named vrf1.  | 
(config-vrf)#rd 1:1  | Assign the route distinguisher (RD) value as 1:1.  | 
(config-vrf)#route-target both 1:1  | Import routes between route target (RT) ext-communities.  | 
(config-vrf)#exit  | Exit VRF mode.  | 
(config)#interface xe22  | Enter interface mode.  | 
(config-if)#ip vrf forwarding vrf1  | Bind the interface connected to the CE router with VRF vrf1.  | 
(config-if)#ip address 10.1.1.2/24  | Assign the IPv4 address.  | 
(config-if)#exit  | Exit interface mode.  | 
(config)#interface xe20  | Enter interface mode.  | 
(config-if)#ip address 11.1.1.2/24  | Assign the IPv4 address.  | 
(config-if)#exit  | Exit interface mode.  | 
(config)#router ospf 1  | Enter router OSPF mode.  | 
(config-router)#ospf router-id 2.2.2.2  | Configure OSPF router id same as loopback ip address.  | 
(config-router)#network 2.2.2.2/32 area 0  | Define the network on which OSPF runs and associate area id.  | 
(config-router)#network 11.1.1.0/24 area 0  | Define the network on which OSPF runs and associate area id.  | 
(config-router)#exit  | Exit OSPF router mode.  | 
(config)#router ldp  | Enter router LDP mode.  | 
(config-router)#router-id 2.2.2.2  | Set the router ID to IP address 2.2.2.2  | 
(config-router)#transport-address ipv4 2.2.2.2  | Configure the transport address for IPV4 (for IPV6 use ipv6) to be used for a TCP session over which LDP will run.  Note:	It is preferable to use the loopback address as the transport address  | 
(config-router)#targeted-peer ipv4 41.41.41.41  | Configure targeted peer.  | 
(config-router)#targeted-peer ipv4 3.3.3.3  | Configure targeted peer.  | 
(config-router-targeted-peer)#targeted-peer ipv4 5.5.5.5  | Configure targeted peer.  | 
(config-router-targeted-peer)#targeted-peer ipv4 41.41.41.41   | Configure targeted peer.  | 
(config-router-targeted-peer)#exit  | Exit-targeted-peer-mode.  | 
(config-router)#exit  | Exit router mode  | 
(config)#interface xe20  | Enter interface mode.  | 
(config-if)#label-switching  | Enable label switching in interface.  | 
(config-if)#enable-ldp ipv4  | Enable LDP in interface.  | 
(config-if)#exit  | Exit interface mode.  | 
(config)#router bgp 65000  | Enter BGP router mode.  | 
(config-router)#bgp router-id 2.2.2.2  | Configure BGP router-id.  | 
(config-router)#neighbor 41.41.41.41 remote-as 65000  | Configure PE2-ASBR1 as an iBGP peer.  | 
(config-router)#neighbor 41.41.41.41 update-source lo  | Update the source as loopback for iBGP peering with the remote PE2 router.  | 
(config-router)#address-family vpnv4  | Enter VPNv4 address family mode.  | 
(config-router-af)#neighbor 41.41.41.41 activate  | Activate the PE neighbor so that it can accept VPN IPv4 routes.  | 
(config-router-af)#exit  | Exit VPNv4 address family mode.  | 
(config-router)#address-family ipv4 vrf vrf1  | Enter the IPv4 address family for VRF vrf1.  | 
(config-router-af)#redistribute connected  | Redistribute connected route.  | 
(config-router-af)#commit  | Commit the transaction.  | 
(config-router-af)#exit-address-family  | Exit address family mode.  | 
(config-router)#exit  | Exit the router mode.  | 
(config)#commit  | Commit candidate configuration to be running configuration.  | 
(config)#exit  | Exit the config mode.  | 
#configure terminal  | Enter configure mode.  | 
(config)#interface lo  | Enter interface mode.  | 
(config-if)#ip address 31.31.31.31/32 secondary  | Assign the IPv4 address.  | 
(config-if)#exit  | Exit interface mode.  | 
(config)#interface xe21  | Enter interface mode.  | 
(config-if)#ip address 11.1.1.31/24  | Assign the IPv4 address.  | 
(config-if)#exit  | Exit interface mode.  | 
(config)#interface xe15  | Enter interface mode.  | 
(config-if)#ip address 12.1.1.31/24  | Assign the IPv4 address.  | 
(config-if)#exit  | Exit interface mode.  | 
(config)#router ospf 1  | Enter router OSPF mode.  | 
(config-router)#ospf router-id 31.31.31.31  | Configure OSPF router id same as loopback ip address.  | 
(config-router)#network 31.31.31.31/32 area 0  | Define the network on which OSPF runs and associate area id.  | 
(config-router)#network 11.1.1.0/24 area 0  | Define the network on which OSPF runs and associate area id.  | 
(config-router)#network 12.1.1.0/24 area 0  | Define the network on which OSPF runs and associate area id.  | 
(config-router)#exit  | Exit OSPF router mode.  | 
(config)#router ldp  | Enter router LDP mode.  | 
(config-router)#router-id 31.31.31.31    | Set the router ID to IP address 31.31.31.31  | 
(config-router)#transport-address ipv4 31.31.31.31   | Configure LDP transport address same as loopback address.  | 
(config-router)#exit  | Exit LDP mode.  | 
(config)#interface xe21  | Enter interface mode.  | 
(config-if)#label-switching  | Enable label switching in interface.  | 
(config-if)#enable-ldp ipv4  | Enable LDP in interface.  | 
(config-if)#exit  | Exit interface mode.  | 
(config)#interface xe15  | Enter interface mode.  | 
(config-if)#label-switching  | Enable label switching in interface.  | 
(config-if)#enable-ldp ipv4  | Enable LDP in interface.  | 
(config-if)#commit  | Commit the transaction.  | 
(config-if)#exit  | Exit interface mode.  | 
(config)#commit  | Commit candidate configuration to be running configuration.  | 
(config)#exit  | Exit the config mode.  | 
#configure terminal  | Enter configure mode.  | 
(config)#interface lo  | Enter interface mode.  | 
(config-if)#ip address 41.41.41.41/32 secondary  | Assign the IPv4 address.  | 
(config-if)#exit  | Exit interface mode.  | 
(config)#router ldp  | Enter router mode for LDP.  | 
(config-router)#router-id 41.41.41.41  | Set the router ID to IP address 41.41.41.41  | 
(config-router)#transport-address ipv4 41.41.41.41  | Configure the transport address for IPV4 (for IPV6 use ipv6) to be used for a TCP session over which LDP will run.  Note:	It is preferable to use the loopback address as the transport address.  | 
(config-router)#targeted-peer ipv4 2.2.2.2  | Configure targeted peer.  | 
(config-router-targeted-peer)#targeted-peer ipv4 3.3.3.3  | Configure targeted peer.  | 
(config-router-targeted-peer)#targeted-peer ipv4 5.5.5.5  | Configure targeted peer.  | 
(config-router-targeted-peer)#exit  | Exit-targeted-peer-mode  | 
(config-router)#exit  |  Exit router mode.  | 
(config)#interface xe15  | Enter interface mode.  | 
(config-if)#ip address 12.1.1.41/24  | Assign ipv4 address.  | 
(config-if)#exit  | Exit interface mode.  | 
(config)#router ospf 1  | Enter router OSPF mode.  | 
(config-router)#ospf router-id 41.41.41.41  | Configure OSPF router id same as loopback ip address.  | 
(config-router)#network 41.41.41.41/32 area 0  | Define the network on which OSPF runs and associate area id.  | 
(config-router)#network 12.1.1.0/24 area 0  | Define the network on which OSPF runs and associate area id.  | 
(config-router)#exit  | Exit OSPF router mode.  | 
(config)#interface xe15  | Enter interface mode.  | 
(config-if)#label-switching  | Enable label switching in interface.  | 
(config-if)#enable-ldp ipv4  | Enable LDP in interface.  | 
(config-if)#exit  | Exit interface mode.  | 
(config)#interface xe21  | Enter interface mode.  | 
(config-if)#ip address 20.1.1.41/24  | Assign the IPv4 address.  | 
(config-if)#label-switching  | Enable label switching in interface.  | 
(config-if)#exit  | Exit interface mode.  | 
(config)#router bgp 65000  | Enter BGP router mode.  | 
(config-router)#bgp router-id 41.41.41.41  | Configure BGP router-id.  | 
(config-router)#no bgp inbound-route-filter  | Disable inbound route filter.  | 
(config-router)#neighbor 2.2.2.2 remote-as 65000  | Configure PE1 as an iBGP peer.  | 
(config-router)#neighbor 2.2.2.2 update-source lo  | Update the source as loopback for iBGP peering with the remote PE1 router.  | 
(config-router)#neighbor 20.1.1.3 remote-as 65001  | Configure eBGP neighbor with ASBR2.  | 
(config-router)#address-family vpnv4  | Enter VPNv4 address family mode.  | 
(config-router-af)#neighbor 2.2.2.2 activate  | Activate the PE neighbor so that it can accept VPN IPv4 routes.  | 
(config-router-af)#neighbor 2.2.2.2 next-hop-self  | Configure this to make the router the next hop for a BGP neighbor.  | 
(config-router-af)#neighbor 20.1.1.3 activate  | Activate the ASBR eBGP neighbor.  | 
(config-router-af)#neighbor 20.1.1.3 allow-ebgp-vpn  | Configure this to allow exchange of VPN updates between eBGP peers.  | 
(config-router-af)#neighbor 20.1.1.3 activate  | Activate the ASBR eBGP neighbor.  | 
(config-router-af)#commit  | Commit candidate configuration to the running configuration.  | 
#configure terminal  | Enter configure mode.  | 
(config)#interface lo  | Enter interface mode.  | 
(config-if)#ip address 3.3.3.3/32 secondary  | Assign the IPv4 address.  | 
(config-if)#exit  | Exit interface mode.  | 
(config)#router ldp  | Enter router mode for LDP.  | 
(config-router)#router-id 3.3.3.3  | Set the router ID to IP address 3.3.3.3  | 
(config-router)#transport-address ipv4 3.3.3.3  | Configure the transport address for IPV4 (for IPV6 use ipv6) to be used for a TCP session over which LDP will run.  Note:	It is preferable to use the loopback address as the transport address.  | 
(config-router)#targeted-peer ipv4 2.2.2.2  | Configure targeted peer.  | 
(config-router-targeted-peer)#targeted-peer ipv4 41.41.41.41  | Configure targeted peer.  | 
(config-router-targeted-peer)#targeted-peer ipv4 5.5.5.5  |  Configure targeted peer.  | 
(config-router-targeted-peer)#exit  | Exit-targeted-peer-mode  | 
(config-router)#exit  | Exit router mode  | 
(config)#interface xe21  | Enter interface mode.  | 
(config-if)#ip address 20.1.1.3/24  | Assign the IPv4 address.  | 
(config-if)#exit  | Exit interface mode.  | 
(config)#interface xe15  | Enter interface mode.  | 
(config-if)#ip address 21.1.1.3/24  | Assign the IPv4 address.  | 
(config-if)#exit  | Exit interface mode.  | 
(config)#router ospf 1  | Enter router OSPF mode.  | 
(config-router)#ospf router-id 3.3.3.3  | Configure OSPF router id same as loopback ip address.  | 
(config-router)#network 3.3.3.3/32 area 0  | Define the network on which OSPF runs and associate area id.  | 
(config-router)#network 21.1.1.0/24 area 0  | Define the network on which OSPF runs and associate area id.  | 
(config-router)#exit  | Exit OSPF router mode.  | 
(config)#router ldp  | Enter router ldp mode.  | 
(config-router)#transport-address ipv4 3.3.3.3  | Configure LDP transport address same as loopback address  | 
(config-router)#exit  | Exit LDP mode.  | 
(config)#interface xe15  | Enter interface mode.  | 
(config-if)#label-switching  | Enable label switching in interface.  | 
(config-if)#enable-ldp ipv4  | Enable LDP in interface.  | 
(config-router)#exit  | Exit LDP mode.  | 
(config)#interface xe21  | Enter interface mode.  | 
(config-if)#label-switching  | Enable label switching in interface.  | 
(config-if)#exit  | Exit interface mode.  | 
(config)#router bgp 65001  | Enter BGP router mode.  | 
(config-router)#bgp router-id 3.3.3.3  | Configure BGP router-id.  | 
(config-router)#no bgp inbound-route-filter  | Disable inbound route filter.  | 
(config-router)#neighbor 5.5.5.5 remote-as 65001  | Configure PE4 as an iBGP peer.  | 
(config-router)#neighbor 5.5.5.5 update-source lo  | Update the source as loopback for iBGP peering with the remote PE1 router.  | 
(config-router)#neighbor 20.1.1.41 remote-as 65000  | Configure eBGP neighbor with PE4.  | 
(config-router)#address-family vpnv4  | Enter VPNv4 address family mode.  | 
(config-router-af)#neighbor 5.5.5.5 activate  | Activate the PE neighbor so that it can accept VPN IPv4 routes.  | 
(config-router-af)#neighbor 5.5.5.5 next-hop-self  | Configure this to make the router the next hop for a BGP neighbor.  | 
(config-router-af)#neighbor 20.1.1.41 activate  | Activate the ASBR eBGP neighbor.  | 
(config-router-af)#neighbor 20.1.1.41  allow-ebgp-vpn  | Configure this to allow exchange of vpn updates between eBGP peers.  | 
(config-router-af)#neighbor 20.1.1.41 activate  | Activate the ASBR eBGP neighbor.  | 
(config-router-af)#commit  | Commit candidate configuration to be running configuration.  | 
#configure terminal  | Enter configure mode.  | 
(config)#interface lo  | Enter interface mode.  | 
(config-if)#ip address 40.40.40.40/32 secondary  | Assign the IPv4 address.  | 
(config-if)#exit  | Exit interface mode.  | 
(config)#router ldp  | Enter router mode for LDP.  | 
(config-router)#router-id 40.40.40.40  | Set the router ID to IP address 40.40.40.40  | 
(config-router)#transport-address ipv4 40.40.40.40  | Configure the transport address for IPV4 (for IPV6 use ipv6) to be used for a TCP session over which LDP will run. Note:	It is preferable to use the loopback address as the transport address.  | 
(config-router)#targeted-peer ipv4 40.40.40.40  | Configure targeted peer.  | 
(config-router-targeted-peer)#exit  | Exit-targeted-peer-mode   | 
(config-router)#exit  | Exit router mode  | 
(config)#interface xe21  | Enter interface mode.  | 
(config-if)#ip address 21.1.1.40/24  | Assign the IPv4 address.  | 
(config-if)#exit (config-router)#targeted-peer ipv4 40.40.40.40  | Exit interface mode.  | 
(config)#interface xe15  | Enter interface mode.  | 
(config-if)#ip address 22.1.1.40/24  | Assign the IPv4 address.  | 
(config-if)#exit  | Exit interface mode.  | 
(config)#router ospf 1  | Enter router OSPF mode.  | 
(config-router)#ospf router-id 40.40.40.40  | Configure OSPF router id same as loopback ip address.  | 
(config-router)#network 40.40.40.40/32 area 0  | Define the network on which OSPF runs and associate area id.  | 
(config-router)#network 21.1.1.0/24 area 0  | Define the network on which OSPF runs and associate area id.  | 
(config-router)#network 22.1.1.0/24 area 0  | Define the network on which OSPF runs and associate area id.  | 
(config-router)#exit  | Exit OSPF router mode.  | 
(config)#router ldp  | Enter router LDP mode.  | 
(config-router)#transport-address ipv4 40.40.40.40   | Configure LDP transport address same as loopback address.  | 
(config-router)#exit  | Exit LDP mode.  | 
(config)#interface xe21  | Enter interface mode.  | 
(config-if)#label-switching  | Enable label switching in interface.  | 
(config-if)#enable-ldp ipv4  | Enable ldp in interface.  | 
(config-if)#exit  | Exit interface mode.  | 
(config)#interface xe15  | Enter interface mode.  | 
(config-if)#label-switching  | Enable label switching in interface.  | 
(config-if)#enable-ldp ipv4  | Enable LDP in interface.  | 
(config-if)#commit  | Commit the transaction.  | 
(config-if)#exit  | Exit interface mode.  | 
(config)#commit  | Commit candidate configuration to be running configuration.  | 
(config)#exit  | Exit the config mode.  | 
#configure terminal   | Enter configure mode.  | 
(config)#interface lo   | Enter interface mode.  | 
(config-if)#ip address 5.5.5.5/32 secondary   | Assign the IPv4 address.  | 
(config-if)#exit  | Exit interface mode.  | 
(config)#router ldp  | Enter router mode for LDP.  | 
(config-router)#router-id 5.5.5.5  | Set the router ID to IP address 5.5.5.5  | 
(config-router)#transport-address ipv4 5.5.5.5  | Configure the transport address for IPV4 (for IPV6 use ipv6) to be used for a TCP session over which LDP will run.  Note:	It is preferable to use the loopback address as the transport address.  | 
(config-router)#targeted-peer ipv4 5.5.5.5  | Configure targeted peer.  | 
(config-router-targeted-peer)# targeted-peer ipv4 2.2.2.2  | Configure targeted peer.  | 
(config-router-targeted-peer)# targeted-peer ipv4 41.41.41.41  | Configure targeted peer.  | 
(config-router-targeted-peer)# targeted-peer ipv4 3.3.3.3  | Configure targeted peer.  | 
(config-router)#exit  | Exit router mode  | 
(config)#ip vrf vrf1  | Create a new VRF named vrf1.  | 
(config-vrf)#rd 1:1  | Assign the route distinguisher (RD) value as 1:1.  | 
(config-vrf)#route-target both 1:1  | Import routes between route target (RT) ext-communities.  | 
(config-vrf)#exit  | Exit VRF mode.  | 
(config)#interface xe22  | Enter interface mode.  | 
(config-if)#ip vrf forwarding vrf1  | Bind the interface connected to the CE router with VRF vrf1.  | 
(config-if)#ip address 30.1.1.5/24  | Assign the IPv4 address.  | 
(config-if)#exit  | Exit interface mode.  | 
(config)#interface xe15  | Enter interface mode.  | 
(config-if)#ip address 22.1.1.5/24  | Assign the IPv4 address.  | 
(config-if)#exit  | Exit interface mode.  | 
(config)#router ospf 1  | Enter router OSPF mode.  | 
(config-router)#ospf router-id 5.5.5.5  | Configure OSPF router id same as loopback ip address.  | 
(config-router)#network 5.5.5.5/32 area 0  | Define the network on which OSPF runs and associate area id.  | 
(config-router)#network 22.1.1.0/24 area 0  | Define the network on which OSPF runs and associate area id.  | 
(config-router)#exit  | Exit OSPF router mode.  | 
(config)#interface xe15  | Enter interface mode.  | 
(config-if)#label-switching  | Enable label switching in interface.  | 
(config-if)#enable-ldp ipv4  | Enable LDP in interface.  | 
(config-if)#exit  | Exit interface mode.  | 
(config)#router bgp 65001  | Enter BGP router mode.  | 
(config-router)#bgp router-id 5.5.5.5  | Configure BGP router-id.  | 
(config-router)#neighbor 3.3.3.3 remote-as 65001  | Configure PE2-ASBR1 as an iBGP peer.  | 
(config-router)#neighbor 3.3.3.3 update-source lo  | Update the source as loopback for iBGP peering with the remote PE2 router.  | 
(config-router)#address-family vpnv4  | Enter VPNv4 address family mode.  | 
(config-router-af)#neighbor 3.3.3.3 activate  | Activate the PE neighbor so that it can accept VPN IPv4 routes.  | 
(config-router-af)#exit  | Exit VPNv4 address family mode.  | 
(config-router)#address-family ipv4 vrf vrf1  | Enter the IPv4 address family for VRF vrf1.  | 
(config-router-af)#redistribute connected  | Redistribute connected route.  | 
(config-router-af)#commit  | Commit the transaction.  | 
(config-router-af)#exit-address-family  | Exit address family mode.  | 
(config-router)#exit  | Exit the router mode.  | 
(config)#commit  | Commit candidate configuration to be running configuration.  | 
(config)#exit  | Exit the config mode.  |