Segment Routing BGP L2VPN

This lab is on the Junos vEvo platform and OSPF is used rather than IS-IS. My preference is always to use IS-IS but you can use OSPF for segment routing.

PE1

set interfaces et-0/0/0 vlan-tagging
set interfaces et-0/0/0 encapsulation flexible-ethernet-services
set interfaces et-0/0/0 unit 512 encapsulation vlan-ccc
set interfaces et-0/0/0 unit 512 vlan-id 512
set interfaces et-0/0/2 unit 0 family inet address 1.1.1.1/30
set interfaces et-0/0/2 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 5.5.5.5/32
set interfaces lo0 unit 0 family mpls
set routing-instances cust1 instance-type l2vpn
set routing-instances cust1 protocols l2vpn site cust1 interface et-0/0/0.512
set routing-instances cust1 protocols l2vpn site cust1 site-identifier 1
set routing-instances cust1 protocols l2vpn encapsulation-type ethernet-vlan
set routing-instances cust1 interface et-0/0/0.512
set routing-instances cust1 route-distinguisher 5.5.5.5:1
set routing-instances cust1 vrf-target target:65530:1
set routing-options router-id 5.5.5.5
set routing-options autonomous-system 65530
set protocols bgp path-selection l2vpn-use-bgp-rules
set protocols bgp group int type internal
set protocols bgp group int local-address 5.5.5.5
set protocols bgp group int family inet unicast
set protocols bgp group int family l2vpn signaling
set protocols bgp group int neighbor 8.8.8.8
set protocols mpls interface all
set protocols ospf source-packet-routing node-segment ipv4-index 600
set protocols ospf source-packet-routing srgb start-label 70000
set protocols ospf source-packet-routing srgb index-range 1000
set protocols ospf area 0.0.0.0 interface et-0/0/2.0
set protocols ospf area 0.0.0.0 interface lo0.0 passive

P1

set interfaces et-0/0/0 unit 0 family inet address 1.1.1.2/30
set interfaces et-0/0/0 unit 0 family mpls
set interfaces et-0/0/1 unit 0 family inet address 2.2.2.1/30
set interfaces et-0/0/1 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 6.6.6.6/32
set interfaces lo0 unit 0 family mpls
set protocols mpls interface all
set protocols ospf source-packet-routing node-segment ipv4-index 601
set protocols ospf source-packet-routing srgb start-label 70000
set protocols ospf source-packet-routing srgb index-range 1000
set protocols ospf area 0.0.0.0 interface et-0/0/0.0
set protocols ospf area 0.0.0.0 interface et-0/0/1.0
set protocols ospf area 0.0.0.0 interface lo0.0 passive

P2

set interfaces et-0/0/0 unit 0 family inet address 2.2.2.2/30
set interfaces et-0/0/0 unit 0 family mpls
set interfaces et-0/0/1 unit 0 family inet address 3.3.3.1/30
set interfaces et-0/0/1 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 33.33.33.33/32
set interfaces lo0 unit 0 family mpls
set protocols mpls interface all
set protocols ospf source-packet-routing node-segment ipv4-index 602
set protocols ospf source-packet-routing srgb start-label 70000
set protocols ospf source-packet-routing srgb index-range 1000
set protocols ospf area 0.0.0.0 interface et-0/0/0.0
set protocols ospf area 0.0.0.0 interface et-0/0/1.0
set protocols ospf area 0.0.0.0 interface lo0.0 passive

P3

set interfaces et-0/0/0 unit 0 family inet address 3.3.3.2/30
set interfaces et-0/0/0 unit 0 family mpls
set interfaces et-0/0/1 unit 0 family inet address 4.4.4.1/30
set interfaces et-0/0/1 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 7.7.7.7/32
set interfaces lo0 unit 0 family mpls
set protocols mpls interface all
set protocols ospf source-packet-routing node-segment ipv4-index 603
set protocols ospf source-packet-routing srgb start-label 70000
set protocols ospf source-packet-routing srgb index-range 1000
set protocols ospf area 0.0.0.0 interface et-0/0/0.0
set protocols ospf area 0.0.0.0 interface et-0/0/1.0
set protocols ospf area 0.0.0.0 interface lo0.0 passive

PE2

set interfaces et-0/0/0 vlan-tagging
set interfaces et-0/0/0 encapsulation flexible-ethernet-services
set interfaces et-0/0/0 unit 512 encapsulation vlan-ccc
set interfaces et-0/0/0 unit 512 vlan-id 512
set interfaces et-0/0/2 unit 0 family inet address 4.4.4.2/30
set interfaces et-0/0/2 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 8.8.8.8/32
set interfaces lo0 unit 0 family mpls
set routing-instances cust1 instance-type l2vpn
set routing-instances cust1 protocols l2vpn site cust1 interface et-0/0/0.512
set routing-instances cust1 protocols l2vpn site cust1 site-identifier 2
set routing-instances cust1 protocols l2vpn encapsulation-type ethernet-vlan
set routing-instances cust1 interface et-0/0/0.512
set routing-instances cust1 route-distinguisher 8.8.8.8:1
set routing-instances cust1 vrf-target target:65530:1
set routing-options router-id 8.8.8.8
set routing-options autonomous-system 65530
set protocols bgp path-selection l2vpn-use-bgp-rules
set protocols bgp group int type internal
set protocols bgp group int local-address 8.8.8.8
set protocols bgp group int family inet unicast
set protocols bgp group int family l2vpn signaling
set protocols bgp group int neighbor 5.5.5.5
set protocols mpls interface all
set protocols ospf source-packet-routing node-segment ipv4-index 604
set protocols ospf source-packet-routing srgb start-label 70000
set protocols ospf source-packet-routing srgb index-range 1000
set protocols ospf area 0.0.0.0 interface et-0/0/2.0
set protocols ospf area 0.0.0.0 interface lo0.0 passive

The VPN will now be up and have confirmed by configuring OSPF on the CE devices.

Segment Routing MPLS EVPN

Below link provides more information on Segment Routing. OSPF can be used but this lab uses IS-IS. Cisco vIOS routers used as the CE devices and an OSPF adjacency established between them.

https://www.juniper.net/gb/en/research-topics/what-is-segment-routing.html#:~:text=Segment%20routing%20(SR)%20is%20a,headers%20at%20an%20ingress%20node.

PE1

set chassis network-services enhanced-ip
set interfaces ge-0/0/0 flexible-vlan-tagging
set interfaces ge-0/0/0 encapsulation flexible-ethernet-services
set interfaces ge-0/0/0 unit 432 encapsulation vlan-bridge
set interfaces ge-0/0/0 unit 432 vlan-id 432
set interfaces ge-0/0/0 unit 432 family bridge
set interfaces ge-0/0/2 unit 0 family inet address 1.1.1.1/30
set interfaces ge-0/0/2 unit 0 family iso
set interfaces ge-0/0/2 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 5.5.5.5/32
set interfaces lo0 unit 0 family iso address 49.0000.5555.5555.5555.00
set interfaces lo0 unit 0 family mpls
set routing-options router-id 5.5.5.5
set routing-options autonomous-system 65400
set protocols mpls interface all
set protocols bgp group internal type internal
set protocols bgp group internal local-address 5.5.5.5
set protocols bgp group internal family evpn signaling
set protocols bgp group internal neighbor 8.8.8.8
set protocols isis source-packet-routing node-segment ipv4-index 500
set protocols isis source-packet-routing srgb start-label 800000
set protocols isis source-packet-routing srgb index-range 9000
set protocols isis level 1 disable
set protocols isis interface ge-0/0/2.0
set protocols isis interface lo0.0
set routing-instances cust1 instance-type evpn
set routing-instances cust1 vlan-id 432
set routing-instances cust1 interface ge-0/0/0.432
set routing-instances cust1 route-distinguisher 5.5.5.5:1
set routing-instances cust1 vrf-target target:65400:1
set routing-instances cust1 protocols evpn interface ge-0/0/0.432

P1

set chassis network-services enhanced-ip
set interfaces ge-0/0/0 unit 0 family inet address 1.1.1.2/30
set interfaces ge-0/0/0 unit 0 family iso
set interfaces ge-0/0/0 unit 0 family mpls
set interfaces ge-0/0/1 unit 0 family inet address 2.2.2.1/30
set interfaces ge-0/0/1 unit 0 family iso
set interfaces ge-0/0/1 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 6.6.6.6/32
set interfaces lo0 unit 0 family iso address 49.0000.6666.6666.6666.00
set interfaces lo0 unit 0 family mpls
set protocols mpls interface all
set protocols isis source-packet-routing node-segment ipv4-index 501
set protocols isis source-packet-routing srgb start-label 800000
set protocols isis source-packet-routing srgb index-range 9000
set protocols isis level 1 disable
set protocols isis interface ge-0/0/0.0
set protocols isis interface ge-0/0/1.0
set protocols isis interface lo0.0

P2

set chassis network-services enhanced-ip
set interfaces ge-0/0/0 unit 0 family inet address 2.2.2.2/30
set interfaces ge-0/0/0 unit 0 family iso
set interfaces ge-0/0/0 unit 0 family mpls
set interfaces ge-0/0/1 unit 0 family inet address 3.3.3.1/30
set interfaces ge-0/0/1 unit 0 family iso
set interfaces ge-0/0/1 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 33.33.33.33/32
set interfaces lo0 unit 0 family iso address 49.0000.3333.3333.0000.00
set interfaces lo0 unit 0 family mpls
set protocols mpls interface all
set protocols isis source-packet-routing node-segment ipv4-index 502
set protocols isis source-packet-routing srgb start-label 800000
set protocols isis source-packet-routing srgb index-range 9000
set protocols isis level 1 disable
set protocols isis interface ge-0/0/0.0
set protocols isis interface ge-0/0/1.0
set protocols isis interface lo0.0

P3

set chassis network-services enhanced-ip
set interfaces ge-0/0/0 unit 0 family inet address 3.3.3.2/30
set interfaces ge-0/0/0 unit 0 family iso
set interfaces ge-0/0/0 unit 0 family mpls
set interfaces ge-0/0/1 unit 0 family inet address 4.4.4.1/30
set interfaces ge-0/0/1 unit 0 family iso
set interfaces ge-0/0/1 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 7.7.7.7/32
set interfaces lo0 unit 0 family iso address 49.0000.7777.7777.7777.00
set interfaces lo0 unit 0 family mpls
set protocols mpls interface all
set protocols isis source-packet-routing node-segment ipv4-index 503
set protocols isis source-packet-routing srgb start-label 800000
set protocols isis source-packet-routing srgb index-range 9000
set protocols isis level 1 disable
set protocols isis interface ge-0/0/0.0
set protocols isis interface ge-0/0/1.0
set protocols isis interface lo0.0

PE2

set chassis network-services enhanced-ip
set interfaces ge-0/0/0 flexible-vlan-tagging
set interfaces ge-0/0/0 encapsulation flexible-ethernet-services
set interfaces ge-0/0/0 unit 432 encapsulation vlan-bridge
set interfaces ge-0/0/0 unit 432 vlan-id 432
set interfaces ge-0/0/0 unit 432 family bridge
set interfaces ge-0/0/2 unit 0 family inet address 4.4.4.2/30
set interfaces ge-0/0/2 unit 0 family iso
set interfaces ge-0/0/2 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 8.8.8.8/32
set interfaces lo0 unit 0 family iso address 49.0000.8888.8888.8888.00
set interfaces lo0 unit 0 family mpls
set routing-options autonomous-system 65400
set protocols mpls interface all
set protocols bgp group internal type internal
set protocols bgp group internal local-address 8.8.8.8
set protocols bgp group internal family evpn signaling
set protocols bgp group internal neighbor 5.5.5.5
set protocols isis source-packet-routing node-segment ipv4-index 504
set protocols isis source-packet-routing srgb start-label 800000
set protocols isis source-packet-routing srgb index-range 9000
set protocols isis level 1 disable
set protocols isis interface ge-0/0/2.0
set protocols isis interface lo0.0
set routing-instances cust1 instance-type evpn
set routing-instances cust1 vlan-id 432
set routing-instances cust1 interface ge-0/0/0.432
set routing-instances cust1 route-distinguisher 8.8.8.8:1
set routing-instances cust1 vrf-target target:65400:1
set routing-instances cust1 protocols evpn interface ge-0/0/0.432

Layer 2 circuit and OSPF is now up between the 2 CE devices

Carrier of Carriers BGP L2VPN

Establish a layer 2 circuit between the 2 CE devices, traversing 3 separate AS’s.

https://www.juniper.net/documentation/us/en/software/junos/vpn-l3/topics/topic-map/l3-vpns-carrier-carrier.html

PE1

set interfaces ge-0/0/0 vlan-tagging
set interfaces ge-0/0/0 encapsulation flexible-ethernet-services
set interfaces ge-0/0/0 unit 3222 encapsulation vlan-ccc
set interfaces ge-0/0/0 unit 3222 vlan-id 3222
set interfaces ge-0/0/2 unit 0 family inet address 1.1.1.1/30
set interfaces ge-0/0/2 unit 0 family iso
set interfaces ge-0/0/2 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 5.5.5.5/32
set interfaces lo0 unit 0 family iso address 49.0000.5555.5555.5555.00
set interfaces lo0 unit 0 family mpls
set routing-options router-id 5.5.5.5
set routing-options autonomous-system 65200
set protocols mpls interface all
set protocols bgp group external type external
set protocols bgp group external multihop
set protocols bgp group external local-address 5.5.5.5
set protocols bgp group external family l2vpn signaling
set protocols bgp group external peer-as 65600
set protocols bgp group external neighbor 11.11.11.11
set protocols bgp group internal type internal
set protocols bgp group internal local-address 5.5.5.5
set protocols bgp group internal family inet labeled-unicast resolve-vpn
set protocols bgp group internal neighbor 6.6.6.6
set protocols isis interface ge-0/0/2.0
set protocols isis interface lo0.0
set protocols ldp interface all
set routing-instances cust1 instance-type l2vpn
set routing-instances cust1 interface ge-0/0/0.3222
set routing-instances cust1 route-distinguisher 5.5.5.5:1
set routing-instances cust1 vrf-target target:65200:1
set routing-instances cust1 protocols l2vpn encapsulation-type ethernet-vlan
set routing-instances cust1 protocols l2vpn site cust1 site-identifier 1
set routing-instances cust1 protocols l2vpn site cust1 interface ge-0/0/0.3222

ASBR1

set interfaces ge-0/0/0 unit 0 family inet address 1.1.1.2/30
set interfaces ge-0/0/0 unit 0 family iso
set interfaces ge-0/0/0 unit 0 family mpls
set interfaces ge-0/0/1 unit 0 family inet address 2.2.2.1/30
set interfaces ge-0/0/1 unit 0 family iso
set interfaces ge-0/0/1 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 6.6.6.6/32
set interfaces lo0 unit 0 family iso address 49.0000.6666.6666.6666.00
set interfaces lo0 unit 0 family mpls
set routing-options router-id 6.6.6.6
set routing-options autonomous-system 65200
set protocols mpls interface all
set protocols bgp group internal type internal
set protocols bgp group internal local-address 6.6.6.6
set protocols bgp group internal family inet labeled-unicast
set protocols bgp group internal neighbor 5.5.5.5
set protocols bgp group external type external
set protocols bgp group external family inet labeled-unicast
set protocols bgp group external export PE1_LOOPBACK
set protocols bgp group external peer-as 65400
set protocols bgp group external neighbor 2.2.2.2
set protocols isis interface ge-0/0/0.0
set protocols isis interface lo0.0
set protocols ldp interface all
set policy-options policy-statement PE1_LOOPBACK from route-filter 5.5.5.5/32 exact
set policy-options policy-statement PE1_LOOPBACK then accept

CoC ASBR1

set interfaces ge-0/0/0 unit 0 family inet address 2.2.2.2/30
set interfaces ge-0/0/0 unit 0 family iso
set interfaces ge-0/0/0 unit 0 family mpls
set interfaces ge-0/0/1 unit 0 family inet address 3.3.3.1/30
set interfaces ge-0/0/1 unit 0 family iso
set interfaces ge-0/0/1 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 7.7.7.7/32
set interfaces lo0 unit 0 family iso address 49.0000.7777.7777.0000.00
set interfaces lo0 unit 0 family mpls
set routing-options router-id 7.7.7.7
set routing-options autonomous-system 65400
set protocols mpls interface all
set protocols bgp group external type external
set protocols bgp group external family inet labeled-unicast
set protocols bgp group external peer-as 65200
set protocols bgp group external neighbor 2.2.2.1
set protocols bgp group internal type internal
set protocols bgp group internal local-address 7.7.7.7
set protocols bgp group internal family inet labeled-unicast
set protocols bgp group internal neighbor 8.8.8.8 
set protocols isis interface ge-0/0/1.0
set protocols isis interface ge-0/0/2.0
set protocols isis interface lo0.0
set protocols ldp interface all

CoC Core

set interfaces ge-0/0/0 unit 0 family inet address 3.3.3.2/30
set interfaces ge-0/0/0 unit 0 family iso
set interfaces ge-0/0/0 unit 0 family mpls
set interfaces ge-0/0/1 unit 0 family inet address 4.4.4.1/30
set interfaces ge-0/0/1 unit 0 family iso
set interfaces ge-0/0/1 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 8.8.8.8/32
set interfaces lo0 unit 0 family iso address 49.0000.8888.8888.0000.00
set interfaces lo0 unit 0 family mpls
set routing-options router-id 8.8.8.8
set routing-options autonomous-system 65400
set protocols mpls interface all
set protocols bgp group internal type internal
set protocols bgp group internal local-address 8.8.8.8
set protocols bgp group internal family inet labeled-unicast
set protocols bgp group internal cluster 8.8.8.8
set protocols bgp group internal neighbor 9.9.9.9
set protocols bgp group internal neighbor 7.7.7.7
set protocols isis interface ge-0/0/0.0
set protocols isis interface ge-0/0/1.0
set protocols isis interface lo0.0
set protocols ldp interface all

CoC ASBR2

set interfaces ge-0/0/0 unit 0 family inet address 4.4.4.2/30
set interfaces ge-0/0/0 unit 0 family iso
set interfaces ge-0/0/0 unit 0 family mpls
set interfaces ge-0/0/1 unit 0 family inet address 5.5.5.1/30
set interfaces ge-0/0/1 unit 0 family iso
set interfaces ge-0/0/1 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 9.9.9.9/32
set interfaces lo0 unit 0 family iso address 49.0000.9999.9999.0000.00
set interfaces lo0 unit 0 family mpls
set routing-options router-id 9.9.9.9
set routing-options autonomous-system 65400
set protocols mpls interface all
set protocols bgp group int type internal
set protocols bgp group int local-address 9.9.9.9
set protocols bgp group int family inet labeled-unicast
set protocols bgp group int neighbor 8.8.8.8
set protocols bgp group external type external
set protocols bgp group external family inet labeled-unicast
set protocols bgp group external peer-as 65600
set protocols bgp group external neighbor 5.5.5.2
set protocols isis interface ge-0/0/0.0
set protocols isis interface lo0.0
set protocols ldp interface all

ASBR2

set interfaces ge-0/0/0 unit 0 family inet address 5.5.5.2/30
set interfaces ge-0/0/0 unit 0 family iso
set interfaces ge-0/0/0 unit 0 family mpls
set interfaces ge-0/0/1 unit 0 family inet address 6.6.6.1/30
set interfaces ge-0/0/1 unit 0 family iso
set interfaces ge-0/0/1 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 10.10.10.10/32
set interfaces lo0 unit 0 family iso address 49.0000.1010.1010.0000.00
set interfaces lo0 unit 0 family mpls
set routing-options router-id 10.10.10.10
set routing-options autonomous-system 65600
set protocols mpls interface all
set protocols bgp group internal type internal
set protocols bgp group internal local-address 10.10.10.10
set protocols bgp group internal family inet labeled-unicast
set protocols bgp group internal neighbor 11.11.11.11
set protocols bgp group external type external
set protocols bgp group external family inet labeled-unicast
set protocols bgp group external export PE2_LOOPBACK
set protocols bgp group external peer-as 65400
set protocols bgp group external neighbor 5.5.5.1
set protocols isis interface ge-0/0/1.0
set protocols isis interface lo0.0
set protocols ldp interface all
set policy-options policy-statement PE2_LOOPBACK from route-filter 11.11.11.11/32 exact
set policy-options policy-statement PE2_LOOPBACK then accept

PE2

set interfaces ge-0/0/0 unit 0 family inet address 6.6.6.2/30
set interfaces ge-0/0/0 unit 0 family iso
set interfaces ge-0/0/0 unit 0 family mpls
set interfaces ge-0/0/1 vlan-tagging
set interfaces ge-0/0/1 encapsulation flexible-ethernet-services
set interfaces ge-0/0/1 unit 3222 encapsulation vlan-ccc
set interfaces ge-0/0/1 unit 3222 vlan-id 3222
set interfaces lo0 unit 0 family inet address 11.11.11.11/32
set interfaces lo0 unit 0 family iso address 49.0000.1111.1111.0000.00
set interfaces lo0 unit 0 family mpls
set routing-options router-id 11.11.11.11
set routing-options autonomous-system 65600
set protocols mpls interface all
set protocols bgp group internal type internal
set protocols bgp group internal local-address 11.11.11.11
set protocols bgp group internal family inet labeled-unicast resolve-vpn
set protocols bgp group internal neighbor 10.10.10.10
set protocols bgp group external type external
set protocols bgp group external multihop
set protocols bgp group external local-address 11.11.11.11
set protocols bgp group external family l2vpn signaling
set protocols bgp group external peer-as 65200
set protocols bgp group external neighbor 5.5.5.5
set protocols isis interface ge-0/0/0.0
set protocols isis interface lo0.0
set protocols ldp interface all
set routing-instances cust1 instance-type l2vpn
set routing-instances cust1 interface ge-0/0/1.3222
set routing-instances cust1 route-distinguisher 11.11.11.11:1
set routing-instances cust1 vrf-target target:65200:1
set routing-instances cust1 protocols l2vpn encapsulation-type ethernet-vlan
set routing-instances cust1 protocols l2vpn site cust1 site-identifier 2
set routing-instances cust1 protocols l2vpn site cust1 interface ge-0/0/1.3222

OSPF has been configured on both CE devices and a neighbourship has formed confirming that the layer 2 circuit is up.

Inter-AS MPLS EVPN

This topology is Option 3 utilising BGP-LU. IS-IS in the underlay and OSPF between the 2 CE Cisco devices. Can use other devices as CE’s if you prefer.

https://www.juniper.net/documentation/en_US/release-independent/nce/topics/example/mpls-vpn-option3-configuration.html

PE1

set interfaces ge-0/0/0 flexible-vlan-tagging
set interfaces ge-0/0/0 encapsulation flexible-ethernet-services
set interfaces ge-0/0/0 unit 674 encapsulation vlan-bridge
set interfaces ge-0/0/0 unit 674 vlan-id 674
set interfaces ge-0/0/0 unit 674 family bridge
set interfaces ge-0/0/2 unit 0 family inet address 1.1.1.1/30
set interfaces ge-0/0/2 unit 0 family iso
set interfaces ge-0/0/2 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 5.5.5.5/32
set interfaces lo0 unit 0 family iso address 49.0000.5555.5555.5555.00
set interfaces lo0 unit 0 family mpls
set routing-options router-id 5.5.5.5
set routing-options autonomous-system 65200
set protocols mpls interface all
set protocols bgp group int type internal
set protocols bgp group int local-address 5.5.5.5
set protocols bgp group int family inet unicast
set protocols bgp group int family evpn signaling
set protocols bgp group int export nhs
set protocols bgp group int neighbor 6.6.6.6
set protocols bgp group int neighbor 33.33.33.33 local-address 5.5.5.5
set protocols bgp group int neighbor 33.33.33.33 family inet labeled-unicast resolve-vpn
set protocols bgp group external type external
set protocols bgp group external multihop
set protocols bgp group external local-address 5.5.5.5
set protocols bgp group external family evpn signaling
set protocols bgp group external peer-as 65400
set protocols bgp group external neighbor 8.8.8.8
set protocols isis interface ge-0/0/2.0
set protocols isis interface lo0.0
set protocols ldp interface all
set policy-options policy-statement nhs term 1 from protocol bgp
set policy-options policy-statement nhs term 1 then next-hop self
set routing-instances cust1 instance-type evpn
set routing-instances cust1 vlan-id 674
set routing-instances cust1 interface ge-0/0/0.674
set routing-instances cust1 route-distinguisher 5.5.5.5:1
set routing-instances cust1 vrf-target target:65200:1
set routing-instances cust1 protocols evpn interface ge-0/0/0.674

P2

set interfaces ge-0/0/0 unit 0 family inet address 1.1.1.2/30
set interfaces ge-0/0/0 unit 0 family iso
set interfaces ge-0/0/0 unit 0 family mpls
set interfaces ge-0/0/1 unit 0 family inet address 2.2.2.1/30
set interfaces ge-0/0/1 unit 0 family iso
set interfaces ge-0/0/1 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 6.6.6.6/32
set interfaces lo0 unit 0 family iso address 49.0000.6666.6666.6666.00
set interfaces lo0 unit 0 family mpls
set routing-options router-id 6.6.6.6
set routing-options autonomous-system 65200
set protocols mpls interface all
set protocols bgp group int type internal
set protocols bgp group int local-address 6.6.6.6
set protocols bgp group int family inet unicast
set protocols bgp group int family inet-vpn unicast
set protocols bgp group int family evpn signaling
set protocols bgp group int export nhs
set protocols bgp group int cluster 6.6.6.6
set protocols bgp group int neighbor 5.5.5.5
set protocols bgp group int neighbor 33.33.33.33
set protocols isis interface ge-0/0/0.0
set protocols isis interface ge-0/0/1.0
set protocols isis interface lo0.0
set protocols ldp interface all
set policy-options policy-statement nhs term 1 from protocol bgp
set policy-options policy-statement nhs term 1 then next-hop self

ASBR1

set interfaces ge-0/0/0 unit 0 family inet address 2.2.2.2/30
set interfaces ge-0/0/0 unit 0 family iso
set interfaces ge-0/0/0 unit 0 family mpls
set interfaces ge-0/0/1 unit 0 family inet address 3.3.3.1/30
set interfaces ge-0/0/1 unit 0 family iso
set interfaces ge-0/0/1 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 33.33.33.33/32
set interfaces lo0 unit 0 family iso address 49.0000.3333.3333.0000.00
set interfaces lo0 unit 0 family mpls
set routing-options router-id 33.33.33.33
set routing-options autonomous-system 65200
set protocols mpls traffic-engineering mpls-forwarding
set protocols mpls interface all
set protocols bgp group int type internal
set protocols bgp group int local-address 33.33.33.33
set protocols bgp group int family inet unicast
set protocols bgp group int family inet-vpn unicast
set protocols bgp group int family evpn signaling
set protocols bgp group int neighbor 6.6.6.6
set protocols bgp group int neighbor 5.5.5.5 local-address 33.33.33.33
set protocols bgp group int neighbor 5.5.5.5 family inet labeled-unicast
set protocols bgp group int neighbor 5.5.5.5 export nhs
set protocols bgp group external type external
set protocols bgp group external family inet labeled-unicast
set protocols bgp group external export PE1_LOOPBACK
set protocols bgp group external peer-as 65400
set protocols bgp group external neighbor 3.3.3.2
set protocols isis interface ge-0/0/0.0
set protocols isis interface lo0.0
set protocols ldp interface all
set policy-options policy-statement PE1_LOOPBACK term 1 from route-filter 5.5.5.5/32 exact
set policy-options policy-statement PE1_LOOPBACK term 1 then accept
set policy-options policy-statement PE1_LOOPBACK term 2 from route-filter 6.6.6.6/32 exact
set policy-options policy-statement PE1_LOOPBACK then accept
set policy-options policy-statement nhs term 1 from protocol bgp
set policy-options policy-statement nhs term 1 then next-hop self

ASBR2

set interfaces ge-0/0/0 unit 0 family inet address 3.3.3.2/30
set interfaces ge-0/0/0 unit 0 family iso
set interfaces ge-0/0/0 unit 0 family mpls
set interfaces ge-0/0/1 unit 0 family inet address 4.4.4.1/30
set interfaces ge-0/0/1 unit 0 family iso
set interfaces ge-0/0/1 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 7.7.7.7/32
set interfaces lo0 unit 0 family iso address 49.0000.7777.7777.7777.00
set interfaces lo0 unit 0 family mpls
set routing-options router-id 7.7.7.7
set routing-options autonomous-system 65400
set protocols mpls traffic-engineering mpls-forwarding
set protocols mpls interface all
set protocols bgp group int type internal
set protocols bgp group int local-address 7.7.7.7
set protocols bgp group int family inet unicast
set protocols bgp group int family inet-vpn unicast
set protocols bgp group int family evpn signaling
set protocols bgp group int neighbor 9.9.9.9
set protocols bgp group int neighbor 8.8.8.8 local-address 7.7.7.7
set protocols bgp group int neighbor 8.8.8.8 family inet labeled-unicast
set protocols bgp group int neighbor 8.8.8.8 export nhs
set protocols bgp group external type external
set protocols bgp group external family inet labeled-unicast
set protocols bgp group external export PE2_LOOPBACK
set protocols bgp group external peer-as 65200
set protocols bgp group external neighbor 3.3.3.1
set protocols isis interface ge-0/0/1.0
set protocols isis interface lo0.0
set protocols ldp interface all
set policy-options policy-statement PE2_LOOPBACK term 1 from route-filter 8.8.8.8/32 exact
set policy-options policy-statement PE2_LOOPBACK term 1 then accept
set policy-options policy-statement PE2_LOOPBACK term 2 from route-filter 9.9.9.9/32 exact
set policy-options policy-statement PE2_LOOPBACK then accept
set policy-options policy-statement nhs term 1 from protocol bgp
set policy-options policy-statement nhs term 1 then next-hop self

P2

set interfaces ge-0/0/0 unit 0 family inet address 4.4.4.2/30
set interfaces ge-0/0/0 unit 0 family iso
set interfaces ge-0/0/0 unit 0 family mpls
set interfaces ge-0/0/1 unit 0 family inet address 5.5.5.1/30
set interfaces ge-0/0/1 unit 0 family iso
set interfaces ge-0/0/1 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 9.9.9.9/32
set interfaces lo0 unit 0 family iso address 49.0000.9999.9999.0000.00
set interfaces lo0 unit 0 family mpls
set routing-options router-id 9.9.9.9
set routing-options autonomous-system 65400
set protocols mpls interface all
set protocols bgp group int type internal
set protocols bgp group int local-address 9.9.9.9
set protocols bgp group int family inet unicast
set protocols bgp group int family inet-vpn unicast
set protocols bgp group int family evpn signaling
set protocols bgp group int export nhs
set protocols bgp group int cluster 9.9.9.9
set protocols bgp group int neighbor 7.7.7.7
set protocols bgp group int neighbor 8.8.8.8
set protocols isis interface all
set protocols ldp interface ge-0/0/0.0
set protocols ldp interface ge-0/0/1.0
set policy-options policy-statement nhs term 1 from protocol bgp
set policy-options policy-statement nhs term 1 then next-hop self

PE2

set interfaces ge-0/0/0 unit 0 family inet address 5.5.5.2/30
set interfaces ge-0/0/0 unit 0 family iso
set interfaces ge-0/0/0 unit 0 family mpls
set interfaces ge-0/0/1 flexible-vlan-tagging
set interfaces ge-0/0/1 encapsulation flexible-ethernet-services
set interfaces ge-0/0/1 unit 674 encapsulation vlan-bridge
set interfaces ge-0/0/1 unit 674 vlan-id 674
set interfaces ge-0/0/1 unit 674 family bridge
set interfaces lo0 unit 0 family inet address 8.8.8.8/32
set interfaces lo0 unit 0 family iso address 49.0000.8888.8888.8888.00
set interfaces lo0 unit 0 family mpls
set routing-options router-id 8.8.8.8
set routing-options autonomous-system 65400
set protocols mpls interface all
set protocols bgp group int type internal
set protocols bgp group int local-address 8.8.8.8
set protocols bgp group int family inet unicast
set protocols bgp group int family evpn signaling
set protocols bgp group int export nhs
set protocols bgp group int neighbor 9.9.9.9
set protocols bgp group int neighbor 7.7.7.7 local-address 8.8.8.8
set protocols bgp group int neighbor 7.7.7.7 family inet labeled-unicast resolve-vpn
set protocols bgp group external type external
set protocols bgp group external multihop
set protocols bgp group external local-address 8.8.8.8
set protocols bgp group external family evpn signaling
set protocols bgp group external peer-as 65200
set protocols bgp group external neighbor 5.5.5.5
set protocols isis interface ge-0/0/0.0
set protocols isis interface lo0.0
set protocols ldp interface ge-0/0/0.0
set policy-options policy-statement nhs term 1 from protocol bgp
set policy-options policy-statement nhs term 1 then next-hop self
set routing-instances cust1 instance-type evpn
set routing-instances cust1 vlan-id 674
set routing-instances cust1 interface ge-0/0/1.674
set routing-instances cust1 route-distinguisher 8.8.8.8:1
set routing-instances cust1 vrf-target target:65200:1
set routing-instances cust1 protocols evpn interface ge-0/0/1.674

Your CE’s will now have a layer 2 circuit between them. In this example, OSPF has been configured on them and you can see from the routing tables that an adjacency has formed and they are learning each other’s routes.

IS-IS – Leaking Routes from Level 2

By default, level 2 routes are not distributed into level 1. There may be situations where you need a more specific route rather than the default route provided by the ABR.

https://www.juniper.net/documentation/us/en/software/junos/is-is/topics/concept/is-is-routing-overview.html#:~:text=Level%201%20routers%20share%20intra,with%20other%20Level%202%20routers.

The aim of this lab is to leak a route from level 2 so that level 1 devices have a more specific route to the loopback of vMX3. This is done with a policy on the ABR (vMX4)

vMX1

set interfaces ge-0/0/0 unit 0 family inet address 1.1.1.1/30
set interfaces ge-0/0/0 unit 0 family iso
set interfaces ge-0/0/1 unit 0 family inet address 1.2.2.1/30
set interfaces ge-0/0/1 unit 0 family iso
set interfaces ge-0/0/2 unit 0 family inet address 1.3.3.1/30
set interfaces ge-0/0/2 unit 0 family iso
set interfaces lo0 unit 0 family inet address 5.5.5.5/32
set interfaces lo0 unit 0 family iso address 49.0000.5555.5555.5555.00
set protocols isis interface ge-0/0/0.0 level 1 disable
set protocols isis interface ge-0/0/1.0 level 1 disable
set protocols isis interface ge-0/0/2.0 level 1 disable
set protocols isis interface lo0.0

vMX2

set interfaces ge-0/0/0 unit 0 family inet address 1.1.1.2/30
set interfaces ge-0/0/0 unit 0 family iso
set interfaces ge-0/0/1 unit 0 family inet address 2.2.2.1/30
set interfaces ge-0/0/1 unit 0 family iso
set interfaces lo0 unit 0 family inet address 6.6.6.6/32
set interfaces lo0 unit 0 family iso address 49.0000.6666.6666.6666.00
set protocols isis interface ge-0/0/0.0 level 1 disable
set protocols isis interface ge-0/0/1.0 level 1 disable
set protocols isis interface lo0.0

vMX3

set interfaces ge-0/0/0 unit 0 family inet address 2.2.2.2/30
set interfaces ge-0/0/0 unit 0 family iso
set interfaces ge-0/0/1 unit 0 family inet address 1.2.2.2/30
set interfaces ge-0/0/1 unit 0 family iso
set interfaces ge-0/0/2 unit 0 family inet address 3.3.3.1/30
set interfaces ge-0/0/2 unit 0 family iso
set interfaces lo0 unit 0 family inet address 7.7.7.7/32
set interfaces lo0 unit 0 family iso address 49.0000.7777.7777.7777.00
set protocols isis interface ge-0/0/0.0 level 1 disable
set protocols isis interface ge-0/0/1.0 level 1 disable
set protocols isis interface ge-0/0/2.0 level 1 disable
set protocols isis interface lo0.0

vMX4

set interfaces ge-0/0/0 unit 0 family inet address 1.3.3.2/30
set interfaces ge-0/0/0 unit 0 family iso
set interfaces ge-0/0/1 unit 0 family inet address 3.3.3.2/30
set interfaces ge-0/0/1 unit 0 family iso
set interfaces ge-0/0/2 unit 0 family inet address 4.4.4.1/30
set interfaces ge-0/0/2 unit 0 family iso
set interfaces ge-0/0/3 unit 0 family inet address 6.6.6.2/30
set interfaces ge-0/0/3 unit 0 family iso
set interfaces lo0 unit 0 family inet address 8.8.8.8/32
set interfaces lo0 unit 0 family iso address 49.0001.8888.8888.8888.00
set protocols isis export leak
set protocols isis interface ge-0/0/0.0
set protocols isis interface ge-0/0/1.0 level 1 disable
set protocols isis interface ge-0/0/2.0 level 2 disable
set protocols isis interface ge-0/0/3.0 level 2 disable
set protocols isis interface lo0.0
set policy-options policy-statement leak term 1 from protocol isis
set policy-options policy-statement leak term 1 from level 2
set policy-options policy-statement leak term 1 from route-filter 7.7.7.7/32 exact
set policy-options policy-statement leak term 1 to level 1
set policy-options policy-statement leak term 1 then accept

vMX5

set interfaces ge-0/0/0 unit 0 family inet address 4.4.4.2/30
set interfaces ge-0/0/0 unit 0 family iso
set interfaces ge-0/0/1 unit 0 family inet address 5.5.5.1/30
set interfaces ge-0/0/1 unit 0 family iso
set interfaces lo0 unit 0 family inet address 9.9.9.9/32
set interfaces lo0 unit 0 family iso address 49.0001.9999.9999.9999.00
set protocols isis interface ge-0/0/0.0 level 2 disable
set protocols isis interface ge-0/0/1.0 level 2 disable
set protocols isis interface lo0.0

vMX6

set interfaces ge-0/0/0 unit 0 family inet address 5.5.5.2/30
set interfaces ge-0/0/0 unit 0 family iso
set interfaces ge-0/0/1 unit 0 family inet address 6.6.6.1/30
set interfaces ge-0/0/1 unit 0 family iso
set interfaces lo0 unit 0 family inet address 10.10.10.10/32
set interfaces lo0 unit 0 family iso address 49.0001.1010.1010.1010.00
set protocols isis interface ge-0/0/0.0 level 2 disable
set protocols isis interface ge-0/0/1.0 level 2 disable

You will now have leaked route 7.7.7.7 into the level 1 route table so run ‘show route‘ on vMX5 or vMX6 to confirm.

OSPF Virtual Link

The backbone area is a critical component of the OSPF routing domain. It’s designated as Area 0 and serves as the core area through which all other OSPF areas must connect. The backbone area interconnects all other OSPF areas, facilitating the exchange of routing information between them. There can be situations where it is not possible to connect an area to the backbone and this is where a virtual link comes in. An example topology is below where we need to connect area 67 to the backbone and the configuration us pretty straightforward.

https://www.juniper.net/documentation/us/en/software/junos/cli-reference/topics/ref/statement/virtual-link-edit-protocols-ospf.html

vMX1

set interfaces ge-0/0/0 unit 0 family inet address 1.1.1.1/30
set interfaces lo0 unit 0 family inet address 8.8.8.8/32
set protocols ospf area 0.0.0.0 interface ge-0/0/0.0
set protocols ospf area 0.0.0.0 interface lo0.0 passive

vMX2

set interfaces ge-0/0/0 unit 0 family inet address 1.1.1.2/30
set interfaces ge-0/0/1 unit 0 family inet address 2.2.2.1/30
set interfaces lo0 unit 0 family inet address 9.9.9.9/32
set protocols ospf area 0.0.0.0 virtual-link neighbor-id 11.11.11.11 transit-area 0.0.0.52
set protocols ospf area 0.0.0.0 interface ge-0/0/0.0
set protocols ospf area 0.0.0.0 interface lo0.0 passive
set protocols ospf area 0.0.0.52 interface ge-0/0/1.0

vMX3

set interfaces ge-0/0/0 unit 0 family inet address 2.2.2.2/30
set interfaces ge-0/0/1 unit 0 family inet address 3.3.3.1/30
set interfaces lo0 unit 0 family inet address 10.10.10.10/32
set protocols ospf area 0.0.0.52 interface ge-0/0/0.0
set protocols ospf area 0.0.0.52 interface lo0.0 passive
set protocols ospf area 0.0.0.52 interface ge-0/0/1.0

vMX4

set interfaces ge-0/0/0 unit 0 family inet address 3.3.3.2/30
set interfaces ge-0/0/1 unit 0 family inet address 4.4.4.1/30
set interfaces lo0 unit 0 family inet address 11.11.11.11/32
set protocols ospf area 0.0.0.52 interface ge-0/0/0.0
set protocols ospf area 0.0.0.52 interface lo0.0 passive
set protocols ospf area 0.0.0.67 interface ge-0/0/1.0
set protocols ospf area 0.0.0.0 virtual-link neighbor-id 9.9.9.9 transit-area 0.0.0.52

vMX5

set interfaces ge-0/0/0 unit 0 family inet address 4.4.4.2/30
set interfaces lo0 unit 0 family inet address 12.12.12.12/32
set protocols ospf area 0.0.0.67 interface ge-0/0/0.0
set protocols ospf area 0.0.0.67 interface lo0.0 passive

The virtual link will now be up and area 67 will now have routes to the backbone.

MPLS EVPN

MPLS EVPN is slightly different on JunosEvolved as it uses a mac-vrf routing instance rather than an evpn instance. A lot of similarities though and topology and EVE NG import below. 2 Cisco vIOS switches used as CE’s but pick your poison and use whatever you prefer. An OSPF neighbour adjacency has been established between them confirming the EVPN circuit is up.

https://www.juniper.net/documentation/us/en/software/junos/evpn-vxlan/topics/concept/evpns-overview.html

vEVO1

set interfaces et-0/0/0 flexible-vlan-tagging
set interfaces et-0/0/0 encapsulation flexible-ethernet-services
set interfaces et-0/0/0 unit 512 encapsulation vlan-bridge
set interfaces et-0/0/0 unit 512 vlan-id 512
set interfaces et-0/0/0 unit 512 family ethernet-switching
set interfaces et-0/0/2 unit 0 family inet address 1.1.1.1/30
set interfaces et-0/0/2 unit 0 family iso
set interfaces et-0/0/2 unit 0 family mpls
set interfaces irb unit 512 family inet address 10.1.1.254/24
set interfaces irb unit 512 mac 00:ee:22:ee:33:dd
set interfaces lo0 unit 0 family inet address 5.5.5.5/32
set interfaces lo0 unit 0 family iso address 49.0000.5555.5555.5555.00
set interfaces lo0 unit 0 family mpls
set routing-instances cust1 instance-type mac-vrf
set routing-instances cust1 protocols evpn default-gateway do-not-advertise
set routing-instances cust1 service-type vlan-aware
set routing-instances cust1 interface et-0/0/0.512
set routing-instances cust1 route-distinguisher 5.5.5.5:1
set routing-instances cust1 vrf-target target:65530:1
set routing-instances cust1 vlans cust1 vlan-id 512
set routing-instances cust1 vlans cust1 interface et-0/0/0.512
set routing-options router-id 5.5.5.5
set routing-options autonomous-system 65530
set protocols bgp group int type internal
set protocols bgp group int local-address 5.5.5.5
set protocols bgp group int family inet unicast
set protocols bgp group int family inet-vpn unicast
set protocols bgp group int family evpn signaling
set protocols bgp group int neighbor 6.6.6.6
set protocols isis interface et-0/0/2.0
set protocols isis interface lo0.0
set protocols ldp interface all
set protocols mpls interface all

vEVO2

set interfaces et-0/0/0 unit 0 family inet address 1.1.1.2/30
set interfaces et-0/0/0 unit 0 family iso
set interfaces et-0/0/0 unit 0 family mpls
set interfaces et-0/0/1 unit 0 family inet address 2.2.2.1/30
set interfaces et-0/0/1 unit 0 family iso
set interfaces et-0/0/1 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 6.6.6.6/32
set interfaces lo0 unit 0 family iso address 49.0000.6666.6666.6666.00
set interfaces lo0 unit 0 family mpls
set routing-options router-id 6.6.6.6
set routing-options autonomous-system 65530
set protocols bgp group int type internal
set protocols bgp group int local-address 6.6.6.6
set protocols bgp group int family inet unicast
set protocols bgp group int family inet-vpn unicast
set protocols bgp group int family evpn signaling
set protocols bgp group int cluster 6.6.6.6
set protocols bgp group int neighbor 5.5.5.5
set protocols bgp group int neighbor 33.33.33.33
set protocols isis interface et-0/0/0.0
set protocols isis interface et-0/0/1.0
set protocols isis interface lo0.0
set protocols ldp interface all
set protocols mpls interface all

vEVO3

set interfaces et-0/0/0 unit 0 family inet address 2.2.2.2/30
set interfaces et-0/0/0 unit 0 family iso
set interfaces et-0/0/0 unit 0 family mpls
set interfaces et-0/0/1 unit 0 family inet address 3.3.3.1/30
set interfaces et-0/0/1 unit 0 family iso
set interfaces et-0/0/1 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 33.33.33.33/32
set interfaces lo0 unit 0 family iso address 49.0000.3333.3333.0000.00
set interfaces lo0 unit 0 family mpls
set routing-options router-id 33.33.33.33
set routing-options autonomous-system 65530
set protocols bgp group int type internal
set protocols bgp group int local-address 33.33.33.33
set protocols bgp group int family inet unicast
set protocols bgp group int family inet-vpn unicast
set protocols bgp group int family evpn signaling
set protocols bgp group int cluster 33.33.33.33
set protocols bgp group int neighbor 6.6.6.6
set protocols bgp group int neighbor 7.7.7.7
set protocols isis interface et-0/0/0.0
set protocols isis interface et-0/0/1.0
set protocols isis interface lo0.0
set protocols ldp interface all
set protocols mpls interface all

vEVO4

set interfaces et-0/0/0 unit 0 family inet address 3.3.3.2/30
set interfaces et-0/0/0 unit 0 family iso
set interfaces et-0/0/0 unit 0 family mpls
set interfaces et-0/0/1 unit 0 family inet address 4.4.4.1/30
set interfaces et-0/0/1 unit 0 family iso
set interfaces et-0/0/1 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 7.7.7.7/32
set interfaces lo0 unit 0 family iso address 49.0000.7777.7777.7777.00
set interfaces lo0 unit 0 family mpls
set routing-options router-id 7.7.7.7
set routing-options autonomous-system 65530
set protocols bgp group int type internal
set protocols bgp group int local-address 7.7.7.7
set protocols bgp group int family inet unicast
set protocols bgp group int family inet-vpn unicast
set protocols bgp group int family evpn signaling
set protocols bgp group int cluster 7.7.7.7
set protocols bgp group int neighbor 33.33.33.33
set protocols bgp group int neighbor 9.9.9.9
set protocols isis interface et-0/0/0.0
set protocols isis interface et-0/0/1.0
set protocols isis interface lo0.0
set protocols ldp interface all
set protocols mpls interface all

vEVO5

set interfaces et-0/0/0 flexible-vlan-tagging
set interfaces et-0/0/0 encapsulation flexible-ethernet-services
set interfaces et-0/0/0 unit 512 encapsulation vlan-bridge
set interfaces et-0/0/0 unit 512 vlan-id 512
set interfaces et-0/0/0 unit 512 family ethernet-switching
set interfaces et-0/0/2 unit 0 family inet address 4.4.4.2/30
set interfaces et-0/0/2 unit 0 family iso
set interfaces et-0/0/2 unit 0 family mpls
set interfaces irb unit 512 family inet address 10.1.1.254/24
set interfaces irb unit 512 mac 00:ee:22:ee:33:dd
set interfaces lo0 unit 0 family inet address 9.9.9.9/32
set interfaces lo0 unit 0 family iso address 49.0000.9999.9999.9999.00
set interfaces lo0 unit 0 family mpls
set routing-instances cust1 instance-type mac-vrf
set routing-instances cust1 protocols evpn default-gateway do-not-advertise
set routing-instances cust1 service-type vlan-aware
set routing-instances cust1 interface et-0/0/0.512
set routing-instances cust1 route-distinguisher 9.9.9.9:1
set routing-instances cust1 vrf-target target:65530:1
set routing-instances cust1 vlans cust1 vlan-id 512
set routing-instances cust1 vlans cust1 interface et-0/0/0.512
set routing-options router-id 9.9.9.9
set routing-options autonomous-system 65530
set protocols bgp group int type internal
set protocols bgp group int local-address 9.9.9.9
set protocols bgp group int family inet unicast
set protocols bgp group int family inet-vpn unicast
set protocols bgp group int family evpn signaling
set protocols bgp group int neighbor 7.7.7.7
set protocols isis interface et-0/0/2.0
set protocols isis interface lo0.0
set protocols ldp interface all
set protocols mpls interface all

Your EVPN circuit should now be up and running. Terminal screenshot below showing that OSPF adjacency has been established. You could choose IS-IS, BGP or even EIGRP if using Cisco devices for the CE’s as it’s just a layer 2 circuit between them.

QinQ (802.1Q)

A very simple QinQ topology. 3 vMX devices, 2 Arista vEOS acting as the CE devices (you can use other devices if prefer) and 2vPC’s to confirm IP connectivity. 55 is the C-Tag, 110 the S-Tag

https://www.juniper.net/documentation/us/en/software/junos/multicast-l2/topics/topic-map/q-in-q.html

EVE-NG import file

vMX1

set interfaces ge-0/0/0 unit 0 family bridge interface-mode access
set interfaces ge-0/0/0 unit 0 family bridge vlan-id 110
set interfaces ge-0/0/1 unit 0 family bridge interface-mode trunk
set interfaces ge-0/0/1 unit 0 family bridge vlan-id 110
set bridge-domains customer1 vlan-id 110

vMX2

set interfaces ge-0/0/0 flexible-vlan-tagging
set interfaces ge-0/0/0 encapsulation flexible-ethernet-services
set interfaces ge-0/0/0 unit 0 family bridge interface-mode trunk
set interfaces ge-0/0/0 unit 0 family bridge vlan-id 110
set interfaces ge-0/0/1 flexible-vlan-tagging
set interfaces ge-0/0/1 encapsulation flexible-ethernet-services
set interfaces ge-0/0/1 unit 0 family bridge interface-mode trunk
set interfaces ge-0/0/1 unit 0 family bridge vlan-id 110
set bridge-domains customer1 vlan-id 110

vMX3

set interfaces ge-0/0/0 unit 0 family bridge interface-mode access
set interfaces ge-0/0/0 unit 0 family bridge vlan-id 110
set interfaces ge-0/0/1 unit 0 family bridge interface-mode trunk
set interfaces ge-0/0/1 unit 0 family bridge vlan-id 110
set bridge-domains customer1 vlan-id 110

Configure IP addresses from the same subnet on both of the vPC’s and they should be able to ping each other. The below image of a Wireguard capture shows the double VLAN tags when ping is sent.

L3 VPN & OSPF Sham Link

5 vEX device topology. OSPF Sham link between vEX1 & vEX5 so the VPN backbone is preferred.

https://www.juniper.net/documentation/us/en/software/junos/ospf/topics/topic-map/configuring-ospfv2-sham-links.html

EVE-NG lab import

vEX1

set interfaces ge-0/0/0 unit 0 family inet address 11.11.11.2/30
set interfaces ge-0/0/2 unit 0 family inet address 1.1.1.1/30
set interfaces ge-0/0/2 unit 0 family iso
set interfaces ge-0/0/2 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 5.5.5.5/32
set interfaces lo0 unit 0 family iso address 49.0000.5555.5555.5555.00
set interfaces lo0 unit 0 family mpls
set interfaces lo0 unit 1 family inet address 222.222.222.222/32
set interfaces lo0 unit 1 family mpls
set policy-options policy-statement nhs term 1 from protocol bgp
set policy-options policy-statement nhs term 1 then next-hop self
set routing-instances customer1 instance-type vrf
set routing-instances customer1 protocols mpls interface all
set routing-instances customer1 protocols ospf area 0.0.0.0 sham-link-remote 111.111.111.111
set routing-instances customer1 protocols ospf area 0.0.0.0 interface ge-0/0/0.0
set routing-instances customer1 protocols ospf area 0.0.0.0 interface lo0.1
set routing-instances customer1 protocols ospf sham-link local 222.222.222.222
set routing-instances customer1 interface ge-0/0/0.0
set routing-instances customer1 interface lo0.1
set routing-instances customer1 route-distinguisher 5.5.5.5:1
set routing-instances customer1 vrf-target target:65530:1
set routing-options router-id 5.5.5.5
set routing-options autonomous-system 65530
set protocols bgp group int type internal
set protocols bgp group int local-address 5.5.5.5
set protocols bgp group int family inet unicast
set protocols bgp group int family inet-vpn unicast
set protocols bgp group int export nhs
set protocols bgp group int neighbor 6.6.6.6
set protocols isis interface ge-0/0/2.0
set protocols isis interface lo0.0
set protocols ldp interface ge-0/0/2.0
set protocols ldp interface lo0.0
set protocols mpls interface all

vEX2

set interfaces ge-0/0/0 unit 0 family inet address 1.1.1.2/30
set interfaces ge-0/0/0 unit 0 family iso
set interfaces ge-0/0/0 unit 0 family mpls
set interfaces ge-0/0/1 unit 0 family inet address 2.2.2.5/30
set interfaces ge-0/0/1 unit 0 family iso
set interfaces ge-0/0/1 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 6.6.6.6/32
set interfaces lo0 unit 0 family iso address 49.0000.6666.6666.6666.00
set interfaces lo0 unit 0 family mpls
set policy-options policy-statement nhs term 1 from protocol bgp
set policy-options policy-statement nhs term 1 then next-hop self
set routing-options router-id 6.6.6.6
set routing-options autonomous-system 65530
set protocols bgp group int type internal
set protocols bgp group int local-address 6.6.6.6
set protocols bgp group int family inet unicast
set protocols bgp group int family inet-vpn unicast
set protocols bgp group int export nhs
set protocols bgp group int cluster 6.6.6.6
set protocols bgp group int neighbor 5.5.5.5
set protocols bgp group int neighbor 88.88.88.88
set protocols isis interface ge-0/0/0.0
set protocols isis interface ge-0/0/1.0
set protocols isis interface lo0.0
set protocols ldp interface all
set protocols mpls interface all

Core

set interfaces ge-0/0/0 unit 0 family inet address 2.2.2.6/30
set interfaces ge-0/0/0 unit 0 family iso
set interfaces ge-0/0/0 unit 0 family mpls
set interfaces ge-0/0/1 unit 0 family inet address 4.4.4.2/30
set interfaces ge-0/0/1 unit 0 family iso
set interfaces ge-0/0/1 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 88.88.88.88/32
set interfaces lo0 unit 0 family iso address 49.0000.8888.8888.0000.00
set interfaces lo0 unit 0 family mpls
set policy-options policy-statement nhs term 1 from protocol bgp
set policy-options policy-statement nhs term 1 then next-hop self
set routing-options router-id 88.88.88.88
set routing-options autonomous-system 65530
set protocols bgp group int type internal
set protocols bgp group int local-address 88.88.88.88
set protocols bgp group int family inet unicast
set protocols bgp group int family inet-vpn unicast
set protocols bgp group int export nhs
set protocols bgp group int cluster 88.88.88.88
set protocols bgp group int neighbor 6.6.6.6
set protocols bgp group int neighbor 7.7.7.7
set protocols isis interface all
set protocols ldp interface all
set protocols mpls interface all

vEX4

set interfaces ge-0/0/0 unit 0 family inet address 4.4.4.1/30
set interfaces ge-0/0/0 unit 0 family iso
set interfaces ge-0/0/0 unit 0 family mpls
set interfaces ge-0/0/1 unit 0 family inet address 3.3.3.1/30
set interfaces ge-0/0/1 unit 0 family iso
set interfaces ge-0/0/1 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 7.7.7.7/32
set interfaces lo0 unit 0 family iso address 49.0000.7777.7777.7777.00
set interfaces lo0 unit 0 family mpls
set policy-options policy-statement nhs term 1 from protocol bgp
set policy-options policy-statement nhs term 1 then next-hop self
set routing-options router-id 7.7.7.7
set routing-options autonomous-system 65530
set protocols bgp group int type internal
set protocols bgp group int local-address 7.7.7.7
set protocols bgp group int family inet unicast
set protocols bgp group int family inet-vpn unicast
set protocols bgp group int export nhs
set protocols bgp group int cluster 7.7.7.7
set protocols bgp group int neighbor 8.8.8.8
set protocols bgp group int neighbor 88.88.88.88
set protocols isis interface ge-0/0/0.0
set protocols isis interface ge-0/0/1.0
set protocols isis interface lo0.0
set protocols ldp interface all

vEX5

set interfaces ge-0/0/0 unit 0 family inet address 22.22.22.2/30
set interfaces ge-0/0/2 unit 0 family inet address 3.3.3.2/30
set interfaces ge-0/0/2 unit 0 family iso
set interfaces ge-0/0/2 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 8.8.8.8/32
set interfaces lo0 unit 0 family iso address 49.0000.8888.8888.8888.00
set interfaces lo0 unit 0 family mpls
set interfaces lo0 unit 1 family inet address 111.111.111.111/32
set interfaces lo0 unit 1 family mpls
set policy-options policy-statement nhs term 1 from protocol bgp
set policy-options policy-statement nhs term 1 then next-hop self
set routing-instances customer1 instance-type vrf
set routing-instances customer1 protocols ospf area 0.0.0.0 sham-link-remote 222.222.222.222
set routing-instances customer1 protocols ospf area 0.0.0.0 interface ge-0/0/0.0
set routing-instances customer1 protocols ospf area 0.0.0.0 interface lo0.1
set routing-instances customer1 protocols ospf sham-link local 111.111.111.111
set routing-instances customer1 interface ge-0/0/0.0
set routing-instances customer1 interface lo0.1
set routing-instances customer1 route-distinguisher 8.8.8.8:1
set routing-instances customer1 vrf-target target:65530:1
set routing-options router-id 8.8.8.8
set routing-options autonomous-system 65530
set protocols bgp group int type internal
set protocols bgp group int local-address 8.8.8.8
set protocols bgp group int family inet unicast
set protocols bgp group int family inet-vpn unicast
set protocols bgp group int export nhs
set protocols bgp group int neighbor 7.7.7.7
set protocols isis interface ge-0/0/2.0
set protocols isis interface lo0.0
set protocols ldp interface ge-0/0/2.0
set protocols ldp interface lo0.0
set protocols mpls interface all

Sham link should now be established. Run ‘show ospf neighbor instance customer1‘ to confirm.

root> show ospf neighbor instance customer1    
Address          Interface              State           ID               Pri  Dead
11.11.11.1       ge-0/0/0.0             Full            12.12.12.1         1    31
111.111.111.111  shamlink.0             Full            111.111.111.111    0    37

MPLS EVPN

Topology of 6 vMX devices with Anycast Gateway and ESI LAG.

EVE-NG lab to import below

vMX1

set interfaces ge-0/0/0 flexible-vlan-tagging
set interfaces ge-0/0/0 encapsulation flexible-ethernet-services
set interfaces ge-0/0/0 unit 512 encapsulation vlan-bridge
set interfaces ge-0/0/0 unit 512 vlan-id 512
set interfaces ge-0/0/0 unit 512 family bridge
set interfaces ge-0/0/2 unit 0 family inet address 1.1.1.1/30
set interfaces ge-0/0/2 unit 0 family iso
set interfaces ge-0/0/2 unit 0 family mpls
set interfaces irb unit 512 family inet address 10.1.1.254/24
set interfaces irb unit 512 mac 00:ee:22:ee:33:dd
set interfaces lo0 unit 0 family inet address 5.5.5.5/32
set interfaces lo0 unit 0 family iso address 49.0000.5555.5555.5555.00
set interfaces lo0 unit 0 family mpls
set routing-options router-id 5.5.5.5
set routing-options autonomous-system 65530
set protocols mpls interface all
set protocols bgp group int type internal
set protocols bgp group int local-address 5.5.5.5
set protocols bgp group int family inet unicast
set protocols bgp group int family inet-vpn unicast
set protocols bgp group int family evpn signaling
set protocols bgp group int neighbor 6.6.6.6
set protocols isis interface ge-0/0/0.0
set protocols isis interface ge-0/0/2.0
set protocols isis interface lo0.0
set protocols ldp interface all
set routing-instances cust1 instance-type evpn
set routing-instances cust1 vlan-id 512
set routing-instances cust1 interface ge-0/0/0.512
set routing-instances cust1 routing-interface irb.512
set routing-instances cust1 route-distinguisher 5.5.5.5:1
set routing-instances cust1 vrf-target target:65530:1
set routing-instances cust1 protocols evpn interface ge-0/0/0.512
set routing-instances cust1 protocols evpn default-gateway do-not-advertise

vMX2

set interfaces ge-0/0/0 unit 0 family inet address 1.1.1.2/30
set interfaces ge-0/0/0 unit 0 family iso
set interfaces ge-0/0/0 unit 0 family mpls
set interfaces ge-0/0/1 unit 0 family inet address 2.2.2.1/30
set interfaces ge-0/0/1 unit 0 family iso
set interfaces ge-0/0/1 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 6.6.6.6/32
set interfaces lo0 unit 0 family iso address 49.0000.6666.6666.6666.00
set interfaces lo0 unit 0 family mpls
set routing-options router-id 6.6.6.6
set routing-options autonomous-system 65530
set protocols mpls interface all
set protocols bgp group int type internal
set protocols bgp group int local-address 6.6.6.6
set protocols bgp group int family inet unicast
set protocols bgp group int family inet-vpn unicast
set protocols bgp group int family evpn signaling
set protocols bgp group int cluster 6.6.6.6
set protocols bgp group int neighbor 5.5.5.5
set protocols bgp group int neighbor 33.33.33.33
set protocols isis interface ge-0/0/0.0
set protocols isis interface ge-0/0/1.0
set protocols isis interface lo0.0
set protocols ldp interface all

Core

set interfaces ge-0/0/0 unit 0 family inet address 2.2.2.2/30
set interfaces ge-0/0/0 unit 0 family iso
set interfaces ge-0/0/0 unit 0 family mpls
set interfaces ge-0/0/1 unit 0 family inet address 3.3.3.1/30
set interfaces ge-0/0/1 unit 0 family iso
set interfaces ge-0/0/1 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 33.33.33.33/32
set interfaces lo0 unit 0 family iso address 49.0000.3333.3333.0000.00
set interfaces lo0 unit 0 family mpls
set routing-options router-id 33.33.33.33
set routing-options autonomous-system 65530
set protocols mpls interface all
set protocols bgp group int type internal
set protocols bgp group int local-address 33.33.33.33
set protocols bgp group int family inet unicast
set protocols bgp group int family inet-vpn unicast
set protocols bgp group int family evpn signaling
set protocols bgp group int cluster 33.33.33.33
set protocols bgp group int neighbor 6.6.6.6
set protocols bgp group int neighbor 7.7.7.7
set protocols isis interface ge-0/0/0.0
set protocols isis interface ge-0/0/1.0
set protocols isis interface lo0.0
set protocols ldp interface all

vMX4

set interfaces ge-0/0/0 unit 0 family inet address 3.3.3.2/30
set interfaces ge-0/0/0 unit 0 family iso
set interfaces ge-0/0/0 unit 0 family mpls
set interfaces ge-0/0/1 unit 0 family inet address 4.4.4.1/30
set interfaces ge-0/0/1 unit 0 family iso
set interfaces ge-0/0/1 unit 0 family mpls
set interfaces ge-0/0/2 unit 0 family inet address 10.10.10.1/30
set interfaces ge-0/0/2 unit 0 family iso
set interfaces ge-0/0/2 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 7.7.7.7/32
set interfaces lo0 unit 0 family iso address 49.0000.7777.7777.7777.00
set interfaces lo0 unit 0 family mpls
set routing-options router-id 7.7.7.7
set routing-options autonomous-system 65530
set protocols mpls interface all
set protocols bgp group int type internal
set protocols bgp group int local-address 7.7.7.7
set protocols bgp group int family inet unicast
set protocols bgp group int family inet-vpn unicast
set protocols bgp group int family evpn signaling
set protocols bgp group int cluster 7.7.7.7
set protocols bgp group int neighbor 33.33.33.33
set protocols bgp group int neighbor 8.8.8.8
set protocols bgp group int neighbor 9.9.9.9
set protocols isis interface ge-0/0/0.0
set protocols isis interface ge-0/0/1.0
set protocols isis interface ge-0/0/2.0
set protocols isis interface lo0.0
set protocols ldp interface all

vMX5

set chassis aggregated-devices ethernet device-count 2
set interfaces ge-0/0/0 ether-options 802.3ad ae0
set interfaces ge-0/0/1 ether-options 802.3ad ae1
set interfaces ge-0/0/2 unit 0 family inet address 10.10.10.2/30
set interfaces ge-0/0/2 unit 0 family iso
set interfaces ge-0/0/2 unit 0 family mpls
set interfaces ae0 flexible-vlan-tagging
set interfaces ae0 encapsulation flexible-ethernet-services
set interfaces ae0 esi 00:aa:11:bb:22:dd:33:ee:88:ee
set interfaces ae0 esi all-active
set interfaces ae0 aggregated-ether-options lacp active
set interfaces ae0 aggregated-ether-options lacp periodic fast
set interfaces ae0 aggregated-ether-options lacp system-id 00:aa:99:bb:33:dd
set interfaces ae0 unit 512 encapsulation vlan-bridge
set interfaces ae0 unit 512 vlan-id 512
set interfaces ae1 flexible-vlan-tagging
set interfaces ae1 encapsulation flexible-ethernet-services
set interfaces ae1 esi 00:aa:11:bb:22:dd:33:ee:88:ea
set interfaces ae1 esi all-active
set interfaces ae1 aggregated-ether-options lacp active
set interfaces ae1 aggregated-ether-options lacp periodic fast
set interfaces ae1 aggregated-ether-options lacp system-id 00:aa:99:bb:33:db
set interfaces ae1 unit 512 encapsulation vlan-bridge
set interfaces ae1 unit 512 vlan-id 512
set interfaces irb unit 512 family inet address 10.1.1.254/24
set interfaces irb unit 512 mac 00:ee:22:ee:33:dd
set interfaces lo0 unit 0 family inet address 9.9.9.9/32
set interfaces lo0 unit 0 family iso address 49.0000.9999.9999.0000.00
set interfaces lo0 unit 0 family mpls
set routing-options router-id 9.9.9.9
set routing-options autonomous-system 65530
set protocols mpls interface all
set protocols bgp group int type internal
set protocols bgp group int local-address 9.9.9.9
set protocols bgp group int family inet unicast
set protocols bgp group int family inet-vpn unicast
set protocols bgp group int family evpn signaling
set protocols bgp group int neighbor 7.7.7.7
set protocols isis interface all
set protocols ldp interface all
set routing-instances cust1 instance-type evpn
set routing-instances cust1 vlan-id 512
set routing-instances cust1 interface ae0.512
set routing-instances cust1 interface ae1.512
set routing-instances cust1 routing-interface irb.512
set routing-instances cust1 route-distinguisher 9.9.9.9:1
set routing-instances cust1 vrf-target target:65530:1
set routing-instances cust1 protocols evpn interface ae0.512
set routing-instances cust1 protocols evpn interface ae1.512
set routing-instances cust1 protocols evpn default-gateway do-not-advertise

vMX6

set chassis aggregated-devices ethernet device-count 2
set interfaces ge-0/0/0 ether-options 802.3ad ae0
set interfaces ge-0/0/1 ether-options 802.3ad ae1
set interfaces ge-0/0/2 unit 0 family inet address 4.4.4.2/30
set interfaces ge-0/0/2 unit 0 family iso
set interfaces ge-0/0/2 unit 0 family mpls
set interfaces ae0 flexible-vlan-tagging
set interfaces ae0 encapsulation flexible-ethernet-services
set interfaces ae0 esi 00:aa:11:bb:22:dd:33:ee:88:ee
set interfaces ae0 esi all-active
set interfaces ae0 aggregated-ether-options lacp active
set interfaces ae0 aggregated-ether-options lacp periodic fast
set interfaces ae0 aggregated-ether-options lacp system-id 00:aa:99:bb:33:dd
set interfaces ae0 unit 512 encapsulation vlan-bridge
set interfaces ae0 unit 512 vlan-id 512
set interfaces ae1 flexible-vlan-tagging
set interfaces ae1 encapsulation flexible-ethernet-services
set interfaces ae1 esi 00:aa:11:bb:22:dd:33:ee:88:ea
set interfaces ae1 esi all-active
set interfaces ae1 aggregated-ether-options lacp active
set interfaces ae1 aggregated-ether-options lacp periodic fast
set interfaces ae1 aggregated-ether-options lacp system-id 00:aa:99:bb:33:db
set interfaces ae1 unit 512 encapsulation vlan-bridge
set interfaces ae1 unit 512 vlan-id 512
set interfaces irb unit 512 family inet address 10.1.1.254/24
set interfaces irb unit 512 mac 00:ee:22:ee:33:dd
set interfaces lo0 unit 0 family inet address 8.8.8.8/32
set interfaces lo0 unit 0 family iso address 49.0000.8888.8888.8888.00
set interfaces lo0 unit 0 family mpls
set routing-options router-id 8.8.8.8
set routing-options autonomous-system 65530
set protocols mpls interface all
set protocols bgp group int type internal
set protocols bgp group int local-address 8.8.8.8
set protocols bgp group int family inet unicast
set protocols bgp group int family inet-vpn unicast
set protocols bgp group int family evpn signaling
set protocols bgp group int neighbor 7.7.7.7
set protocols isis interface ge-0/0/2.0
set protocols isis interface lo0.0
set protocols ldp interface all
set routing-instances cust1 instance-type evpn
set routing-instances cust1 vlan-id 512
set routing-instances cust1 interface ae0.512
set routing-instances cust1 interface ae1.512
set routing-instances cust1 routing-interface irb.512
set routing-instances cust1 route-distinguisher 8.8.8.8:1
set routing-instances cust1 vrf-target target:65530:1
set routing-instances cust1 protocols evpn interface ae0.512
set routing-instances cust1 protocols evpn interface ae1.512
set routing-instances cust1 protocols evpn default-gateway do-not-advertise

You should now have your layer 2 circuit between CE devices. Run ‘show evpn database‘ on either vMX1, vMX5 or vMX6 to confirm you are learning the MAC addresses of your CE devices

root> show evpn database 
Instance: cust1
VLAN  DomainId  MAC address        Active source                  Timestamp        IP address
512             00:ee:22:ee:33:dd  irb.512                        Jan 28 10:02:54  10.1.1.254
512             50:00:00:07:00:00  00:aa:11:bb:22:dd:33:ee:88:ea  Jan 28 10:13:41
512             50:00:00:07:82:00  00:aa:11:bb:22:dd:33:ee:88:ea  Jan 28 10:14:13  10.1.1.75
512             50:00:00:08:82:00  00:aa:11:bb:22:dd:33:ee:88:ee  Jan 28 10:14:12  10.1.1.200
512             50:00:00:09:00:00  ge-0/0/0.512                   Jan 28 10:01:45  10.1.1.2