Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
EVPN User Guide
Table of Contents Expand all
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

Example: Configuring EVPN with Support for Virtual Switch

date_range 20-Dec-24

Example: Configuring EVPN with Support for Virtual Switch

This example shows how to configure a virtual switch in an Ethernet VPN (EVPN) deployment.

Requirements

This example uses the following hardware and software components:

  • Two MX Series 5G Universal Routing Platforms containing MPC FPCs.

  • Two customer edge (CE) routers.

  • Junos OS Release 14.1 or later.

Before you begin:

  1. Configure the router interfaces.

  2. Configure OSPF or any other IGP protocol.

  3. Configure BGP.

  4. Configure RSVP or LDP.

  5. Configure MPLS.

Overview

Starting with Junos OS Release 14.1, the Ethernet VPN (EVPN) solution on MX Series routers with MPC interfaces is extended to provide virtual switch support that enables multiple tenants with independent VLAN and subnet space within an EVPN instance. Virtual switch provides the ability to extend Ethernet VLANs over a WAN using a single EVPN instance while maintaining data-plane separation between the various VLANs associated with that instance. A single EVPN instance can stretch up to 4094 bridge domains defined in a virtual switch to remote sites.

When configuring virtual switch for EVPN, be aware of the following considerations:

  • Due to default ARP policing, some of the ARP packets not destined for the device can be missed. This can lead to delayed ARP learning and synchronization.

  • Clearing ARP for an EVPN can lead to inconsistency between the ARP table and the EVPN ARP table. To avoid this situation, clear both ARP and EVPN ARP tables.

  • The vlan-tag can be configured for local switching. However, vlan-tagged VLANs should not be extended over the EVPN cloud.

Topology

Figure 1 illustrates a simple EVPN topology with virtual switch support. Routers PE1 and PE2 are the provider edge (PE) routers that connect to one customer edge (CE) router each – CE1 and CE2.

Figure 1: EVPN with Virtual Switch SupportEVPN with Virtual Switch Support

Configuration

Procedure

CLI Quick Configuration

To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI at the [edit] hierarchy level.

PE1

content_copy zoom_out_map
set interfaces ge-2/0/9 unit 0 family inet address 10.0.0.1/30
set interfaces ge-2/0/9 unit 0 family mpls
set interfaces ge-0/1/4 flexible-vlan-tagging
set interfaces ge-0/1/4 encapsulation flexible-ethernet-services
set interfaces ge-0/1/4 unit 0 family bridge interface-mode trunk
set interfaces ge-0/1/4 unit 0 vlan-id-list 10
set interfaces ge-0/1/4 unit 1 family bridge interface-mode trunk
set interfaces ge-0/1/4 unit 1 vlan-id-list 20
set interfaces irb unit 0 family inet address 192.168.1.1/16
set interfaces irb unit 1 family inet address 192.168.2.1/16
set interfaces lo0 unit 0 family inet address 10.255.169.37/32
set routing-options router-id 10.255.169.37
set routing-options autonomous-system 100
set routing-options forwarding-table chained-composite-next-hop ingress evpn
set protocols rsvp interface all
set protocols rsvp interface fxp0.0 disable
set protocols mpls label-switched-path PE1-to-PE2 from 10.255.169.37
set protocols mpls label-switched-path PE1-to-PE2 to 10.255.237.18
set protocols mpls interface all
set protocols mpls interface fxp0.0 disable
set protocols bgp group ibgp type internal
set protocols bgp group ibgp local-address 10.255.169.37
set protocols bgp group ibgp family evpn signaling
set protocols bgp group ibgp neighbor 10.255.237.18
set protocols ospf area 0.0.0.0 interface all
set protocols ospf area 0.0.0.0 interface fxp0.0 disable
set routing-instances evpna instance-type virtual-switch
set routing-instances evpna interface ge-0/1/4.0
set routing-instances evpna interface ge-0/1/4.1
set routing-instances evpna route-distinguisher 10.255.169.37:1
set routing-instances evpna vrf-target target:100:1
set routing-instances evpna protocols evpn extended-vlan-list [ 10 20 ]
set routing-instances evpna bridge-domains bda domain-type bridge
set routing-instances evpna bridge-domains bda vlan-id 10
set routing-instances evpna bridge-domains bda routing-interface irb.0
set routing-instances evpna bridge-domains bda bridge-options interface ge-0/1/4.0
set routing-instances evpna bridge-domains bdb domain-type bridge
set routing-instances evpna bridge-domains bdb vlan-id 20
set routing-instances evpna bridge-domains bdb routing-interface irb.1
set routing-instances evpna bridge-domains bdb bridge-options interface ge-0/1/4.1
set routing-instances vrf instance-type vrf
set routing-instances vrf interface irb.0
set routing-instances vrf interface irb.1
set routing-instances vrf route-distinguisher 198.51.100.1:2
set routing-instances vrf vrf-target target:100:2
set routing-instances vrf vrf-table-label

PE2

content_copy zoom_out_map
set interfaces ge-2/1/9 unit 0 family inet address 10.0.0.2/30
set interfaces ge-2/1/9 unit 0 family mpls
set interfaces ge-1/2/4 flexible-vlan-tagging
set interfaces ge-1/2/4 encapsulation flexible-ethernet-services
set interfaces ge-1/2/4 unit 0 family bridge interface-mode trunk
set interfaces ge-1/2/4 unit 0 vlan-id-list 10
set interfaces ge-1/2/4 unit 1 family bridge interface-mode trunk
set interfaces ge-1/2/4 unit 1 vlan-id-list 20
set interfaces irb unit 0 family inet address 192.168.2.2/16
set interfaces irb unit 1 family inet address 192.168.2.3/16
set interfaces lo0 unit 0 family inet address 10.255.237.18/32
set routing-options router-id 10.255.237.18
set routing-options autonomous-system 100
set routing-options forwarding-table chained-composite-next-hop ingress evpn
set protocols rsvp interface all
set protocols rsvp interface fxp0.0 disable
set protocols mpls label-switched-path PE2-to-PE1 from 10.255.237.18
set protocols mpls label-switched-path PE2-to-PE1 to 10.255.169.37
set protocols mpls interface all
set protocols mpls interface fxp0.0 disable
set protocols bgp group ibgp type internal
set protocols bgp group ibgp local-address 10.255.237.18
set protocols bgp group ibgp family evpn signaling
set protocols bgp group ibgp neighbor 10.255.169.37
set protocols ospf area 0.0.0.0 interface all
set protocols ospf area 0.0.0.0 interface fxp0.0 disable
set routing-instances evpna instance-type virtual-switch
set routing-instances evpna interface ge-1/2/4.0
set routing-instances evpna interface ge-1/2/4.1
set routing-instances evpna route-distinguisher 10.255.237.18:1
set routing-instances evpna vrf-target target:100:1
set routing-instances evpna protocols evpn extended-vlan-list [ 10 20 ]
set routing-instances evpna bridge-domains bda domain-type bridge
set routing-instances evpna bridge-domains bda vlan-id 10
set routing-instances evpna bridge-domains bda routing-interface irb.0
set routing-instances evpna bridge-domains bda bridge-options interface ge-1/2/4.0
set routing-instances evpna bridge-domains bdb domain-type bridge
set routing-instances evpna bridge-domains bdb vlan-id 20
set routing-instances evpna bridge-domains bdb routing-interface irb.1
set routing-instances evpna bridge-domains bdb bridge-options interface ge-1/2/4.1
set routing-instances vrf instance-type vrf
set routing-instances vrf interface irb.0
set routing-instances vrf interface irb.1
set routing-instances vrf route-distinguisher 198.51.100.2:2
set routing-instances vrf vrf-target target:100:2
set routing-instances vrf vrf-table-label
Step-by-Step Procedure

The following example requires you to navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration Mode.

To configure Router PE1:

Note:

Repeat this procedure for Router PE2, after modifying the appropriate interface names, addresses, and other parameters.

  1. Configure the PE1 interfaces.

    content_copy zoom_out_map
    [edit interfaces]
    user@PE1# set ge-2/0/9 unit 0 family inet address 10.0.0.1/30
    user@PE1# set ge-2/0/9 unit 0 family mpls
    user@PE1# set ge-0/1/4 flexible-vlan-tagging
    user@PE1# set ge-0/1/4 encapsulation flexible-ethernet-services
    user@PE1# set ge-0/1/4 unit 0 family bridge interface-mode trunk
    user@PE1# set ge-0/1/4 unit 0 vlan-id-list 10
    user@PE1# set ge-0/1/4 unit 1 family bridge interface-mode trunk
    user@PE1# set ge-0/1/4 unit 1 vlan-id-list 20
    user@PE1# set irb unit 0 family inet address 192.168.1.1/16
    user@PE1# set irb unit 1 family inet address 192.168.2.1/16
    user@PE1# set lo0 unit 0 family inet address 10.255.169.37/32
    
  2. Set the router ID and autonomous system number for Router PE1.

    content_copy zoom_out_map
    [edit routing-options]
    user@PE1# set router-id 10.255.169.37
    user@PE1# set autonomous-system 100
    
  3. Configure the chained composite next hop for EVPN.

    content_copy zoom_out_map
    [edit routing-options]
    user@PE1# set forwarding-table chained-composite-next-hop ingress evpn
    
  4. Enable RSVP on all the interfaces of Router PE1, excluding the management interface.

    content_copy zoom_out_map
    [edit protocols]
    user@PE1# set rsvp interface all
    user@PE1# set rsvp interface fxp0.0 disable
    
  5. Create label-switched paths for PE1 to reach PE2.

    content_copy zoom_out_map
    [edit protocols]
    user@PE1# set mpls label-switched-path PE1-to-PE2 from 10.255.169.37
    user@PE1# set mpls label-switched-path PE1-to-PE2 to 10.255.237.18
    
  6. Enable MPLS on all the interfaces of Router PE1, excluding the management interface.

    content_copy zoom_out_map
    [edit protocols]
    user@PE1# set mpls interface all
    user@PE1# set mpls interface fxp0.0 disable
    
  7. Configure the BGP group for Router PE1.

    content_copy zoom_out_map
    [edit protocols]
    user@PE1# set bgp group ibgp type internal
    
  8. Assign local and neighbor addresses to the ibgp BGP group for Router PE1 to peer with Router PE2.

    content_copy zoom_out_map
    [edit protocols]
    user@PE1# set bgp group ibgp local-address 10.255.169.37
    user@PE1# set bgp group ibgp neighbor 10.255.237.18
    
  9. Include the EVPN signaling Network Layer Reachability Information (NLRI) to the ibgp BGP group.

    content_copy zoom_out_map
    [edit protocols]
    user@PE1# set bgp group ibgp family evpn signaling
    
  10. Configure OSPF on all the interfaces of Router PE1, excluding the management interface.

    content_copy zoom_out_map
    [edit protocols]
    user@PE1# set ospf area 0.0.0.0 interface all
    user@PE1# set ospf area 0.0.0.0 interface fxp0.0 disable
    
  11. Configure the virtual switch routing instance.

    content_copy zoom_out_map
    [edit routing-instances]
    user@PE1# set evpna instance-type virtual-switch
    
  12. Configure the interface name for the evpna routing instance.

    content_copy zoom_out_map
    [edit routing-instances]
    user@PE1# set evpna interface ge-0/1/4.0
    user@PE1# set evpna interface ge-0/1/4.1
    
  13. Configure the route distinguisher for the evpna routing instance.

    content_copy zoom_out_map
    [edit routing-instances]
    user@PE1# set evpna route-distinguisher 10.255.169.37:1
    
  14. Configure the VPN routing and forwarding (VRF) target community for the evpna routing instance.

    content_copy zoom_out_map
    [edit routing-instances]
    user@PE1# set evpna vrf-target target:100:1
    
  15. List the VLAN identifiers that are to be EVPN extended.

    content_copy zoom_out_map
    [edit routing-instances]
    user@PE1# set evpna protocols evpn extended-vlan-list [ 10 20 ]
    
  16. Configure the bridge domains for the evpna routing instance.

    content_copy zoom_out_map
    [edit routing-instances]
    user@PE1# set evpna bridge-domains bda domain-type bridge
    
  17. Assign the VLAN ID for the bda bridge domain.

    content_copy zoom_out_map
    [edit routing-instances]
    user@PE1# set evpna bridge-domains bda vlan-id 10
    
  18. Configure the IRB interface as the routing interface for the bda bridge domain.

    content_copy zoom_out_map
    [edit routing-instances]
    user@PE1# set evpna bridge-domains bda routing-interface irb.0
    
  19. Configure the interface name for the bda bridge domain.

    content_copy zoom_out_map
    [edit routing-instances]
    user@PE1# set evpna bridge-domains bda bridge-options interface ge-0/1/4.0
    
  20. Configure the bridge domains for the evpna routing instance.

    content_copy zoom_out_map
    [edit routing-instances]
    user@PE1# set evpna bridge-domains bdb domain-type bridge
    
  21. Assign the VLAN ID for the bdb bridge domain.

    content_copy zoom_out_map
    [edit routing-instances]
    user@PE1# set evpna bridge-domains bdb vlan-id 20
    
  22. Configure the IRB interface as the routing interface for the bda bridge domain.

    content_copy zoom_out_map
    [edit routing-instances]
    user@PE1# set evpna bridge-domains bdb routing-interface irb.1
    
  23. Configure the interface name for bdb bridge domain.

    content_copy zoom_out_map
    [edit routing-instances]
    user@PE1# set evpna bridge-domains bdb bridge-options interface ge-0/1/4.1
    
  24. Configure the VRF routing instance.

    content_copy zoom_out_map
    [edit routing-instances]
    user@PE1# set vrf instance-type vrf
    
  25. Configure the IRB interface as the routing interface for the vrf routing instance.

    content_copy zoom_out_map
    [edit routing-instances]
    user@PE1# set vrf interface irb.0
    user@PE1# set vrf interface irb.1
    
  26. Configure the route distinguisher for the vrf routing instance.

    content_copy zoom_out_map
    [edit routing-instances]
    user@PE1# set vrf route-distinguisher 198.51.100.1:2
    
  27. Configure the VRF target community for the vrf routing instance.

    content_copy zoom_out_map
    [edit routing-instances]
    user@PE1# set vrf vrf-target target:100:2
    
  28. Configure VRF label for the vrf routing instance.

    content_copy zoom_out_map
    [edit routing-instances]
    user@PE1# set vrf vrf-table-label
    

Results

From configuration mode, confirm your configuration by entering the show interfaces, show routing-options, show protocols, and show routing-instances commands. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.

content_copy zoom_out_map
user@PE1# show interfaces
ge-2/0/9 {
    unit 0 {
        family inet {
            address 10.0.0.1/30;
        }
        family mpls;
    }
}
ge-0/1/4 {
    flexible-vlan-tagging;
    encapsulation flexible-ethernet-services;
    unit 0 {
        family bridge {
            interface-mode trunk;
            vlan-id-list 10;
        }
    }
    unit 1 {
        family bridge {
            interface-mode trunk;
            vlan-id-list 20;
        }
    }
}
irb {
    unit 0 {
        family inet {
            address 192.168.1.1/16;
        }
    }
    unit 1 {
        family inet {
            address 192.168.2.1/16;
        }
    }
}
lo0 {
    unit 0 {
        family inet {
            address 10.255.169.37/32;
        }
    }
}
content_copy zoom_out_map
user@PE1# show routing-options
router-id 10.255.169.37;
autonomous-system 100;
forwarding-table {
    chained-composite-next-hop {
        ingress {
            evpn;
        }
    }
}
content_copy zoom_out_map
user@PE1# show protocols
rsvp {
    interface all;
    interface fxp0.0 {
        disable;
    }
}
mpls {
    label-switched-path PE1-to-PE2 {
        from 10.255.169.37;
        to 10.255.237.18;
    }
    interface all;
    interface fxp0.0 {
        disable;
    }
}
bgp {
    group ibgp {
        type internal;
        local-address 10.255.169.37;
        family evpn {
            signaling;
        }
        neighbor 10.255.237.18;
    }
}
ospf {
    area 0.0.0.0 {
        interface all;
        interface fxp0.0 {
            disable;
        }
    }
}
content_copy zoom_out_map
user@PE1# show routing-instances
evpna {
    instance-type virtual-switch;
    interface ge-0/1/4.0;
    interface ge-0/1/4.1;
    route-distinguisher 10.255.169.37:1;
    vrf-target target:100:1;
    protocols {
        evpn {
            extended-vlan-list [ 10 20 ];
        }
    }
    bridge-domains {
        bda {
            domain-type bridge;
            vlan-id 10;
            routing-interface irb.0;
            bridge-options {
                interface ge-0/1/4.0;
            }
        }
        bdb {
            domain-type bridge;
            vlan-id 20;
            routing-interface irb.1;
            bridge-options {
                interface ge-0/1/4.1;
            }
        }
    }
}
vrf {
    instance-type vrf;
    interface irb.0;
    interface irb.1;
    route-distinguisher 10.255.169.37:2;
    vrf-target target:100:2;
    vrf-table-label;
}

Verification

Confirm that the configuration is working properly.

Verifying the Bridge Domain Configuration

Purpose

Verify the bridge domain configuration for the evpna routing instance.

Action

From operational mode, run the show bridge domain extensive command.

content_copy zoom_out_map
user@PE1> show bridge domain extensive
Routing instance: evpna
Bridge domain: bda                            State: Active
Bridge VLAN ID: 10                            EVPN extended: Yes   
Interfaces:
    ge-0/1/4.0
    pip-10.000010000000
    pip-10.feff0f000000
Total MAC count: 2 

Bridge domain: bdb                            State: Active
Bridge VLAN ID: 20                            EVPN extended: Yes   
Interfaces:
    ge-0/1/4.1
    pip-11.010010000000
    pip-11.ffff0f000000
Total MAC count: 2
Meaning

The configured bridge domains bda and bdb and their associated VLAN IDs and interfaces are displayed. The bridge domains are also extended with EVPN.

Verifying MAC Table Routes

Purpose

Verify the MACs learned in the data plane and control plane.

Action

From operational mode, run the show bridge mac-table command.

content_copy zoom_out_map
user@PE1> show bridge mac-table
MAC flags (S -static MAC, D -dynamic MAC, L -locally learned, C -Control MAC
           SE -Statistics enabled, NM -Non configured MAC, R -Remote PE MAC)

Routing instance : evpna
 Bridging domain : bda, VLAN : 10
   MAC                 MAC      Logical          NH     RTR
   address             flags    interface        Index  ID
   00:00:00:aa:01:01   S        ge-0/1/4.0      
   00:00:00:bb:01:01   DC                        1048574 1048574 
   00:00:00:cc:01:01   DC                        1048576 1048576 

Bridging domain : bdb, VLAN : 20
   MAC                 MAC      Logical          NH     RTR
   address             flags    interface        Index  ID
   00:00:00:aa:02:01   S        ge-0/1/4.1      
   00:00:00:bb:02:01   DC                        1048575 1048575 
   00:00:00:cc:02:01   DC                        1048577 1048577 
Meaning

The configured static MACs for the bridge domains are displayed.

Verifying the Bridge EVPN Peer Gateway MAC

Purpose

Verify the bridge EVPN peer gateway MAC for the evpna routing instance.

Action

From operational mode, run the show bridge evpn peer-gateway-macs command.

content_copy zoom_out_map
user@PE1> show bridge evpn peer-gateway-macs
Routing instance : evpna
 Bridging domain : bda, VLAN : 10
  Installed GW MAC addresses:
  00:23:9c:96:af:f0  
  a8:d0:e5:5b:02:08  

Bridging domain : bdb, VLAN : 20
  Installed GW MAC addresses:
  00:23:9c:96:af:f0  
  a8:d0:e5:5b:02:08
Meaning

The gateway MACs of the EVPN peers for the evpna routing instance are displayed.

footer-navigation