# EVPN-VPWS Multihomed IOS-XR (Port-Active)

Load **multi.service.init.cfg**

```
configure
load multi.service.init.cfg
commit replace
y
```

<figure><img src="/files/wN5f3DEkpOx7KMEdXJTl" alt=""><figcaption></figcaption></figure>

The CEs now have two subinterfaces: BE1.10 and BE1.20.

* Configure the PEs so that only one port in the bundle is active at a time.
* For PE1-PE2, force PE1 to be standby.
* For PE3-PE4, allow the natural DF election to happen.
* The standby PE for PE3-PE4 should bring the bundle down instead of using an LACP OoS (out of service) signal.
* Configure two separate VPWS services, one per VLAN.

## Answer <a href="#id-0db44c39-604d-4037-b7cc-14b14738f531" id="id-0db44c39-604d-4037-b7cc-14b14738f531"></a>

```
#PE1, PE2
int Gi0/0/0/1
 no shut
 bundle id 1 mode active
!
int be1
 lacp system mac 0000.1111.2222
!
int be1.10 l2transport
 encap dot1q 10
 rewrite ingress tag pop 1 symmetric
!
int be1.20 l2transport
 encap dot1q 20
 rewrite ingress tag pop 1 symmetric
!
l2vpn xconnect group VPWS
 p2p 10
  int be1.10
  neighbor evpn evi 10 service 10
 p2p 20
  int be1.20
  neighbor evpn evi 20 service 20

#PE1
evpn
 interface Bundle-Ether1
  ethernet-segment
   identifier type 0 12.12.12.12.12.12.12.12.12
   load-balancing-mode port-active
   service-carving preference-based
    weight 50

#PE2
evpn
 interface Bundle-Ether1
  ethernet-segment
   identifier type 0 12.12.12.12.12.12.12.12.12
   load-balancing-mode port-active
   service-carving preference-based
    weight 100

#PE3, PE4
int Gi0/0/0/1
 no shut
 bundle id 2 mode active
!
int be2
 lacp system mac 0000.3333.4444
!
int be2.10 l2transport
 encap dot1q 10
 rewrite ingress tag pop 1 symmetric
!
int be2.20 l2transport
 encap dot1q 20
 rewrite ingress tag pop 1 symmetric
!
l2vpn xconnect group VPWS
 p2p 10
  int be2.10
  neighbor evpn evi 10 service 10
 p2p 20
  int be2.20
  neighbor evpn evi 20 service 20
!
evpn
 interface Bundle-Ether2
  ethernet-segment
   identifier type 0 34.34.34.34.34.34.34.34.34
   load-balancing-mode port-active
  !
  access-signal bundle-down
```

## Explanation <a href="#id-291a5284-98d7-47ea-8f36-f3f10e363702" id="id-291a5284-98d7-47ea-8f36-f3f10e363702"></a>

There are three types of EVPN multi-homing redundancy modes:

* All-Active
  * The links in the bundle are all active. The DF election is used to prevent duplication of BUM traffic for a bridged EVPN service.
* Single-Active
  * Only one link in the bundle is active but on a per-service basis. This gives some load balancing to the bundle, as service X uses link 1 and service Y uses link 2. There is still redundancy, as if link 1 is lost, service X and Y use link 2.
* Port-Active
  * Only one link in the bundle is used for the ESI in general. All services only use one link.

Port-Active is useful is situations in which you need to do accounting for billing on one PE. You can know that all traffic will always use one single interface. Additionally, port-active can be useful when you specifically want one link to always be standby, because it might have higher latency or some other less desirable trait.

To configure the ESI as port-active, all PEs participating in the ESI define the load-balancing-method as port-active:

```
evpn
 interface Bundle-Ether1
  ethernet-segment
   load-balancing-mode port-active
```

The process of electing a PE as primary and all other PEs as standby is called “service carving.” For port-active, this election is not on a per-service basis, it is instead on a per-ESI basis. Left at the defaults, the PEs use a formula to determine which PE is active. We can see that PE3 and PE4 elected PE3 as the primary forwarder for the ESI.

From PE3 (using **show evpn ethernet-segment detail**):

<div align="left"><figure><img src="/files/ow61e2EaEruezvvqgJEg" alt=""><figcaption></figcaption></figure></div>

From PE4:

<div align="left"><figure><img src="/files/qJUJlrscMAfahiE6vAe1" alt=""><figcaption></figcaption></figure></div>

This election is essentially random, because the modulo result of the formula means that a PE is determined to be primary simply based on whether the RID is higher or lower than the other PEs.

Also notice that the access signal mode has been changed to **bundle down** instead of **OoS**. On CE2, we see that the link to PE4 is defaulted:

<div align="left"><figure><img src="/files/B5I8jTqyiAhc4Yfaibck" alt=""><figcaption></figcaption></figure></div>

### Service Carving for Port-Active <a href="#id-561a5597-d1c5-4a26-8ef4-8f2920534e25" id="id-561a5597-d1c5-4a26-8ef4-8f2920534e25"></a>

Let’s now look at the service carving configuration for PE1 and PE2 which allows us to control which link is placed in active and which links are standby.

There are two ways to configure service carving for an ESI. First, we can specify whether the PE should be active or standby for a list of EVIs. Each EVI represents a service.

```
evpn
 interface Bundle-Ether1
  ethernet-segment
   service-carving manual
    primary 10-100 secondary 101-200
```

The above configuration is not applicable to port-active mode though, because with port-active we need to bring the interface down in the bundle. It wouldn’t be possible to bring the interface down on a per-service basis. So instead we use the following configuration:

```
evpn
 interface Bundle-Ether1
  ethernet-segment
   service-carving preference-based
    weight 50
```

The higher weight is better. Only the PE with the highest weight will place its link in active. All other PEs (more than two PEs can belong to an ESI) will place their link in standby.

The weight is signaled in the type 4 route for the DF election. We see that PE1’s weight is 50:

<div align="left"><figure><img src="/files/zTBLABty8xQ9rJ0rdKhk" alt=""><figcaption></figcaption></figure></div>

PE2’s weight is 100:

<div align="left"><figure><img src="/files/oo4jfzti01lFsoGZlQaf" alt=""><figcaption></figcaption></figure></div>

Note above that the 2 after **DF Election** indicates the load-balancing-method.

* 0 = All-Active
* 1 = Single-Active
* 2 = Port-Active

PE1 sees that PE2’s weight is higher, so it places its link in LACP OoS:

<div align="left"><figure><img src="/files/Gy6dCUZpCXkfkC5vqW5U" alt=""><figcaption></figcaption></figure></div>

<div align="left"><figure><img src="/files/GhEoTYoGF87Tt8X2E86k" alt=""><figcaption></figcaption></figure></div>

Notice above that the preference weight is present under the **Peering Details** section. (0x32 is 50 and 0x64 is 100).

If we change PE1 to have a higher weight than PE2, PE1 will become active and PE2 will place its interface in standby. Currently, we see on the CE that 0/0/0/2 is active:

<div align="left"><figure><img src="/files/kMFyd7GrfHqMGKjXo0Xy" alt=""><figcaption></figcaption></figure></div>

```
#PE1
evpn
 interface Bundle-Ether1
  ethernet-segment
   service-carving preference-based
    weight 150
```

Now 0/0/0/1 is active:

<div align="left"><figure><img src="/files/OYw7ktg4abBvfBEaji6T" alt=""><figcaption></figcaption></figure></div>

In summary, port-active allows for a simple way to only use one link in the bundle at a given time. The standby links are ready to take over in case the primary link goes down. This provides for a deterministic way to know which link the traffic is taking. Currently, all traffic is deterministically flowing through CE1-PE1-PE3-CE2.

### How do remote PEs know which PE is active? <a href="#fd3360d8-eec3-4fac-9925-acbbd13785b9" id="fd3360d8-eec3-4fac-9925-acbbd13785b9"></a>

The standby PE still advertises a type 1 route for the VPWS. I’ve changed PE1’s weight back to 50, so now PE2 is active. On PE3, we see that it only uses PE1 as a backup path. (Indicated by the exclamation point).

<div align="left"><figure><img src="/files/Hyz21thXW4GVi2pJT9TC" alt=""><figcaption></figcaption></figure></div>

In the EVPN L2 extcommunity, the active PE uses 0x02, and the standby PE uses 0x01.

<div align="left"><figure><img src="/files/jnGPqaFNeuW3VFnogFXR" alt=""><figcaption></figcaption></figure></div>

If I change back to all-active on PE1 and PE2, both PEs use value 0x02:

<div align="left"><figure><img src="/files/ZNbZx3cT5bUGWKaKeg7S" alt=""><figcaption></figcaption></figure></div>

So, value 0x02 means “active” and value 0x01 means “standby.”


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ccie-sp.gitbook.io/ccie-spv5.1-labs/labs/evpn/evpn-vpws-multihomed-ios-xr-port-active.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
