
#configure terminal  | Enter configure mode.  | 
PE1(config)#interface lo  | Enter interface mode.  | 
PE1(config-if)#ip address 41.41.41.41/32 secondary  | Assign the IPv4 address.  | 
PE1(config-if)#exit  | Exit interface mode.  | 
PE1(config)#ip vrf vrf1  | Create a new VRF named vrf1.  | 
PE1(config-vrf)#rd 1:1  | Assign the route distinguisher (RD) value as 1:1.  | 
PE1(config-vrf)#route-target both 1:1  | Configure import and export RT for this VRF.  | 
PE1(config-vrf)#exit  | Exit interface mode.  | 
PE1(config)#interface xe23  | Enter interface mode.  | 
PE1(config-if)#ip vrf forwarding vrf1  | Bind the interface connected to the CE router with VRF vrf1.  | 
PE1(config-if)#ip address 10.1.1.1/24  | Assign the IPv4 address.  | 
PE1(config)#interface xe15  | Enter interface mode.  | 
PE1(config-if)#ip address 11.1.1.41/24  | Assign the IPv4 address.  | 
PE1(config-if)#exit  | Exit interface mode.  | 
PE1(config)#router ospf 1  | Enter router OSPF mode.  | 
PE1(config-router)#ospf router-id 41.41.41.41  | Configure OSPF router id same as loopback ip address.  | 
PE1(config-router)#network 11.1.1.0/24 area 0.0.0.0  | Define the network on which OSPF runs and associate area id.  | 
PE1(config-router)#network 41.41.41.41/32 area 0.0.0.0  | Define the network on which OSPF runs and associate area id.  | 
PE1(config-router)#exit  | Exit OSPF router mode.  | 
PE1(config-router)#router ldp   | Enter router LDP mode.  | 
PE1(config-router)#router-id 41.41.41.41  | Set the router ID to IP address 41.41.41.41  | 
PE1(config-router)#transport-address ipv4 41.41.41.41  | Configure LDP transport address same as loopback address  | 
PE1(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-if)#exit  | Exit interface mode.  | 
PE1(config-if)#router bgp 65000   | Enter BGP router mode.  | 
PE1(config-router)# bgp router-id 41.41.41.41   | Configure BGP router-id.  | 
PE1(config-router)# no bgp default ipv4-unicast  | Configure BGP peer to have no ipv4 unicast capability exchange by default.  | 
PE1(config-router)# address-family ipv4 unicast  | Enter address-family ipv4 unicast.  | 
PE1(config-router-af)# network 41.41.41.41/32   | Advertise loopback address.  | 
PE1(config-router-af)# exit-address-family  | Exit address-family ipv4 labeled-unicast.  | 
PE1(config-router)# neighbor 2.2.2.2 re-mote-as 65000   | Configure PE2-ASBR1 as an iBGP peer.  | 
PE1(config-router)# neighbor 2.2.2.2 up-date-source lo   | Update the source as loopback for iBGP peering with the remote PE2 router.  | 
PE1(config-router)# neighbor 28.28.28.28 remote-as 65001   | Configure PE4 as an eBGP peer.  | 
PE1(config-router)# neighbor 28.28.28.28 ebgp-multihop    | Configure eBGP multichip for eBGP peer PE4.  | 
PE1(config-router)# neighbor 28.28.28.28 update-source lo   | Update the source as loopback for eBGP peering with the remote PE4 router.  | 
PE1(config-router)# allocate-label all   | Configure allocate-label.  | 
PE1(config-router)# address-family ipv4 la-beled-unicast   | Enter address-family ipv4 labeled-unicast.  | 
PE1(config-router-af)# neighbor 2.2.2.2 ac-tivate   | Activate iBGP neighbor.  | 
PE1(config-router-af)# exit-address-family   | Exit address-family ipv4 labeled-unicast.  | 
PE1(config-router)# address-family vpnv4 unicast   | Enter address-family vpnv4.  | 
PE1(config-router-af)# neighbor 28.28.28.28 allow-ebgp-vpn   | Configure allow-ebgp-vpn for ebgp neighbor PE4.  | 
PE1(config-router-af)# neighbor 28.28.28.28 activate   | Activate eBGP neighbor PE4.  | 
PE1(config-router-af)# exit-address-family   | Exit address-family vpnv4.  | 
PE1(config-router)# address-family ipv4 vrf vrf1   | Enter the IPv4 address family for VRF vrf1.  | 
PE1(config-router-af)# redistribute con-nected   | Redistribute connected route.  | 
PE1(config-router-af)# exit-address-family   | Exit IPv4 VRF Address Family mode.  | 
PE1(config-router)#exit  | Exit the router mode.  | 
PE1(config)#commit  | Commit candidate configuration to be running configuration.  | 
PE1(config)#exit  | Exit the config mode.  | 
P1#configure terminal  | Enter configure mode.  | 
P1(config)#interface lo  | Enter interface mode.  | 
P1(config-if)# ip address 51.51.51.51/32 secondary  | Assign the IPv4 address.  | 
P1(config-if)#exit  | Exit interface mode.  | 
P1(config)#interface xe15  | Enter interface mode.  | 
P1(config-if)#ip address 11.1.1.31/24  | Assign the IPv4 address.  | 
P1(config-if)#exit  | Exit interface mode.  | 
P1(config)#interface xe21  | Enter interface mode.  | 
P1(config-if)#ip address 12.1.1.31/24  | Assign the IPv4 address.  | 
P1(config-if)#exit  | Exit interface mode.  | 
P1(config)#router ospf 1  | Enter router OSPF mode.  | 
P1(config-router)#ospf router-id 51.51.51.51  | Configure OSPF router id same as loopback ip address.  | 
P1(config-router)#network 11.1.1.0/24 area 0.0.0.0  | Define the network on which OSPF runs and associate area id.  | 
P1(config-router)#network 12.1.1.0/24 area 0.0.0.0  | Define the network on which OSPF runs and associate area id.  | 
P1(config-router)#network 51.51.51.51/32 area 0.0.0.0  | Define the network on which OSPF runs and associate area id.  | 
P1(config-router)#exit  | Exit router OSPF mode.  | 
P1(config-router)#router ldp  | Enter router LDP mode.  | 
P1(config-router)#router-id 51.51.51.51  | Set the router ID to IP address 51.51.51.51  | 
P1(config-router)#transport-address ipv4 51.51.51.51  |  Configure LDP transport address same as loopback address  | 
P1(config-router)#exit  | Exit LDP mode.  | 
P1(config)#interface xe15  | Enter interface mode.  | 
P1(config-if)#label-switching  | Enable label switching in interface.  | 
P1(config-if)# enable-ldp ipv4  | Enable LDP on the interface.  | 
P1(config-if)#exit  | Exit interface mode.  | 
P1(config)#interface xe21  | Enter interface mode.  | 
P1(config-if)#label-switching  | Enable label switching in interface.  | 
P1(config-if)# enable-ldp ipv4  | Enable LDP on the interface.  | 
P1(config-if)#exit  | Exit interface mode.  | 
P1(config)#commit  | Commit candidate configuration to be running configuration.  | 
P1(config)#exit  | Exit the config mode.  | 
#configure terminal  | Enter configure mode.  | 
PE2-ASBR(config)#interface lo  | Enter interface mode.  | 
PE2-ASBR(config-if)#ip address 2.2.2.2/32 secondary  | Assign the IPv4 address.  | 
PE2-ASBR(config-if)#exit  | Exit interface mode.  | 
PE2-ASBR(config)#router ospf 1  | Enter router OSPF mode.  | 
PE2-ASBR(config-router)#ospf router-id 2.2.2.2  | Configure OSPF router id same as loopback ip address.  | 
PE2-ASBR(config-router)#network 2.2.2.2/32 area 0.0.0.0  | Define the network on which OSPF runs and associate area id.  | 
PE2-ASBR(config-router)#network 12.1.1.0/24 area 0.0.0.0  | Define the network on which OSPF runs and associate area id.  | 
PE2-ASBR(config-router)#exit  | Exit router OSPF mode.  | 
PE2-ASBR(config-router)#router ldp  | Enter router LDP mode.  | 
PE2-ASBR(config-router)#router-id 2.2.2.2  | Set the router ID to IP address 2.2.2.2  | 
PE2-ASBR(config-router)#transport-address ipv4 2.2.2.2  | Configure LDP transport address same as loopback address.  | 
PE2-ASBR(config-router)#exit  | Exit LPD mode.  | 
PE2-ASBR(config)#interface xe5  | Enter interface mode.  | 
PE2-ASBR(config-if)#ip address 20.1.1.2/24  | Assign the IPv4 address.  | 
PE2-ASBR(config-if)#label-switching  | Enable label switching in interface.  | 
PE2-ASBR(config-if)#exit  | Exit interface mode.  | 
PE2-ASBR(config)#interface xe20  | Enter interface mode.  | 
PE2-ASBR(config-if)#ip address 12.1.1.2/24  | Assign the IPv4 address.  | 
PE2-ASBR(config-if)#label-switching  | Enable label switching in interface.  | 
PE2-ASBR(config-if)# enable-ldp ipv4  | Enable LDP on the interface.  | 
PE2-ASBR(config-if)#exit  | Exit interface mode  | 
PE2-ASBR(config-if)#router bgp 65000   | Enter BGP router mode.  | 
PE2-ASBR(config-router)# bgp router-id 2.2.2.2   | Configure BGP router-id.  | 
PE2-ASBR(config-router)# no bgp default ipv4-unicast   | Configure BGP to have no default ipv4 unicast capability exchange between neighbors.  | 
PE2-ASBR(config-router)# neighbor 20.1.1.40 remote-as 65001   | Configure PE3-ASBR2 as an eBGP peer.  | 
PE2-ASBR(config-router)# neighbor 41.41.41.41 remote-as 65000   | Configure PE1 as an iBGP peer.  | 
PE2-ASBR(config-router)# neighbor 41.41.41.41 update-source lo   | Update the source as loopback for iBGP peering with the remote PE1 router.  | 
PE2-ASBR(config-router)# allocate-label all   | Configure allocate-label.  | 
PE2-ASBR(config-router)# address-family ipv4 labeled-unicast   | Enter address-family ipv4 labeled-unicast.  | 
PE2-ASBR(config-router-af)# neighbor 20.1.1.40 activate   | Activate eBGP neighbor PE3-ASBR2.  | 
PE2-ASBR(config-router-af)# neighbor 41.41.41.41 activate   | Activate iBGP neighbor PE1.  | 
PE2-ASBR(config-router-af)# neighbor 41.41.41.41 next-hop-self   | Configure next-hop-self for iBGP neighbor PE1.  | 
PE2-ASBR(config-router-af)# exit-address-family   | Exit address-family ipv4 labeled-unicast.  | 
PE2(config-router)#exit  | Exit the router mode.  | 
PE2(config)#commit  | Commit candidate configuration to be running configuration.  | 
PE2(config)#exit  | Exit the config mode.  | 
PE3-ASBR#configure terminal  | Enter configure mode.  | 
PE3-ASBR(config)#interface lo  | Enter interface mode.  | 
PE3-ASBR(config-if)#ip address 40.40.40.40/32 secondary  | Assign the IPv4 address.  | 
PE3-ASBR(config-if)#exit  | Exit interface mode.  | 
PE3-ASBR(config)#interface xe5  | Enter interface mode.  | 
PE3-ASBR(config-if)#ip address 20.1.1.40/24  | Assign the IPv4 address.  | 
PE3-ASBR(config-if)#exit  | Exit interface mode.  | 
PE3-ASBR(config)#interface xe1  | Enter interface mode.  | 
PE3-ASBR(config-if)#ip address 21.1.1.40/24  | Assign the IPv4 address.  | 
PE3-ASBR(config-if)#exit  | Exit interface mode.  | 
PE3-ASBR(config)#router ospf 1  | Enter router OSPF mode.  | 
PE3-ASBR(config-router)#ospf router-id 40.40.40.40  | Configure OSPF router id same as loopback ip address.  | 
PE3-ASBR(config-router)#network 21.1.1.0/24 area 0.0.0.0  | Define the network on which OSPF runs and associate area id.  | 
PE3-ASBR(config-router)#network 40.40.40.40/32 area 0.0.0.0  | Define the network on which OSPF runs and associate area id.  | 
PE3-ASBR(config-router)#exit  | Exit router OSPF mode.  | 
PE3-ASBR(config-router)#router ldp  | Enter router LDP mode.  | 
PE3-ASBR(config-router)#router-id 40.40.40.40  | Set the router ID to IP address 40.40.40.40  | 
PE3-ASBR(config-router)#transport-address ipv4 40.40.40.40  |  Configure LDP transport address same as loopback address  | 
PE3-ASBR(config)#interface xe1  | Enter interface mode.  | 
PE3-ASBR(config-if)#label-switching  | Enable label switching in interface.  | 
PE3-ASBR(config-if)#enable-ldp ipv4  | Enable LDP on the interface.  | 
PE3-ASBR(config)#interface xe5  | Enter interface mode.  | 
PE3-ASBR(config-if)#label-switching  | Enable label switching in interface.  | 
PE3-ASBR(config-if)#router bgp 65001   | Enter BGP router mode.  | 
PE3-ASBR(config-router)# bgp router-id 40.40.40.40   | Configure BGP router-id.  | 
PE3-ASBR(config-router)# no bgp default ipv4-unicast   | Configure BGP to have no default ipv4 unicast capability exchange with the neighbors.  | 
PE3-ASBR(config-router)# neighbor 20.1.1.2 remote-as 65000   | Configure PE2-ASBR as an eBGP peer.  | 
PE3-ASBR(config-router)# neighbor 28.28.28.28 remote-as 65001   | Configure PE4 as an iBGP peer.  | 
PE3-ASBR(config-router)# neighbor 28.28.28.28 update-source lo   | Update the source as loopback for iBGP peering with the remote PE4 router.  | 
PE3-ASBR(config-router)# allocate-label all   | Configure allocate-label.  | 
PE3-ASBR(config-router)# address-family ipv4 labeled-unicast   | Enter address-family ipv4 labeled-unicast.  | 
PE3-ASBR(config-router-af)# neighbor 20.1.1.2 activate   | Activate eBGP neighbor PE2-ASBR1.  | 
PE3-ASBR(config-router-af)# neighbor 28.28.28.28 activate   | Activate iBGP neighbor PE4.  | 
PE3-ASBR(config-router-af)# neighbor 28.28.28.28 next-hop-self   | Configure next-hop-self for iBGP neighbor PE4.  | 
PE3-ASBR(config-router-af)# exit-address-family  | Exit address-family ipv4 labeled-unicast.  | 
PE3-ASBR(config-router)#exit  | Exit the router mode.  | 
PE3-ASBR(config)#commit  | Commit candidate configuration to be running configuration.  | 
PE3-ASBR(config)#exit  | Exit the config mode.  | 
#configure terminal  | Enter configure mode.  | 
P2(config)#interface lo  | Enter interface mode.  | 
P2(config-if)# ip address 6.6.6.6/32 secondary  | Assign the IPv4 address.  | 
P2(config-if)#exit  | Exit interface mode.  | 
P2(config)#interface xe0  | Enter interface mode.  | 
P2(config-if)#ip address 21.1.1.5/24  | Assign the IPv4 address.  | 
P2(config-if)#exit  | Exit interface mode.  | 
P2(config)#interface xe11  | Enter interface mode.  | 
P2(config-if)#ip address 22.1.1.5/24  | Assign the IPv4 address.  | 
P2(config-if)#exit  | Exit interface mode.  | 
P2(config)#router ospf 1  | Enter router OSPF mode.  | 
P2(config-router)#ospf router-id 6.6.6.6  | Configure OSPF router id same as loopback ip address.  | 
P2(config-router)# network 6.6.6.6/32 area 0.0.0.0  | Define the network on which OSPF runs and associate area id.  | 
P2(config-router)#network 21.1.1.0/24 area 0.0.0.0  | Define the network on which OSPF runs and associate area id.  | 
P2(config-router)#network 22.1.1.0/24 area 0.0.0.0  | Define the network on which OSPF runs and associate area id.  | 
P2(config-router)#exit  | Exit router OSPF mode.  | 
P2(config)#router ldp  | Enter router LDP mode.  | 
P2(config-router)#router-id 6.6.6.6  | Set the router ID to IP address 6.6.6.6  | 
P2(config-router)#transport-address ipv4 6.6.6.6  | Configure LDP transport address same as loopback address  | 
P2(config-router)#exit  | Exit LDP mode.  | 
P2(config)#interface xe0  | Enter interface mode.  | 
P2(config-if)#label-switching  | Enable label switching in interface.  | 
P2(config-if)# enable-ldp ipv4  | Enable LDP on the interface.  | 
P2(config-if)#exit  | Exit interface mode.  | 
P2(config)#interface xe11  | Enter interface mode.  | 
P2(config-if)#label-switching  | Enable label switching in interface.  | 
P2(config-if)# enable-ldp ipv4  | Enable LDP on the interface.  | 
P2(config-if)#exit  | Exit interface mode.  | 
P2(config)#commit  | Commit candidate configuration to be running configuration.  | 
P2(config)#exit  | Exit the config mode.  | 
#configure terminal  | Enter configure mode.  | 
PE4(config)#interface lo  | Enter interface mode.  | 
PE4(config-if)#ip address 28.28.28.28/32 secondary  | Assign the IPv4 address.  | 
PE4(config-if)#exit  | Exit interface mode.  | 
PE4(config)#ip vrf vrf1  | Create a new VRF named vrf1.  | 
PE4(config-vrf)#rd 1:1  | Assign the route distinguisher (RD) value as 1:1.  | 
PE4(config-vrf)#route-target both 1:1  | Configure import and export RTs for the VRF.  | 
PE4(config-vrf)#exit  | Exit VRF mode.  | 
PE4(config)#interface xe23  | Enter interface mode.  | 
PE4(config-if)#ip vrf forwarding vrf1  | Bind the interface connected to the CE router with VRF vrf1.  | 
PE4(config-if)#ip address 30.1.1.1/24  | Assign the IPv4 address.  | 
PE4(config-if)#exit  | Exit interface mode.  | 
PE4(config)#interface xe11  | Enter interface mode.  | 
PE4(config-if)#ip address 22.1.1.28/24  | Assign the IPv4 address.  | 
PE4(config-if)#exit  | Exit interface mode.  | 
PE4(config)#router ospf 1  | Enter router OSPF mode.  | 
PE4(config-router)#ospf router-id 28.28.28.28  | Configure OSPF router id same as loopback ip address.  | 
PE4(config-router)#network 22.1.1.0/24 area 0.0.0.0  | Define the network on which OSPF runs and associate area id.  | 
PE4(config-router)#network 28.28.28.28/32 area 0.0.0.0  | Define the network on which OSPF runs and associate area id.  | 
PE4(config-router)#exit  | Exit OSPF router mode.  | 
PE4(config)# router ldp  | Enter router LDP mode.  | 
PE4(config-router)#router-id 28.28.28.28  | Set the router ID to IP address 28.28.28.28  | 
PE4(config-router)#transport-address ipv4 28.28.28.28  | Configure LDP transport address same as loopback address  | 
PE4(config-router)#exit  | Exit LDP mode.  | 
PE4(config)#interface xe11  | Enter interface mode.  | 
PE4(config-if)#label-switching  | Enable label switching in interface.  | 
PE4(config-if)# enable-ldp ipv4  | Enable LDP on the interface.  | 
PE4(config-if)#exit  | Exit interface mode.  | 
PE4(config-if)#router bgp 65001   | Enter BGP router mode.  | 
PE4(config-router)# bgp router-id 28.28.28.28   | Configure BGP router-id.  | 
PE4(config-router)# no bgp default ipv4-unicast   | Configure BGP speaker to have no default ipv4 unicast capability exchange between neighbors.  | 
PE4(config-router)#address-family ipv4 unicast  | Enter the IPv4 unicast address family.  | 
PE4(config-router-af)#network 28.28.28.28/32   | Advertise loopback address.  | 
PE4(config-router-af)#exit-address-family  | Exit address family mode  | 
PE4(config-router)# neighbor 40.40.40.40 remote-as 65001   | Configure PE3-ASBR2 as an iBGP peer.  | 
PE4(config-router)# neighbor 40.40.40.40 update-source lo   | Update the source as loopback for iBGP peering with the remote PE3-ASBR router.  | 
PE4(config-router)# neighbor 41.41.41.41 remote-as 65000   | Configure PE1 as an eBGP peer.  | 
PE4(config-router)# neighbor 41.41.41.41 ebgp-multihop    | Configure eBGP multichip for eBGP peer PE1.  | 
PE4(config-router)# neighbor 41.41.41.41 update-source lo   | Update the source as loopback for eBGP peering with the remote PE1 router.  | 
PE4(config-router)# allocate-label all   | Configure allocate-label.  | 
PE4(config-router)# address-family ipv4 la-beled-unicast   | Enter address-family ipv4 labeled-unicast.  | 
PE4(config-router-af)# neighbor 40.40.40.40 activate   | Activate iBGP neighbor.  | 
PE4(config-router-af)# exit-address-family   | Exit address-family ipv4 labeled-unicast.  | 
PE4(config-router)# address-family vpnv4 unicast   | Enter address-family vpnv4.  | 
PE4(config-router-af)# neighbor 41.41.41.41 allow-ebgp-vpn   | Activate eBGP neighbor PE1.  | 
PE4(config-router-af)# neighbor 41.41.41.41 activate   | Configure allow-ebgp-vpn for ebgp neighbor PE1.  | 
PE4(config-router-af)# exit-address-family   | Exit address-family vpnv4.  | 
PE4(config-router)# address-family ipv4 vrf vrf1   | Enter the IPv4 address family for VRF vrf1.  | 
PE4(config-router-af)# redistribute con-nected   | Redistribute connected route.  | 
PE4(config-router-af)# exit-address-family   | Exit IPv4 VRF Address Family mode.  | 
PE4(config-router)#exit  | Exit the router mode.  | 
PE4(config)#commit  | Commit candidate configuration to be running configuration.  | 
PE4(config)#exit  | Exit the config mode.  |