BGP L2VPN

Our first lab and to start we will go with a pretty straightforward BGP L2VPN.

The topology is 5 vEX devices. vEX2, Core & vEX4 act as route reflectors and IS-IS the IGP. Cisco vIOS routers are chosen as CE devices as they are pretty lightweight to run but you can change to the CE of your choice.

If using EVE-NG you can import the lab using the below file

Now for the commands!

vEX1

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 512 encapsulation vlan-ccc
set interfaces ge-0/0/0 unit 512 vlan-id 512
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-instances cust1 instance-type l2vpn
set routing-instances cust1 protocols l2vpn site cust1 interface ge-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 ge-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 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 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.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 mpls
set interfaces lo0 unit 0 family iso address 49.0000.6666.6666.6666.00
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 cluster 6.6.6.6
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 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 protocols mpls 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 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 l2vpn 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
set protocols mpls interface all

vEX4

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 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 l2vpn signaling
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 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 protocols mpls interface all

vEX5

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 512 encapsulation vlan-ccc
set interfaces ge-0/0/0 unit 512 vlan-id 512
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-instances cust1 instance-type l2vpn
set routing-instances cust1 protocols l2vpn site cust1 interface ge-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 ge-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 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 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

Once all commands have been applied, run ‘show l2vpn connections‘ on vEX1 or vEX5 to confirm all is good. Example of output is below.

root> show l2vpn connections    
Layer-2 VPN connections:

Legend for connection status (St)   
EI -- encapsulation invalid      NC -- interface encapsulation not CCC/TCC/VPLS
EM -- encapsulation mismatch     WE -- interface and instance encaps not same
VC-Dn -- Virtual circuit down    NP -- interface hardware not present 
CM -- control-word mismatch      -> -- only outbound connection is up
CN -- circuit not provisioned    <- -- only inbound connection is up
OR -- out of range               Up -- operational
OL -- no outgoing label          Dn -- down                      
LD -- local site signaled down   CF -- call admission control failure      
RD -- remote site signaled down  SC -- local and remote site ID collision
LN -- local site not designated  LM -- local site ID not minimum designated
RN -- remote site not designated RM -- remote site ID not minimum designated
XX -- unknown connection status  IL -- no incoming label
MM -- MTU mismatch               MI -- Mesh-Group ID not available
BK -- Backup connection          ST -- Standby connection
PF -- Profile parse failure      PB -- Profile busy
RS -- remote site standby        SN -- Static Neighbor
LB -- Local site not best-site   RB -- Remote site not best-site
VM -- VLAN ID mismatch           HS -- Hot-standby Connection

Legend for interface status 
Up -- operational                       
Dn -- down

Instance: cust1
Edge protection: Not-Primary
  Local site: cust1 (1)
    connection-site           Type  St     Time last up          # Up trans
    2                         rmt   Up     Jan 27 12:29:12 2024           1
      Remote PE: 8.8.8.8, Negotiated control-word: Yes (Null)
      Incoming label: 800001, Outgoing label: 800000
      Local interface: ge-0/0/0.512, Status: Up, Encapsulation: VLAN
      Flow Label Transmit: No, Flow Label Receive: No

Leave a Reply

Your email address will not be published. Required fields are marked *