
#configure terminal  | Enter configuration mode.  | 
(config)#interface lo  | Enter the Interface mode for the loopback interface.  | 
(config-if)# ip address 1.1.1.1/32 secondary  | Configure IP address on loopback interface.  | 
(config-if)# prefix-sid index 1  | Configuring prefix sid for segment id  | 
(config-if)#commit  | Commit the transaction.  | 
(config-if)#exit  | Exit interface mode  | 
#configure terminal  | Enter configuration mode.  | 
(config)#load-balance enable  | Enable Load balance  | 
(config)#hardware-profile filter evpn-mpls-mh enable  | Enable hardware profile for evpn mpls multihoming  | 
(config)#evpn mpls enable  | Enable EVPN MPLS  | 
(config)#evpn mpls irb  | Enable EVPN MPLS IRB  | 
(config)#evpn mpls multihoming enable  | Enable EVPN MPLS multihoming  | 
(config)#evpn mpls vtep-ip-global 1.1.1.1  | Configuring VTEP global IP to loopback IP  | 
(config)#evpn irb-forwarding anycast-gateway-mac 0011.2233.4466  | Confiiguring anycast gateway mac for MH. Note: Anycast gateway is mandatory for MH nodes.  | 
(config)#commit  | Commit candidate configuration to be running configuration Note: Reload is required after Enabling/Disabling EVPN MPLS Feature.  | 
(config)#segment-routing  | Configure segment routing  | 
(config-sr)# mpls sr-prefer  | Set mpls prefer segment routing over other protocols  | 
(config-sr)#exit  | Exit from router sr mode   | 
(config)#commit  | Commit the transaction.  | 
(config)#router ldp  | Enter the Router LDP mode.  | 
(config-router)# transport-address ipv4 1.1.1.1  | Configuring transport address  | 
(config-router)#exit  | Exit from router target peer and LDP mode   | 
(config)#commit  | Commit the transaction.  | 
(config)#interface mlag1  | Create mlag interface  | 
(config-if)# switchport  | Configuring as L2 port  | 
(config-if)# load-interval 30  | Configure load interval  | 
(config-if)# exit  | Exit from interface mode  | 
(config)#interface po1  | Configure dynamic lag  | 
(config-if)# switchport  | Configuring as L2 port  | 
(config-if)# mtu 1500  | Set mtu value  | 
(config-if)# mlag 1  | Attach mlag to po1. Note: While creating po1 subifp, this needs to be un-configured and configured back  | 
(config-if)#interface xe10  | Enter interface mode for xe10  | 
(config-if)# channel-group 1 mode active  | Attach lag interface po1  | 
(config-if)#exit  | Exit interface mode  | 
(config)#mcec domain configuration  | Create mcec domain  | 
(config-mcec-domain)# domain-address 1111.2222.3333  | Configure mcec domain address  | 
(config-mcec-domain)# domain-system-number 1  | Configure system number. Active node should have lower value.  | 
(config-mcec-domain)# intra-domain-link xe4  | Configure ideal interface between mlag devices  | 
(config-mcec-domain)# domain-hello-timeout long  | Configure domain hello timeout   | 
(config-if)#interface ce0  | Configure network interface ce0  | 
(config-if)# ip address 20.1.1.1/24  | Configure IP address on the interface.  | 
(config-if)# mtu 1522  | Configure mtu  | 
(config-if)# label-switching  | Enable label switching on the interface.  | 
(config-if)# mpls ldp-igp sync ospf  | Configure mpls igp sync  | 
(config-if)# ip ospf network point-to-point  | Configure ospf as p2p  | 
(config-if)# enable-ldp ipv4  | Enable LDP on the physical interface  | 
(config)#interface po2  | Create channel group po2  | 
(config-if)# ip address 10.1.1.1/24  | Configure IP address on the interface.  | 
(config-if)# mtu 2000  | Configure mtu  | 
(config-if)# label-switching  | Enable label switching on the interface.  | 
(config-if)# mpls ldp-igp sync ospf  | Configure mpls igp sync  | 
(config-if)# ip ospf network point-to-point  | Configure ospf as p2p  | 
(config-if)# enable-ldp ipv4  | Enable LDP on the physical interface  | 
(config-if)#interface xe18  | Enter interface mode for xe18  | 
(config-if)# channel-group 2 mode active  | Attach lag interface po2  | 
(config-if)#interface xe19  | Enter interface mode for xe19  | 
(config-if)# channel-group 2 mode active  | Attach lag interface po2  | 
(config)#commit  | Commit the transaction.  | 
(config)#router ospf 1  | Enter the Router OSPF mode.  | 
(config-router)# network 1.1.1.1/32 area 0.0.0.0  | Advertise loopback address in OSPF.  | 
(config-router)# network 10.1.1.0/24 area 0.0.0.0  | Advertise network address in OSPF.  | 
(config-router)# network 20.1.1.0/24 area 0.0.0.0  | Advertise network address in OSPF.  | 
(config-router)# ospf segment-routing global block 16000 23000  | Configure SR global block for ospf  | 
(config-router)# segment-routing mpls  | Enable ospf SR  | 
(config-router)#exit  | Exit Router OSPF mode and return to Configure mode.  | 
(config)#commit  | Commit the transaction.  | 
(config)#router bgp 100  | Enter the Router BGP mode, ASN: 100  | 
(config-router)# neighbor 5.5.5.5 remote-as 100  | Configuring PE3 as iBGP neighbor using it's loopback IP  | 
(config-router)# neighbor 5.5.5.5 fall-over bfd multihop  | Configure BFD  | 
(config-router)# neighbor 5.5.5.5 update-source lo  | Source of routing updates as loopback  | 
(config-router)# address-family ipv4 unicast  | Enter in to address family ipv4 unicast mode  | 
(config-router-af)# neighbor 5.5.5.5 activate  | Activate PE3 neighbor  | 
(config-router-af)# exit-address-family  | Exit address family  | 
(config-router)# address-family l2vpn evpn  | Enter in to address family l2vpn vpn  | 
(config-router-af)# neighbor 5.5.5.5 activate  | Activate PE3 neighbor  | 
(config-router-af)# exit-address-family  | Exit address family  | 
(config-router)# address-family ipv6 unicast  | Enter in to address family ipv6 unicast mode  | 
(config-router-af)# neighbor 5.5.5.5 activate  | Activate PE3 neighbor  | 
(config-router-af)# exit-address-family  | Exit address family  | 
(config-router)# address-family ipv4 vrf vrf102  | Enter in to address family ipv4 vrf vrf102  | 
(config-router-af)# redistribute connected  | Redistribute connected networks in to bgp   | 
(config-router-af)# exit-address-family  | Exit address family  | 
(config-router)# address-family ipv4 vrf vrf101  | Enter in to address family ipv4 vrf vrf102  | 
(config-router-af)# redistribute connected  | Redistribute connected networks in to bgp   | 
(config-router-af)# exit-address-family  | Exit address family  | 
(config-router)# address-family ipv6 vrf vrf101  | Enter in to address family ipv6 vrf vrf101  | 
(config-router-af)# redistribute connected  | Redistribute connected networks in to bgp   | 
(config-router-af)# exit-address-family  | Exit address family  | 
(config-router)# address-family ipv6 vrf vrf102  | Enter in to address family ipv6 vrf vrf102  | 
(config-router-af)# redistribute connected  | Redistribute connected networks in to bgp   | 
(config-router-af)# exit-address-family  | Exit address family  | 
(config-vrf)#ip vrf vrf102  | Enter VRF mode  | 
(config-vrf)# rd 10001:102  | Configuring Route-Distinguisher value   | 
(config-vrf)# route-target both 1.1.1.1:102  | Configure RT value  | 
(config-vrf)# l3vni 102  | Configure L3VNID to populate route through evpn  | 
(config-vrf)#ip vrf vrf101  | Enter VRF mode  | 
(config-vrf)# rd 10001:1  | Configuring Route-Distinguisher value   | 
(config-vrf)# route-target both 1.1.1.1:1  | Configure RT value  | 
(config-vrf)# l3vni 101  | Configure L3VNID to populate route through evpn  | 
(config-if)#interface xe3  | Enter the Interface mode for xe3. This is for untagged traffic  | 
(config-if)# ip vrf forwarding vrf101  | Map the vrf vrf101  | 
(config-if)# ip address 100.1.1.1/24  | Assign ipv4 address  | 
(config-if)# ipv6 address 1000::1/64  | Assign ipv6 address  | 
(config-if)#interface xe3.1  | Create xe3.1 subifp  | 
(config-if)# encapsulation dot1q 10  | Configure encapsulation as single tagged   | 
(config-if)# ip vrf forwarding vrf101  | Map the vrf vrf101  | 
(config-if)# ip address 110.1.1.1/24  | Assign ipv4 address  | 
(config-if)# ipv6 address 1100::1/64  | Assign ipv6 address  | 
(config-if)#interface xe3.2  | Create xe3.2 subifp  | 
(config-if)# encapsulation dot1q 11 inner-dot1q 11  | Configure encapsulation as double tagged   | 
(config-if)# ip vrf forwarding vrf101  | Map the vrf vrf101  | 
(config-if)# ip address 120.1.1.1/24  | Assign ipv4 address  | 
(config-if)# ipv6 address 1200::1/64  | Assign ipv6 address  | 
(config-if)#interface xe3.11  | Create xe3.11 subifp  | 
(config-if)# encapsulation dot1q 11  | Configure encapsulation as single tagged   | 
(config-if)# ip vrf forwarding vrf101  | Map the vrf vrf101  | 
(config-if)# ip address 111.1.1.1/24  | Assign ipv4 address  | 
(config-if)# ipv6 address 1110::1/64  | Assign ipv6 address  | 
(config-if)#interface po1.11  | Create po1 subinterface. We need to unconfigure mlag under po1 before creating subinterface.  | 
(config-if)# encapsulation dot1q 11  | Configure encapsulation type and value  | 
(config-if)# ip vrf forwarding vrf101  | Map the vrf vrf101  | 
(config-if)# evpn irb-if-forwarding anycast-gateway-mac  | Configure anycast gateway mac  | 
(config-if)# ip address 150.11.1.1/24  | Assign ipv4 address  | 
(config-if)#interface po1.12  | Create po1 subinterface.   | 
(config-if)# encapsulation dot1q 12  | Configure encapsulation type and value  | 
(config-if)# ip vrf forwarding vrf101  | Map the vrf vrf101  | 
(config-if)# evpn irb-if-forwarding anycast-gateway-mac  | Configure anycast gateway mac  | 
(config-if)# ip address 150.12.1.1/24  | Assign ipv4 address  | 
(config-if)#interface po1.13  | Create po1 subinterface.   | 
(config-if)# encapsulation dot1q 13  | Configure encapsulation type and value  | 
(config-if)# ip vrf forwarding vrf101  | Map the vrf vrf101  | 
(config-if)# evpn irb-if-forwarding anycast-gateway-mac  | Configure anycast gateway mac  | 
(config-if)# ip address 150.13.1.1/24  | Assign ipv4 address  | 
(config-if)#interface po1.14  | Create po1 subinterface.   | 
(config-if)# encapsulation dot1q 14  | Configure encapsulation type and value  | 
(config-if)# ip vrf forwarding vrf101  | Map the vrf vrf101  | 
(config-if)# evpn irb-if-forwarding anycast-gateway-mac  | Configure anycast gateway mac  | 
(config-if)# ip address 150.14.1.1/24  | Assign ipv4 address  | 
(config-if)#interface po1.15  | Create po1 subinterface.   | 
(config-if)# encapsulation dot1q 15  | Configure encapsulation type and value  | 
(config-if)# ip vrf forwarding vrf101  | Map the vrf vrf101  | 
(config-if)# evpn irb-if-forwarding anycast-gateway-mac  | Configure anycast gateway mac  | 
(config-if)# ip address 150.15.1.1/24  | Assign ipv4 address  | 
(config-if)#exit  | Exit interface mode  | 
(config)#commit  | Commit the transaction.  | 
PE2 Configuration:  | |
Loopback Interface:  | |
#configure terminal  | Enter configuration mode.  | 
(config)#interface lo  | Enter the Interface mode for the loopback interface.  | 
(config-if)# ip address 2.2.2.2/32 secondary  | Configure IP address on loopback interface.  | 
(config-if)# prefix-sid index 2  | Configuring prefix sid for segment id  | 
(config-if)#commit  | Commit the transaction.  | 
(config-if)#exit  | Exit interface mode  | 
#configure terminal  | Enter configuration mode.  | 
(config)#load-balance enable  | Enable Load balance  | 
(config)#hardware-profile filter evpn-mpls-mh enable  | Enable hardware profile for evpn mpls multihoming  | 
(config)#evpn mpls enable  | Enable EVPN MPLS  | 
(config)#evpn mpls irb  | Enable EVPN MPLS IRB  | 
(config)#evpn mpls multihoming enable  | Enable EVPN MPLS multihoming  | 
(config)#evpn mpls vtep-ip-global 2.2.2.2  | Configuring VTEP global IP to loopback IP  | 
(config)#evpn irb-forwarding anycast-gateway-mac 0011.2233.4466  | Configure Anycast gateway mac for MH. This command is mandatory for MH nodes.  | 
(config)#commit  | Commit candidate configuration to be running configuration Note: Reload is required after Enabling/Disabling EVPN MPLS Feature.  | 
(config)#segment-routing  | Configure segment routing  | 
(config-sr)# mpls sr-prefer  | Set mpls prefer segment routing over other protocols  | 
(config-sr)#exit  | Exit from router sr mode   | 
(config)#commit  | Commit the transaction.  | 
(config)#router ldp  | Enter the Router LDP mode.  | 
(config-router)# transport-address ipv4 2.2.2.2  | Configuring transport address  | 
(config-router)#exit  | Exit from router target peer and LDP mode   | 
(config)#commit  | Commit the transaction.  | 
(config)#interface mlag1  | Create mlag interface  | 
(config-if)# switchport  | Configuring as L2 port  | 
(config-if)# load-interval 30  | Configure load interval  | 
(config-if)# exit  | Exit from interface mode  | 
(config)#interface po1  | Configure dynamic lag  | 
(config-if)# switchport  | Configuring as L2 port  | 
(config-if)# mtu 1500  | Set mtu value  | 
(config-if)# mlag 1  | Attach mlag  | 
(config-if)#interface xe9  | Enter interface mode   | 
(config-if)# speed 10g  | Set speed as 10g  | 
(config-if)# channel-group 1 mode active  | Attach the channel group po1  | 
(config-if)# exit  | Exit from interface mode  | 
(config)#mcec domain configuration  | Create mcec domain  | 
(config-mcec-domain)# domain-address 1111.2222.3333  | Configure mcec domain address  | 
(config-mcec-domain)# domain-system-number 2  | Configure system number  | 
(config-mcec-domain)# intra-domain-link xe4  | Configure ideal interface between mlag devices  | 
(config-mcec-domain)# domain-hello-timeout long  | Configure domain hello timeout   | 
(config)#commit  | Commit the transaction.  | 
(config-if)#interface xe6  | Enter the Interface mode for xe6.  | 
(config-if)# ip address 30.1.1.1/24  | Configure ipv4 address  | 
(config-if)# mtu 1522  | Configure mtu  | 
(config-if)# label-switching  | Enable label switching on the interface.  | 
(config-if)# mpls ldp-igp sync ospf  | Configure ldp ospf sync  | 
(config-if)# ip ospf network point-to-point  | Configure ospf as p2p  | 
(config-if)# enable-ldp ipv4  | Enable LDP on the physical interface  | 
(config-if)#interface xe26  | Enter the Interface mode for xe26.  | 
(config-if)# ip address 40.1.1.1/24  | Configure ipv4 address  | 
(config-if)# mtu 2000  | Configure mtu  | 
(config-if)# label-switching  | Enable label switching on the interface.  | 
(config-if)# mpls ldp-igp sync ospf  | Configure ldp sync with ospf  | 
(config-if)# ip ospf network point-to-point  | Configure ospf as p2p  | 
(config-if)# enable-ldp ipv4  | Enable LDP on the physical interface  | 
(config-router)#exit  | Exit interface mode  | 
(config)#commit  | Commit the transaction.  | 
(config)#router ospf 1  | Enter the Router OSPF mode.  | 
(config-router)# network 1.1.1.1/32 area 0.0.0.0  | Advertise loopback address in OSPF.  | 
(config-router)# network 10.1.1.0/24 area 0.0.0.0  | Advertise network address in OSPF.  | 
(config-router)# network 20.1.1.0/24 area 0.0.0.0  | Advertise network address in OSPF.  | 
(config-router)# ospf segment-routing global block 16000 23000  | Configure SR global block for ospf  | 
(config-router)# segment-routing mpls  | Enable ospf SR  | 
(config-router)#exit  | Exit Router OSPF mode and return to Configure mode.  | 
(config)#commit  | Commit the transaction.  | 
(config)#router bgp 100  | Enter the Router BGP mode, ASN: 100  | 
(config-router)# neighbor 5.5.5.5 remote-as 100  | Configuring PE3 as iBGP neighbor using it's loopback IP  | 
(config-router)# neighbor 5.5.5.5 fall-over bfd multihop  | Configure BFD  | 
(config-router)# neighbor 5.5.5.5 update-source lo  | Source of routing updates as loopback  | 
(config-router)# address-family ipv4 unicast  | Enter in to address family ipv4 unicast mode  | 
(config-router-af)# neighbor 5.5.5.5 activate  | Activate PE3 neighbor  | 
(config-router-af)# exit-address-family  | Exit address family  | 
(config-router)# address-family l2vpn evpn  | Enter in to address family l2vpn vpn  | 
(config-router-af)# neighbor 5.5.5.5 activate  | Activate PE3 neighbor  | 
(config-router-af)# exit-address-family  | Exit address family  | 
(config-router)# address-family ipv6 unicast  | Enter in to address family ipv6 unicast mode  | 
(config-router-af)# neighbor 5.5.5.5 activate  | Activate PE3 neighbor  | 
(config-router-af)# exit-address-family  | Exit address family  | 
(config-router)# address-family ipv4 vrf vrf102  | Enter in to address family ipv4 vrf vrf102  | 
(config-router-af)# redistribute connected  | Redistribute connected networks in to bgp   | 
(config-router-af)# exit-address-family  | Exit address family  | 
(config-router)# address-family ipv4 vrf vrf101  | Enter in to address family ipv4 vrf vrf102  | 
(config-router-af)# redistribute connected  | Redistribute connected networks in to bgp   | 
(config-router-af)# exit-address-family  | Exit address family  | 
(config-router)# address-family ipv6 vrf vrf101  | Enter in to address family ipv6 vrf vrf101  | 
(config-router-af)# redistribute connected  | Redistribute connected networks in to bgp   | 
(config-router-af)# exit-address-family  | Exit address family  | 
(config-router)# address-family ipv6 vrf vrf102  | Enter in to address family ipv6 vrf vrf102  | 
(config-router-af)# redistribute connected  | Redistribute connected networks in to bgp   | 
(config-router-af)# exit-address-family  | Exit address family  | 
(config)#commit  | Commit the transaction.  | 
(config-vrf)#ip vrf vrf102  | Enter VRF mode  | 
(config-vrf)# rd 10001:102  | Configuring Route-Distinguisher value  | 
(config-vrf)# route-target both 1.1.1.1:102  | Configure RT  | 
(config-vrf)# l3vni 102  | Configure L3VNI to send ipv4 route through evpn  | 
(config-vrf)#ip vrf vrf101  | Create ip vrf vrf101  | 
(config-vrf)# rd 10001:1  | Configuring Route-Distinguisher value  | 
(config-vrf)# route-target both 1.1.1.1:1  | Configure RT  | 
(config-vrf)# l3vni 101  | Configure L3VNI to send ipv4 route through evpn  | 
(config)#commit  | Commit the transaction.  | 
(config-if)#interface po1.11  | Create po1 subinterface. We need to unconfigure mlag under po1 before creating subinterface.  | 
(config-if)# encapsulation dot1q 11  | Configure encapsulation type and value  | 
(config-if)# ip vrf forwarding vrf101  | Map the vrf vrf101  | 
(config-if)# evpn irb-if-forwarding anycast-gateway-mac  | Configure anycast gateway mac for multi-homing  | 
(config-if)# ip address 150.11.1.1/24  | Assign ipv4 address  | 
(config-if)#interface po1.12  | Create po1 subinterface.   | 
(config-if)# encapsulation dot1q 12  | Configure encapsulation type and value  | 
(config-if)# ip vrf forwarding vrf101  | Map the vrf vrf101  | 
(config-if)# evpn irb-if-forwarding anycast-gateway-mac  | Configure anycast gateway mac for multi-homing  | 
(config-if)# ip address 150.12.1.1/24  | Assign ipv4 address  | 
(config-if)#interface po1.13  | Create po1 subinterface.   | 
(config-if)# encapsulation dot1q 13  | Configure encapsulation type and value  | 
(config-if)# ip vrf forwarding vrf101  | Map the vrf vrf101  | 
(config-if)# evpn irb-if-forwarding anycast-gateway-mac  | Configure anycast gateway mac for multi-homing  | 
(config-if)# ip address 150.13.1.1/24  | Assign ipv4 address  | 
(config-if)#interface po1.14  | Create po1 subinterface.   | 
(config-if)# encapsulation dot1q 14  | Configure encapsulation type and value  | 
(config-if)# ip vrf forwarding vrf101  | Map the vrf vrf101  | 
(config-if)# ip address 150.14.1.1/24  | Assign ipv4 address  | 
(config-if)# evpn irb-if-forwarding anycast-gateway-mac  | Configure anycast gateway mac for multi-homing  | 
(config-if)#interface po1.15  | Create po1 subinterface.   | 
(config-if)# encapsulation dot1q 15  | Configure encapsulation type and value  | 
(config-if)# ip vrf forwarding vrf101  | Map the vrf vrf101  | 
(config-if)# ip address 150.15.1.1/24  | Assign ipv4 address  | 
(config-if)# evpn irb-if-forwarding anycast-gateway-mac  | Configure anycast gateway mac for multi-homing  | 
(config-if)#exit  | Exit interface mode  | 
(config)#commit  | Commit the transaction.  | 
(config)#segment-routing  | Configure SR.  | 
(config-sr)# mpls sr-prefer  | Prefer SR over other protocol.  | 
(config-sr)#exit  | Exit sr mode.  | 
(config)#router ldp  | Configure router ldp  | 
(config-router)# transport-address ipv4 3.3.3.3  | Configure transport address.  | 
(config-router)#exit  | Exit  | 
(config)#interface po2  | Configure dynamic LAG po2  | 
(config-if)# ip address 10.1.1.2/24  | Configure ipv4 address  | 
(config-if)# mtu 2000  | Configure MTU  | 
(config-if)# label-switching  | Configure label switching  | 
(config-if)# mpls ldp-igp sync ospf  | Configure ldp ospf sync  | 
(config-if)# ip ospf network point-to-point  | Configure ospf p2p  | 
(config-if)# enable-ldp ipv4  | Enable ldp  | 
(config-if)#interface ce1  | Configure network interface ce1  | 
(config-if)# ip address 60.1.1.1/24  | Configure ipv4 address  | 
(config-if)# mtu 1522  | Configure MTU  | 
(config-if)# label-switching  | Configure label switching  | 
(config-if)# mpls ldp-igp sync ospf  | Configure ldp ospf sync  | 
(config-if)# ip ospf network point-to-point  | Configure ospf p2p  | 
(config-if)# enable-ldp ipv4  | Enable ldp  | 
(config-if)#interface lo  | Configure loopback interface  | 
(config-if)# ip address 3.3.3.3/32 secondary  | Configure secondary ip  | 
(config-if)# prefix-sid absolute 16003  | Configure SR segment id  | 
(config-if)#interface xe10  | Configure network interface xe10  | 
(config-if)# speed 10g  | Set speed 10g  | 
(config-if)# ip address 30.1.1.2/24  | Configure ipv4 address  | 
(config-if)# mtu 1522  | Configure MTU  | 
(config-if)# label-switching  | Configure label switching  | 
(config-if)# mpls ldp-igp sync ospf  | Configure ldp ospf sync  | 
(config-if)# ip ospf network point-to-point  | Configure ospf p2p  | 
(config-if)# enable-ldp ipv4  | Enable ldp  | 
(config-if)#interface xe14  | Configure network interface xe14  | 
(config-if)# ip address 50.1.1.1/24  | Configure ipv4 address  | 
(config-if)# mtu 1522  | Configure MTU  | 
(config-if)# label-switching  | Configure label switching  | 
(config-if)# mpls ldp-igp sync ospf  | Configure ldp ospf sync  | 
(config-if)# ip ospf network point-to-point  | Configure ospf p2p  | 
(config-if)# enable-ldp ipv4  | Enable ldp  | 
(config-if)#interface xe16  | Enter interface mode  | 
(config-if)# channel-group 2 mode active  | Map dynamic lag po2  | 
(config-if)#interface xe17  | Enter interface mode  | 
(config-if)# channel-group 2 mode active  | Map dynamic lag po2  | 
(config-if)# exit  | Exit  | 
(config)#router ospf 1  | Configure router ospf 1  | 
(config-router)# network 3.3.3.3/32 area 0.0.0.0  | Add loopback ip to ospf  | 
(config-router)# network 10.1.1.0/24 area 0.0.0.0  | Add network address  | 
(config-router)# network 30.1.1.0/24 area 0.0.0.0  | Add network address  | 
(config-router)# network 50.1.1.0/24 area 0.0.0.0  | Add network address  | 
(config-router)# network 60.1.1.0/24 area 0.0.0.0  | Add network address  | 
(config-router)# segment-routing mpls  | Enable SR ospf  | 
(config)#segment-routing  | Configure SR.  | 
(config-sr)# mpls sr-prefer  | Prefer SR over other protocol.  | 
(config)#exit  | Exit sr mode.  | 
(config-sr)#router ldp  | Configure router ldp  | 
(config-router)# transport-address ipv4 4.4.4.4  | Configure transport address.  | 
(config-router)#exit  | Exit  | 
(config)#interface ce1  | Configure network interface ce1  | 
(config-if)# ip address 20.1.1.2/24  | Configure ipv4 address  | 
(config-if)# mtu 1522  | Configure MTU  | 
(config-if)# label-switching  | Configure label switching  | 
(config-if)# mpls ldp-igp sync ospf  | Configure ldp ospf sync  | 
(config-if)# ip ospf network point-to-point  | Configure ospf p2p  | 
(config-if)# enable-ldp ipv4  | Enable ldp  | 
(config-if)#interface lo  | Configure loopback interface  | 
(config-if)# ip address 4.4.4.4/32 secondary  | Configure secondary ip  | 
(config-if)# prefix-sid absolute 16004  | Configure SR segment id  | 
(config-if)#interface xe14  | Configure network interface xe14  | 
(config-if)# ip address 50.1.1.2/24  | Configure ipv4 address  | 
(config-if)# mtu 1522  | Configure MTU  | 
(config-if)# label-switching  | Configure label switching  | 
(config-if)# mpls ldp-igp sync ospf  | Configure ldp ospf sync  | 
(config-if)# ip ospf network point-to-point  | Configure ospf p2p  | 
(config-if)# enable-ldp ipv4  | Enable ldp  | 
(config-if)#interface xe20  | Configure network interface xe20  | 
(config-if)# ip address 70.1.1.1/24  | Configure ipv4 address  | 
(config-if)# mtu 1522  | Configure MTU  | 
(config-if)# label-switching  | Configure label switching  | 
(config-if)# mpls ldp-igp sync ospf  | Configure ldp ospf sync  | 
(config-if)# ip ospf network point-to-point  | Configure ospf p2p  | 
(config-if)# enable-ldp ipv4  | Enable ldp  | 
(config-if)#interface xe26  | Configure network interface xe26  | 
(config-if)# ip address 40.1.1.2/24  | Configure ipv4 address  | 
(config-if)# mtu 2000  | Configure MTU  | 
(config-if)# label-switching  | Configure label switching  | 
(config-if)# mpls ldp-igp sync ospf  | Configure ldp ospf sync  | 
(config-if)# ip ospf network point-to-point  | Configure ospf p2p  | 
(config-if)# enable-ldp ipv4  | Enable ldp  | 
(config-if)#router ospf 1  | Configure router ospf 1  | 
(config-router)# network 4.4.4.4/32 area 0.0.0.0  | Add loopback ip to ospf  | 
(config-router)# network 20.1.1.0/24 area 0.0.0.0  | Add network address  | 
(config-router)# network 40.1.1.0/24 area 0.0.0.0  | Add network address  | 
(config-router)# network 50.1.1.0/24 area 0.0.0.0  | Add network address  | 
(config-router)# network 70.1.1.0/24 area 0.0.0.0  | Add network address  | 
(config-router)# segment-routing mpls  | Enable SR ospf  | 
Loopback Interface:  | |
#configure terminal  | Enter configuration mode.  | 
(config-if)#interface lo  | Enter the Interface mode for the loopback interface.  | 
(config-if)# ip address 5.5.5.5/32 secondary  | Configure IP address on loopback interface.  | 
(config-if)# prefix-sid absolute 16005  | Configure SR segment id  | 
(config)#commit  | Commit the transaction.  | 
(config)#evpn mpls enable  | Enable EVPN MPLS  | 
(config)#evpn mpls irb  | Enable EVPN MPLS IRB  | 
(config)#commit  | Commit candidate configuration to be running configuration Note: Reload is required after Enabling/Disabling EVPN MPLS Feature  | 
(config)#evpn mpls vtep-ip-global 5.5.5.5  | Configuring VTEP global IP to loopback IP  | 
(config-evpn-mpls)#commit  | Commit the transaction.  | 
(config-vrf)#ip vrf vrf102  | Enter VRF mode  | 
(config-vrf)# rd 10001:102  | Configuring Route-Distinguisher value  | 
(config-vrf)# route-target both 1.1.1.1:102  | Configure RT value  | 
(config-vrf)# l3vni 102  | Configure L3VNI to send ipv4 route through evpn  | 
(config-vrf)#ip vrf vrf101  | Create ip vrf vrf101  | 
(config-vrf)# rd 10002:1  | Configuring Route-Distinguisher value  | 
(config-vrf)# route-target both 1.1.1.1:1  | Configure RT value  | 
(config-vrf)# l3vni 101  | Configure L3VNI to send ipv4 route through evpn  | 
(config)#commit  | Commit the transaction.  | 
(config)#segment-routing  | Configure SR  | 
(config-sr)# mpls sr-prefer  | Prefer SR over other protocols for mpls  | 
(config)#commit  | Commit the transaction.  | 
Global LDP:  | |
(config)#router ldp  | Enter the Router LDP mode.  | 
(config-router)# transport-address ipv4 5.5.5.5  | Configure transport address  | 
(config-router)#exit  | Exit  | 
(config)#commit  | Commit the transaction.  | 
(config-if)#interface ce3  | Configure network interface ce3  | 
(config-if)# ip address 60.1.1.2/24  | Configure ipv4 address  | 
(config-if)# mtu 1522  | Configure MTU  | 
(config-if)# label-switching  | Configure label switching  | 
(config-if)# mpls ldp-igp sync ospf  | Configure ldp ospf sync  | 
(config-if)# ip ospf network point-to-point  | Configure ospf p2p  | 
(config-if)# enable-ldp ipv4  | Enable ldp  | 
(config-if)#interface xe20  | Enter the Interface mode for xe20.  | 
(config-if)# ip address 70.1.1.2/24  | Configure ipv4 address  | 
(config-if)# mtu 1522  | Configure MTU  | 
(config-if)# label-switching  | Configure label switching  | 
(config-if)# mpls ldp-igp sync ospf  | Configure ldp ospf sync  | 
(config-if)# ip ospf network point-to-point  | Configure ospf p2p  | 
(config-if)# enable-ldp ipv4  | Enable ldp  | 
(config)#commit  | Commit the transaction.  | 
(config)#router ospf 1  | Enter the Router OSPF mode.  | 
(config-router)# network 5.5.5.5/32 area 0.0.0.0  | Advertise loopback address in OSPF.  | 
(config-router)# network 60.1.1.0/24 area 0.0.0.0  | Advertise network address in OSPF.  | 
(config-router)# network 70.1.1.0/24 area 0.0.0.0  | Advertise network address in OSPF.  | 
(config-router)# segment-routing mpls  | Enable SR ospf  | 
(config-router)#exit  | Exit Router OSPF mode and return to Configure mode.  | 
(config)#commit  | Commit the transaction.  | 
(config-router)#router bgp 100  | Enter the Router BGP mode, ASN: 100  | 
(config-router)# neighbor 1.1.1.1 remote-as 100  | Configuring PE1 as iBGP neighbor using it's loopback IP  | 
(config-router)# neighbor 1.1.1.1 fall-over bfd multihop  | Configure BFD  | 
(config-router)# neighbor 2.2.2.2 remote-as 100  | Configuring PE2 as iBGP neighbor using it's loopback IP  | 
(config-router)# neighbor 2.2.2.2 fall-over bfd multihop  | Configure BFD  | 
(config-router)# neighbor 1.1.1.1 update-source lo  | Source of routing updates as loopback  | 
(config-router)# neighbor 2.2.2.2 update-source lo  | Source of routing updates as loopback  | 
(config-router)# address-family ipv4 unicast  | Enter ipv4 unicast address family  | 
(config-router-af)# neighbor 1.1.1.1 activate  | Activate neighbor PE1  | 
(config-router-af)# neighbor 2.2.2.2 activate  | Activate neighbor PE2  | 
(config-router-af)# exit-address-family  | Exit address family  | 
(config-router)# address-family l2vpn evpn  | Enter evpn address family  | 
(config-router-af)# neighbor 1.1.1.1 activate  | Activate neighbor PE1  | 
(config-router-af)# neighbor 2.2.2.2 activate  | Activate neighbor PE2  | 
(config-router-af)# exit-address-family  | Exit address family  | 
(config-router)# address-family ipv6 unicast  | Enter ipv6 unicast address family  | 
(config-router-af)# neighbor 1.1.1.1 activate  | Activate neighbor PE1  | 
(config-router-af)# neighbor 2.2.2.2 activate  | Activate neighbor PE2  | 
(config-router-af)# exit-address-family  | Exit address family  | 
(config-router)# address-family ipv4 vrf vrf102  | Enter vrf vrf102 address family  | 
(config-router-af)# redistribute connected  | Redisdribute vrf connected routes to bgp  | 
(config-router-af)# exit-address-family  | Exit address family  | 
(config-router)# address-family ipv6 vrf vrf102  | Enter ipv6 vrf vrf102 address family  | 
(config-router-af)# redistribute connected  | Redisdribute vrf connected routes to bgp  | 
(config-router-af)# exit-address-family  | Exit address family  | 
(config-router)# address-family ipv4 vrf vrf101  | Enter vrf vrf102 address family  | 
(config-router-af)# redistribute connected  | Redisdribute vrf connected routes to bgp  | 
(config-router-af)# exit-address-family  | Exit address family  | 
(config-router)# address-family ipv6 vrf vrf101  | Enter ipv6 vrf vrf101 address family  | 
(config-router-af)# redistribute connected  | Redisdribute vrf connected routes to bgp  | 
(config-router-af)# exit-address-family  | Exit address family  | 
(config-router)#exit  | Exit bgp mode  | 
(config)#commit  | Commit the transaction.  | 
(config-if)#interface xe13  | Enter the Interface mode for xe3. This is for untagged traffic  | 
(config-if)# ip vrf forwarding vrf101  | Map the vrf vrf101  | 
(config-if)# ip address 201.1.1.1/24  | Assign ipv4 address  | 
(config-if)# ipv6 address 2001::1/64  | Assign ipv6 address  | 
(config-if)#interface xe13.1  | Create subinterface xe13.1  | 
(config-if)# encapsulation dot1q 10  | Configure encapsulation single tagged  | 
(config-if)# ip vrf forwarding vrf101  | Map the vrf vrf101  | 
(config-if)# ip address 210.1.1.1/24  | Assign ipv4 address  | 
(config-if)# ipv6 address 2100::1/64  | Assign ipv6 address  | 
(config-if)#interface xe13.2  | Create subinterface xe13.2  | 
(config-if)# encapsulation dot1q 11 inner-dot1q 11  | Configure encapsulation double tagged  | 
(config-if)# ip vrf forwarding vrf101  | Map the vrf vrf101  | 
(config-if)# ip address 220.1.1.1/24  | Assign ipv4 address  | 
(config-if)# ipv6 address 2200::1/64  | Assign ipv6 address  | 
(config)#commit  | Commit the transaction.  |