MPLS Configuration on CX-M Asterfusion Enterprise SONiC Switch
Configuring MPLS Static LSP
Network Requirements

-
Configure LSP1 from PE1 to PE2, with P2 using PHP (Penultimate Hop Popping) explicit null label
-
Configure LSP2 from PE2 to PE1, with P1 using PHP implicit null label
Configuration Steps
-
PE1 Device Configuration
# Configure IP addresses for interfaces and enable MPLS functionality
sonic(config)# interface ethernet 1
sonic(config-if-1)# ip address 12.12.12.1/24
sonic(config-if-1)# mpls enable
sonic(config)# interface ethernet 3
sonic(config-if-3)# ip address 10.1.1.254/24
sonic(config-if-3)# mpls enable
# Configure LSP1: Route to 20.1.1.0/24 with label 50
sonic(config)# ip route 20.1.1.0/24 12.12.12.2 label 50
-
P1 Device Configuration
# Configure IP addresses for Ethernet1 and Ethernet2, and enable MPLS functionality
sonic(config)# interface ethernet 1
sonic(config-if-1)# ip address 12.12.12.2/24
sonic(config-if-1)# mpls enable
sonic(config)# interface ethernet 2
sonic(config-if-2)# ip address 14.14.14.1/24
sonic(config-if-2)# mpls enable
sonic(config)# mpls lsp 50 14.14.14.2 60
sonic(config)# mpls lsp 80 12.12.12.1 implicit-null
-
P2 Device Configuration
sonic(config)# interface ethernet 1
sonic(config-if-1)# ip address 16.16.16.1/24
sonic(config-if-1)# mpls enable
sonic(config)# interface ethernet 2
sonic(config-if-2)# ip address 14.14.14.2/24
sonic(config-if-2)# mpls enable
sonic(config)# mpls lsp 60 16.16.16.2 explicit-null
sonic(config)# mpls lsp 70 14.14.14.1 80
-
PE2 Device Configuration
sonic(config)# interface ethernet 1
sonic(config-if-1)# ip address 16.16.16.2/24
sonic(config-if-1)# mpls enable
sonic(config)# interface ethernet 3
sonic(config-if-3)# ip address 20.1.1.254/24
-
CE1 Device Configuration
sonic(config-if-1)# ip address 10.1.1.1/24
sonic(config)# ip route add 20.1.1.0/24 10.1.1.254
-
CE2 Device Configuration
sonic(config-if-1)# ip address 20.1.1.1/24
sonic(config)# ip route add 10.1.1.0/24 20.1.1.254
Configuring MPLS L2VPN VPWS
Network Requirements

Configuration Steps
-
PE1 Device Configuration
sonic(config-if-1)# ip address 12.12.12.1/24
sonic(config-if-1)# mpls enable
sonic(config-if-1)# mpls ldp
# Establish OSPF session
sonic(config-if-lo1)# ip address 100.1.1.1/32
sonic(config)# router ospf
sonic(config-router)# ospf router-id 100.1.1.1
sonic(config-router)# redistribute connected
sonic(config-router)# redistribute static
sonic(config-router)# network 12.12.12.0/24 area 1
# Enable LDP functionality on interface Ethernet1
sonic(config-ldp)# router-id 100.1.1.1
sonic(config-ldp)# address-family ipv4
sonic(config-ldp-af)# discovery transport-address 100.1.1.1
sonic(config-ldp-af)# exit-address-family
# Configure PW (Pseudowire)
sonic(config-pw)# neighbor lsr-id 100.3.1.1
sonic(config-pw)# pw-id 100
# Create VPWS-type L2VPN and configure PW and AC
sonic(config-l2vpn)# member interface ethernet 3
sonic(config-l2vpn)# member pseudowire pw1
-
P Device Configuration
sonic(config-if-1)# ip address 12.12.12.2/24
sonic(config-if-1)# mpls enable
sonic(config-if-1)# mpls ldp
sonic(config)# interface ethernet 2
sonic(config-if-2)# ip address 14.14.14.2/24
sonic(config-if-2)# mpls enable
sonic(config-if-2)# mpls ldp
sonic(config-if-1)# ip address 100.2.1.1/32
sonic(config)# router ospf
sonic(config-router)# ospf router-id 100.2.1.1
sonic(config-router)# redistribute connected
sonic(config-router)# redistribute static
sonic(config-router)# network 12.12.12.0/24 area 1
sonic(config-router)# network 14.14.14.0/24 area 1
# Enable LDP functionality on interfaces Ethernet1 and Ethernet2
sonic(config-ldp)# router-id 100.2.1.1
sonic(config-ldp)# address-family ipv4
sonic(config-ldp-af)# discovery transport-address 100.2.1.1
sonic(config-ldp-af)# exit-address-family
-
PE2 Device Configuration
sonic(config-if-2)# ip address 14.14.14.1/24
sonic(config-if-2)# mpls enable
sonic(config-if-2)# mpls ldp
# Establish OSPF session
sonic(config-if-lo1)# ip address 100.3.1.1/32
sonic(config)# router ospf
sonic(config-router)# ospf router-id 100.3.1.1
sonic(config-router)# redistribute connected
sonic(config-router)# redistribute static
sonic(config-router)# network 14.14.14.0/24 area 1
# Enable LDP functionality on interface Ethernet2
sonic(config-ldp)# router-id 100.3.1.1
sonic(config-ldp)# address-family ipv4
sonic(config-ldp-af)# discovery transport-address 100.3.1.1
sonic(config-ldp-af)# exit-address-family
sonic(config-pw)# neighbor lsr-id 100.1.1.1
sonic(config-pw)# pw-id 100
sonic(config-l2vpn)# member interface ethernet 3
sonic(config-l2vpn)# member pseudowire pw1
Configuring MPLS L2VPN VPLS
Network Requirements

Configuration Steps
-
PE1 Device Configuration
# Configure interface IP address and enable MPLS functionality
sonic(config-if-1)# ip address 12.12.12.1/24
sonic(config-if-1)# mpls enable
sonic(config-if-1)# mpls ldp
# Create VLAN as L2VPN AC interface and add interface to VLAN
sonic(config-if-3)# switchport access vlan 100
# Establish OSPF session
sonic(config-if-lo1)# ip address 100.1.1.1/32
sonic(config)# router ospf
sonic(config-router)# ospf router-id 100.1.1.1
sonic(config-router)# redistribute connected
sonic(config-router)# redistribute static
sonic(config-router)# network 12.12.12.0/24 area 1
sonic(config-ldp)# router-id 100.1.1.1
sonic(config-ldp)# address-family ipv4
sonic(config-ldp-af)# discovery transport-address 100.1.1.1
sonic(config-ldp-af)# exit-address-family
sonic(config-pw)# neighbor lsr-id 100.3.1.1
sonic(config-pw)# pw-id 300
sonic(config)# pseudowire pw13
sonic(config-pw)# neighbor lsr-id 100.4.1.1
sonic(config-pw)# pw-id 400
sonic(config-l2vpn)# member interface vlan 100
sonic(config-l2vpn)# member pseudowire pw12
sonic(config-l2vpn)# member pseudowire pw13
2. P Device Configuration
# Configure interface IP addresses and enable MPLS functionality
sonic(config-if-1)# ip address 12.12.12.2/24
sonic(config-if-1)# mpls enable
sonic(config-if-1)# mpls ldp
sonic(config)# interface ethernet 2
sonic(config-if-2)# ip address 14.14.14.1/24
sonic(config-if-2)# mpls enable
sonic(config-if-2)# mpls ldp
sonic(config)# interface ethernet 3
sonic(config-if-3)# ip address 16.16.16.2/24
sonic(config-if-3)# mpls enable
sonic(config-if-3)# mpls ldp
# Establish OSPF session
sonic(config-if-lo1)# ip address 100.2.1.1/32
sonic(config)# router ospf
sonic(config-router)# ospf router-id 100.2.1.1
sonic(config-router)# redistribute connected
sonic(config-router)# redistribute static
sonic(config-router)# network 12.12.12.0/24 area 1
sonic(config-router)# network 14.14.14.0/24 area 1
sonic(config-router)# network 16.16.16.0/24 area 1
# Enable LDP functionality on interfaces Ethernet1, Ethernet2, and Ethernet3
sonic(config-ldp)# router-id 100.2.1.1
sonic(config-ldp)# address-family ipv4
sonic(config-ldp-af)# discovery transport-address 100.2.1.1
sonic(config-ldp-af)# exit-address-family
-
PE2 Device Configuration
# Create VLAN as L2VPN AC interface and add interface to VLAN
sonic(config)# interface ethernet 2
sonic(config-if-2)# ip address 14.14.14.2/24
sonic(config-if-2)# mpls enable
sonic(config-if-2)# mpls ldp
sonic(config)# interface ethernet 3
sonic(config-if-3)# switchport access vlan 100
# Establish OSPF session
sonic(config-if-lo1)# ip address 100.3.1.1/32
sonic(config)# router ospf
sonic(config-router)# ospf router-id 100.3.1.1
sonic(config-router)# redistribute connected
sonic(config-router)# redistribute static
sonic(config-router)# network 14.14.14.0/24 area 1
sonic(config-ldp)# router-id 100.3.1.1
sonic(config-ldp)# address-family ipv4
sonic(config-ldp-af)# discovery transport-address 100.3.1.1
sonic(config-ldp-af)# exit-address-family
sonic(config-pw)# neighbor lsr-id 100.1.1.1
sonic(config-pw)# pw-id 300
sonic(config)# pseudowire pw23
sonic(config-pw)# neighbor lsr-id 100.4.1.1
sonic(config-pw)# pw-id 500
sonic(config-l2vpn)# member interface vlan 100
sonic(config-l2vpn)# member pseudowire pw12
sonic(config-l2vpn)# member pseudowire pw23
-
PE3 Device Configuration
# Create VLAN as L2VPN AC interface and add interface to VLAN
sonic(config)# interface ethernet 3
sonic(config-if-3)# ip address 16.16.16.1/24
sonic(config-if-3)# mpls enable
sonic(config-if-3)# mpls ldp
sonic(config)# interface ethernet 1
sonic(config-if-1)# switchport access vlan 100
sonic(config-if-lo1)# ip address 100.4.1.1/32
sonic(config)# router ospf
sonic(config-router)# ospf router-id 100.4.1.1
sonic(config-router)# redistribute connected
sonic(config-router)# redistribute static
sonic(config-router)# network 16.16.16.0/24 area 1
sonic(config-ldp)# router-id 100.4.1.1
sonic(config-ldp)# address-family ipv4
sonic(config-ldp-af)# discovery transport-address 100.4.1.1
sonic(config-ldp-af)# exit-address-family
sonic(config-pw)# neighbor lsr-id 100.1.1.1
sonic(config-pw)# pw-id 400
sonic(config)# pseudowire pw23
sonic(config-pw)# neighbor lsr-id 100.3.1.1
sonic(config-pw)# pw-id 500
sonic(config-l2vpn)# member interface vlan 100
sonic(config-l2vpn)# member pseudowire pw13
sonic(config-l2vpn)# member pseudowire pw23
MPLS L3VPN Configuration
Network Requirements

Configuration Steps
-
PE1 Device Configuration
sonic(config)# interface ethernet 1
sonic(config-if-1)# vrf 1
sonic(config-if-1)# ip address 10.1.1.2/24
sonic(config)# interface ethernet 2
sonic(config-if-2)# ip address 20.1.1.1/24
sonic(config-if-2)# mpls enable
sonic(config-if-2)# mpls ldp
sonic(config-if-lo1)# ip address 1.1.1.1/32
sonic(config)# router ospf
sonic(config-router)# ospf router-id 1.1.1.1
sonic(config-router)# redistribute connected
sonic(config-router)# network 20.1.1.0/24 area 1
sonic(config-ldp)# router-id 1.1.1.1
sonic(config-ldp)# address-family ipv4
sonic(config-ldp-af)# discovery transport-address 20.1.1.1
sonic(config-router)# neighbor 4.4.4.4 remote-as 200
sonic(config-router)# neighbor 4.4.4.4 update-source 1.1.1.1
sonic(config-router)# address-family ipv4 vpn
sonic(config-router-af)# neighbor 4.4.4.4 activate
sonic(config-router)# no bgp ebgp-requires-policy
sonic(config-router)# neighbor 10.1.1.1 remote-as 100
sonic(config-router)# address-family ipv4 unicast
sonic(config-router-af)# label vpn export auto
sonic(config-router-af)# rd vpn export 1.1.1.1:2
sonic(config-router-af)# rt vpn both 200:2
sonic(config-router-af)# export vpn
sonic(config-router-af)# import vpn
-
ASR2 Device Configuration
#Configure interface IP addresses and enable MPLS functionality
sonic(config-if-2)# ip address 20.1.1.2/24
sonic(config-if-2)# mpls enable
sonic(config-if-2)# mpls ldp
sonic(config)# interface ethernet 3
sonic(config-if-3)# ip address 30.1.1.2/24
sonic(config-if-3)# mpls enable
sonic(config-if-3)# mpls ldp
#Establish OSPF session
sonic(config-if-lo1)# ip address 2.2.2.2/32
sonic(config)# router ospf
sonic(config-router)# ospf router-id 2.2.2.2
sonic(config-router)# redistribute connected
sonic(config-router)# network 20.1.1.0/24 area 1
sonic(config-router)# network 30.1.1.0/24 area 1
# Enable LDP functionality on interfaces Ethernet2 and Ethernet3
sonic(config-ldp)# router-id 2.2.2.2
sonic(config-ldp)# address-family ipv4
sonic(config-ldp-af)# discovery transport-address 20.1.1.2
-
PE2 Device Configuration
# Configure interface IP addresses, enable MPLS functionality, create vrf1, and add interface
sonic(config)# interface ethernet 1
sonic(config-if-1)# vrf 1
sonic(config-if-1)# ip address 10.2.2.2/24
sonic(config)# interface ethernet 3
sonic(config-if-3)# ip address 30.1.1.1/24
sonic(config-if-3)# mpls enable
sonic(config-if-3)# mpls ldp
# Establish OSPF session
sonic(config-if-lo1)# ip address 4.4.4.4/32
sonic(config)# router ospf
sonic(config-router)# ospf router-id 4.4.4.4
sonic(config-router)# redistribute connected
sonic(config-router)# network 30.1.1.0/24 area 1
# Enable LDP functionality on interfaces Ethernet1 and Ethernet3
sonic(config-ldp)# router-id 4.4.4.4
sonic(config-ldp)# address-family ipv4
sonic(config-ldp-af)# discovery transport-address 30.1.1.1
# Configure MP-BGP and establish neighbor relationship with PE1
sonic(config-router)# neighbor 1.1.1.1 remote-as 200
sonic(config-router)# neighbor 1.1.1.1 update-source 4.4.4.4
sonic(config-router)# address-family ipv4 vpn
sonic(config-router-af)# neighbor 1.1.1.1 activate
# Configure EBGP and establish neighbor relationship with CE2
sonic(config-router)# no bgp ebgp-requires-policy
sonic(config-router)# neighbor 10.2.2.1 remote-as 300
sonic(config-router)# address-family ipv4 unicast
sonic(config-router-af)# label vpn export auto
sonic(config-router-af)# rd vpn export 4.4.4.4:2
sonic(config-router-af)# rt vpn both 200:2
sonic(config-router-af)# export vpn
sonic(config-router-af)# import vpn
-
CE1 Device Configuration
sonic(config-if-1)# ip address 10.1.1.1/24
# Configure EBGP, establish neighbor relationship with PE1, and redistribute connected routes
sonic(config-router)# no bgp ebgp-requires-policy
sonic(config-router)# neighbor 10.1.1.2 remote-as 200
sonic(config-router)# address-family ipv4 unicast
sonic(config-router-af)# redistribute connected
-
CE2 Device Configuration
# Configure interface IP address
sonic(config-if-1)# ip address 10.2.2.1/24
# Configure EBGP, establish neighbor relationship with PE2, and redistribute connected routes
sonic(config-router)# no bgp ebgp-requires-policy
sonic(config-router)# neighbor 10.2.2.2 remote-as 200
sonic(config-router)# address-family ipv4 unicast
sonic(config-router-af)# redistribute connected
MPLS L3VPN Option A Configuration
Network Requirements

Configuration Steps
-
PE1 Device Configuration
# Configure interface IP addresses and enable MPLS functionality, create vrf1 and add interface Ethernet1
sonic(config)# interface ethernet 1
sonic(config-if-1)# ip address 10.1.1.1/24
sonic(config-if-1)# vrf 1
sonic(config)# interface ethernet 2
sonic(config-if-2)# ip address 20.1.1.1/24
sonic(config-if-2)# mpls enable
sonic(config-if-2)# mpls ldp
# Establish OSPF session
sonic(config-if-lo1)# ip address 1.1.1.1/32
sonic(config)# router ospf
sonic(config-router)# ospf router-id 1.1.1.1
sonic(config-router)# redistribute connected
sonic(config-router)# network 20.1.1.0/24 area 1
# Enable LDP functionality on interfaces Ethernet2
sonic(config-ldp)# router-id 1.1.1.1
sonic(config-ldp)# address-family ipv4
sonic(config-ldp-af)# discovery transport-address 20.1.1.1
# Create MP-BGP and establish neighbor relationship with ASBR1
sonic(config-router)# neighbor 2.2.2.2 remote-as 200
sonic(config-router)# neighbor 2.2.2.2 update-source 1.1.1.1
sonic(config-router)# address-family ipv4 vpn
sonic(config-router-af)# neighbor 2.2.2.2 activate
# Create EBGP and establish neighbor relationship with CE1
sonic(config-router)# no bgp ebgp-requires-policy
sonic(config-router)# neighbor 10.1.1.2 remote-as 102
sonic(config-router)# address-family ipv4 unicast
sonic(config-router-af)# label vpn export auto
sonic(config-router-af)# rd vpn export 200:1
sonic(config-router-af)# rt vpn both 1:1
sonic(config-router-af)# export vpn
sonic(config-router-af)# import vpn
- ASBR1 Device Configuration
# Configure IP addresses for interfaces and enable MPLS. Create vrf1 and add Ethernet3 to it
sonic(config-if-2)# ip address 20.1.1.2/24
sonic(config-if-2)# mpls enable
sonic(config-if-2)# mpls ldp
sonic(config)# interface ethernet 3
sonic(config-if-3)# ip address 30.1.1.1/24
sonic(config-if-3)# vrf 1
# Establish OSPF session
sonic(config-if-lo1)# ip address 2.2.2.2/32
sonic(config)# router ospf
sonic(config-router)# ospf router-id 2.2.2.2
sonic(config-router)# redistribute connected
sonic(config-router)# network 20.1.1.0/24 area 1
# Enable LDP functionality on interfaces Ethernet2
sonic(config-ldp)# router-id 2.2.2.2
sonic(config-ldp)# address-family ipv4
sonic(config-ldp-af)# discovery transport-address 20.1.1.2
# Create MP-BGP and establish neighbor relationship with PE1
sonic(config-router)# neighbor 1.1.1.1 remote-as 200
sonic(config-router)# neighbor 1.1.1.1 update-source 2.2.2.2
sonic(config-router)# address-family ipv4 vpn
sonic(config-router-af)# neighbor 1.1.1.1 activate
# Create EBGP and establish neighbor relationship with ASBR2
sonic(config-router)# no bgp ebgp-requires-policy
sonic(config-router)# neighbor 30.1.1.2 remote-as 300
sonic(config-router)# address-family ipv4 unicast
sonic(config-router-af)# label vpn export auto
sonic(config-router-af)# rd vpn export 200:2
sonic(config-router-af)# rt vpn both 1:1
sonic(config-router-af)# export vpn
sonic(config-router-af)# import vpn
3. ASBR2 Device Configuration
# Configure interface IP addresses and enable MPLS, create VRF1 and add Ethernet3
sonic(config-if-2)# ip address 20.2.2.2/24
sonic(config-if-2)# mpls enable
sonic(config-if-2)# mpls ldp
sonic(config)# interface ethernet 3
sonic(config-if-3)# ip address 30.1.1.2/24
sonic(config-if-3)# vrf 1
# Establish OSPF session
sonic(config-if-lo1)# ip address 3.3.3.3/32
sonic(config)# router ospf
sonic(config-router)# ospf router-id 3.3.3.3
sonic(config-router)# redistribute connected
sonic(config-router)# network 20.2.2.0/24 area 1
# Enable LDP on Ethernet2 interface
sonic(config-ldp)# router-id 3.3.3.3
sonic(config-ldp)# address-family ipv4
sonic(config-ldp-af)# discovery transport-address 20.2.2.2
# Create MP-BGP, establish neighbor with PE2
sonic(config-router)# neighbor 4.4.4.4 remote-as 300
sonic(config-router)# neighbor 4.4.4.4 update-source 3.3.3.3
sonic(config-router)# address-family ipv4 vpn
sonic(config-router-af)# neighbor 4.4.4.4 activate
# Create EBGP, establish neighbor with ASBR1
sonic(config)# router bgp 300 vrf 1
sonic(config-router)# no bgp ebgp-requires-policy
sonic(config-router)# neighbor 30.1.1.1 remote-as 200
sonic(config-router)# address-family ipv4 unicast
sonic(config-router-af)# label vpn export auto
sonic(config-router-af)# rd vpn export 300:2
sonic(config-router-af)# rt vpn both 3:3
sonic(config-router-af)# export vpn
sonic(config-router-af)# import vpn
4. PE2 Device Configuration
# Configure interface IP addresses and enable MPLS, create VRF1 and add Ethernet1
sonic(config)# vrf 1
sonic(config)# interface ethernet 1
sonic(config-if-1)# ip address 10.2.2.1/24
sonic(config-if-1)# vrf 1
sonic(config)# interface ethernet 2
sonic(config-if-2)# ip address 20.2.2.1/24
sonic(config-if-2)# mpls enable
sonic(config-if-2)# mpls ldp
# Establish OSPF session
sonic(config)# interface loopback 1
sonic(config-if-lo1)# ip address 4.4.4.4/32
sonic(config)# router ospf
sonic(config-router)# ospf router-id 4.4.4.4
sonic(config-router)# redistribute connected
sonic(config-router)# network 20.2.2.0/24 area 1
# Enable LDP on Ethernet2 interface
sonic(config)# mpls ldp
sonic(config-ldp)# router-id 4.4.4.4
sonic(config-ldp)# address-family ipv4
sonic(config-ldp-af)# discovery transport-address 20.2.2.1
# Create MP-BGP, establish neighbor with ASBR2
sonic(config)# router bgp 300
sonic(config-router)# neighbor 3.3.3.3 remote-as 300
sonic(config-router)# neighbor 3.3.3.3 update-source 4.4.4.4
sonic(config-router)# address-family ipv4 vpn
sonic(config-router-af)# neighbor 3.3.3.3 activate
# Create EBGP, establish neighbor with CE2
sonic(config)# router bgp 300 vrf 1
sonic(config-router)# no bgp ebgp-requires-policy
sonic(config-router)# neighbor 10.2.2.2 remote-as 103
sonic(config-router)# address-family ipv4 unicast
sonic(config-router-af)# label vpn export auto
sonic(config-router-af)# rd vpn export 300:1
sonic(config-router-af)# rt vpn both 3:3
sonic(config-router-af)# export vpn
sonic(config-router-af)# import vpn
5. CE1 Device Configuration
# Configure Ethernet1 interface IP address
sonic(config)# interface ethernet 1
sonic(config-if-1)# ip address 10.1.1.2/24
# Create EBGP, establish neighbor with PE1, and redistribute connected routes
sonic(config)# router bgp 102
sonic(config-router)# no bgp ebgp-requires-policy
sonic(config-router)# neighbor 10.1.1.1 remote-as 200
sonic(config-router)# address-family ipv4 unicast
sonic(config-router-af)# redistribute connected
6. CE2 Device Configuration
# Configure Ethernet1 interface IP address
sonic(config)# interface ethernet 1
sonic(config-if-1)# ip address 10.2.2.2/24
# Create EBGP, establish neighbor with PE2, redistribute connected routes
sonic(config)# router bgp 103
sonic(config-router)# no bgp ebgp-requires-policy
sonic(config-router)# neighbor 10.2.2.1 remote-as 300
sonic(config-router)# address-family ipv4 unicast
sonic(config-router-af)# redistribute connected
MPLS L3VPN Option B Configuration
Network Requirements

Configure MPLS L3VPN Option B topology where: OSPF and LDP protocols run between PE1-ASBR1 and PE2-ASBR2; EBGP neighbors are established between PE and CE devices; MP-IBGP neighbors established between PE and ASBR devices; MP-EBGP neighbors established between ASBR devices; Enable communication between CE1 and CE2 in the same VPN.
Configuration Steps
1. PE1 Device Configuration
# Configure interface IP addresses and enable MPLS, create VRF1 and add Ethernet1
sonic(config)# vrf 1
sonic(config)# interface ethernet 1
sonic(config-if-1)# vrf 1
sonic(config-if-1)# ip address 10.1.1.1/24
sonic(config)# interface ethernet 2
sonic(config-if-2)# ip address 20.1.1.1/24
sonic(config-if-2)# mpls enable
sonic(config-if-2)# mpls ldp
# Establish OSPF session
sonic(config)# interface loopback 1
sonic(config-if-lo1)# ip address 1.1.1.1/32
sonic(config)# router ospf
sonic(config-router)# ospf router-id 1.1.1.1
sonic(config-router)# redistribute connected
sonic(config-router)# network 20.1.1.0/24 area 1
# Enable LDP on Ethernet2 interface
sonic(config)# mpls ldp
sonic(config-ldp)# router-id 1.1.1.1
sonic(config-ldp)# address-family ipv4
sonic(config-ldp-af)# discovery transport-address 20.1.1.1
# Create MP-BGP, establish neighbor with ASBR1
sonic(config)# router bgp 200
sonic(config-router)# neighbor 2.2.2.2 remote-as 200
sonic(config-router)# neighbor 2.2.2.2 update-source 1.1.1.1
sonic(config-router)# address-family ipv4 unicast
sonic(config-router-af)# no neighbor 2.2.2.2 activate
sonic(config-router-af)# exit-address-family
sonic(config-router)# address-family ipv4 vpn
sonic(config-router-af)# neighbor 2.2.2.2 activate
# Create EBGP, establish neighbor with CE1
sonic(config)# router bgp 200 vrf 1
sonic(config-router)# no bgp ebgp-requires-policy
sonic(config-router)# neighbor 10.1.1.2 remote-as 102
sonic(config-router)# address-family ipv4 unicast
sonic(config-router-af)# label vpn export auto
sonic(config-router-af)# rd vpn export 200:1
sonic(config-router-af)# rt vpn both 1:1
sonic(config-router-af)# export vpn
sonic(config-router-af)# import vpn
2. ASBR1 Device Configuration
# Configure interface IP addresses and enable MPLS
sonic(config)# interface ethernet 2
sonic(config-if-2)# ip address 20.1.1.2/24
sonic(config-if-2)# mpls bgp l3vpn-multi-domain-switching
sonic(config-if-2)# mpls enable
sonic(config-if-2)# mpls ldp
sonic(config)# interface ethernet 3
sonic(config-if-3)# ip address 30.1.1.1/24
sonic(config-if-3)# mpls bgp l3vpn-multi-domain-switching
sonic(config-if-3)# mpls enable
# Establish OSPF session
sonic(config)# interface loopback 1
sonic(config-if-lo1)# ip address 2.2.2.2/32
sonic(config)# router ospf
sonic(config-router)# ospf router-id 2.2.2.2
sonic(config-router)# redistribute connected
sonic(config-router)# network 20.1.1.0/24 area 1
# Enable LDP on Ethernet2 interface
sonic(config)# mpls ldp
sonic(config-ldp)# router-id 2.2.2.2
sonic(config-ldp)# address-family ipv4
sonic(config-ldp-af)# discovery transport-address 20.1.1.2
# Create MP-BGP, establish neighbors with PE1 and ASBR2
sonic(config)# router bgp 200
sonic(config-router)# no bgp ebgp-requires-policy
sonic(config-router)# neighbor 1.1.1.1 remote-as 200
sonic(config-router)# neighbor 1.1.1.1 update-source 2.2.2.2
sonic(config-router)# neighbor 30.1.1.2 remote-as 300
sonic(config-router)# address-family ipv4 unicast
sonic(config-router-af)# no neighbor 1.1.1.1 activate
sonic(config-router-af)# no neighbor 30.1.1.2 activate
sonic(config-router-af)# exit-address-family
sonic(config-router)# address-family ipv4 vpn
sonic(config-router-af)# neighbor 1.1.1.1 activate
sonic(config-router-af)# neighbor 1.1.1.1 next-hop-self
sonic(config-router-af)# neighbor 30.1.1.2 activate
sonic(config-router-af)# neighbor 30.1.1.2 next-hop-self
sonic(config-router-af)# exit-address-family
3. ASBR2 Device Configuration
# Configure interface IP addresses and enable MPLS
sonic(config)# interface ethernet 2
sonic(config-if-2)# ip address 20.2.2.2/24
sonic(config-if-2)# mpls bgp l3vpn-multi-domain-switching
sonic(config-if-2)# mpls enable
sonic(config-if-2)# mpls ldp
sonic(config)# interface ethernet 3
sonic(config-if-3)# ip address 30.1.1.2/24
sonic(config-if-3)# mpls bgp l3vpn-multi-domain-switching
sonic(config-if-3)# mpls enable
# Establish OSPF session
sonic(config)# interface loopback 1
sonic(config-if-lo1)# ip address 3.3.3.3/32
sonic(config)# router ospf
sonic(config-router)# ospf router-id 3.3.3.3
sonic(config-router)# redistribute connected
sonic(config-router)# network 20.2.2.0/24 area 1
# Enable LDP on Ethernet2 interface
sonic(config)# mpls ldp
sonic(config-ldp)# router-id 3.3.3.3
sonic(config-ldp)# address-family ipv4
sonic(config-ldp-af)# discovery transport-address 20.2.2.2
# Create MP-BGP, establish neighbors with PE2 and ASBR1
sonic(config)# router bgp 300
sonic(config-router)# no bgp ebgp-requires-policy
sonic(config-router)# neighbor 4.4.4.4 remote-as 300
sonic(config-router)# neighbor 4.4.4.4 update-source 3.3.3.3
sonic(config-router)# neighbor 30.1.1.1 remote-as 200
sonic(config-router)# address-family ipv4 unicast
sonic(config-router-af)# no neighbor 4.4.4.4 activate
sonic(config-router-af)# no neighbor 30.1.1.1 activate
sonic(config-router-af)# exit-address-family
sonic(config-router)# address-family ipv4 vpn
sonic(config-router-af)# neighbor 4.4.4.4 activate
sonic(config-router-af)# neighbor 4.4.4.4 next-hop-self
sonic(config-router-af)# neighbor 30.1.1.1 activate
sonic(config-router-af)# neighbor 30.1.1.1 next-hop-self
sonic(config-router-af)# exit-address-family
4. PE2 Device Configuration
# Configure interface IP addresses and enable MPLS, create VRF1 and add Ethernet1
sonic(config)# vrf 1
sonic(config)# interface ethernet 1
sonic(config-if-1)# vrf 1
sonic(config-if-1)# ip address 10.2.2.1/24
sonic(config)# interface ethernet 2
sonic(config-if-2)# ip address 20.2.2.1/24
sonic(config-if-2)# mpls enable
sonic(config-if-2)# mpls ldp
# Establish OSPF session
sonic(config)# interface loopback 1
sonic(config-if-lo1)# ip address 4.4.4.4/32
sonic(config)# router ospf
sonic(config-router)# ospf router-id 4.4.4.4
sonic(config-router)# redistribute connected
sonic(config-router)# network 20.2.2.0/24 area 1
# Enable LDP on Ethernet2 interface
sonic(config)# mpls ldp
sonic(config-ldp)# router-id 4.4.4.4
sonic(config-ldp)# address-family ipv4
sonic(config-ldp-af)# discovery transport-address 20.2.2.1
# Create MP-BGP, establish neighbor with ASBR2
sonic(config)# router bgp 300
sonic(config-router)# neighbor 3.3.3.3 remote-as 300
sonic(config-router)# neighbor 3.3.3.3 update-source 4.4.4.4
sonic(config-router)# address-family ipv4 unicast
sonic(config-router-af)# no neighbor 3.3.3.3 activate
sonic(config-router-af)# exit-address-family
sonic(config-router)# address-family ipv4 vpn
sonic(config-router-af)# neighbor 3.3.3.3 activate
# Create EBGP, establish neighbor with CE2
sonic(config)# router bgp 300 vrf 1
sonic(config-router)# no bgp ebgp-requires-policy
sonic(config-router)# neighbor 10.2.2.2 remote-as 103
sonic(config-router)# address-family ipv4 unicast
sonic(config-router-af)# label vpn export auto
sonic(config-router-af)# rd vpn export 300:1
sonic(config-router-af)# rt vpn both 1:1
sonic(config-router-af)# export vpn
sonic(config-router-af)# import vpn
5. CE1 Device Configuration
# Configure Ethernet1 interface IP address
sonic(config)# interface ethernet 1
sonic(config-if-1)# ip address 10.1.1.2/24
# Create EBGP, establish neighbor with PE1, redistribute connected routes
sonic(config)# router bgp 102
sonic(config-router)# no bgp ebgp-requires-policy
sonic(config-router)# neighbor 10.1.1.1 remote-as 200
sonic(config-router)# address-family ipv4 unicast
sonic(config-router-af)# redistribute connected
6. Device CE2 Configuration
# Configure Ethernet1 interface IP address
sonic(config)# interface ethernet 1
sonic(config-if-1)# ip address 10.2.2.2/24
# Create EBGP, establish neighbor with PE2, redistribute connected routes
sonic(config)# router bgp 103
sonic(config-router)# no bgp ebgp-requires-policy
sonic(config-router)# neighbor 10.2.2.1 remote-as 300
sonic(config-router)# address-family ipv4 unicast
sonic(config-router-af)# redistribute connected