Juniper 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.

Juniper Inter-AS MPLS EVPN Option C

This topology is Option C 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 inet-vpn 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

P1

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 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

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.