Skip to content

EVPN/VXLAN on Juniper vPTX#3155

Merged
ipspace merged 8 commits intoipspace:devfrom
rickycraft:vptx-evpn-vxlan
Mar 2, 2026
Merged

EVPN/VXLAN on Juniper vPTX#3155
ipspace merged 8 commits intoipspace:devfrom
rickycraft:vptx-evpn-vxlan

Conversation

@rickycraft
Copy link
Contributor

Static VXLAN is implemented as per Juniper doc but the forwarding of BUM packet is not working. Pure L2 forwarding works but arp learing is broken.

On the EVPN side the same test as vjunos-switch pass exept:
04-vxlan-central-routing.yml -> due to problems related to BUM forwarding
22-ospf-ce-router.yml -> issue on the mtu exists fails also on vjunos-switch

Copy link
Owner

@ipspace ipspace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good to me (running integration tests now), apart from missing documentation update (no worries, I can do that).

However, I wonder why you decided to enable the anycast gateway support.

I will see how well that works in the "traditional" (VLAN) anycast scenario, if it doesn't then I'll limit it to EVPN only (I'll have to do something similar for Cisco IOS XE and XR anyway).

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds EVPN/VXLAN feature support for the Juniper vPTX (Junos EVO) device type and refactors Junos EVPN templating so vPTX and vJunos-switch can share the same EVPN control-plane/MAC-VRF configuration.

Changes:

  • Enable EVPN (including VLAN-aware bundle support) for vPTX and add vPTX-specific device quirks.
  • Add vPTX-specific VXLAN (static flooding) and EVPN templates.
  • Refactor vJunos-switch EVPN templating to use a shared junos-common.j2 include.

Reviewed changes

Copilot reviewed 7 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
netsim/devices/vptx.yml Enables EVPN capabilities for vPTX and tweaks VXLAN/gateway feature flags.
netsim/devices/vptx.py Adds vPTX-specific quirk handling (EVPN VLAN trunk restriction + unique RD for VLAN bundles).
netsim/ansible/templates/vxlan/vptx.j2 Introduces Junos EVO-specific static VXLAN configuration (virtual-switch instance).
netsim/ansible/templates/vxlan/vjunos-switch.j2 Minor formatting change in the header comment.
netsim/ansible/templates/vlan/vptx.j2 Guards VLAN stanza generation when vlans is undefined.
netsim/ansible/templates/evpn/vptx.j2 Adds vPTX EVPN template that includes shared Junos EVPN logic.
netsim/ansible/templates/evpn/vjunos-switch.j2 Replaces inlined EVPN logic with an include of shared Junos EVPN template.
netsim/ansible/templates/evpn/junos-common.j2 New shared Junos EVPN control-plane + MAC-VRF + L3VNI configuration template.

subif_name: "{ifname}.{vlan.access_id}"
native_routed: true
vxlan:
requires: [ evpn ]
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

features.vxlan.requires: [ evpn ] forces the EVPN module to be enabled even for vxlan.flooding: static, which can lead to conflicting configs (static virtual-switch instance from vxlan/vptx.j2 plus MAC-VRF EVPN config from evpn/vptx.j2) and also blocks valid static-VXLAN-only topologies. Drop the device-specific requires (or make it conditional on vxlan.flooding: evpn via validation/quirks) so static VXLAN can run without the EVPN module.

Suggested change
requires: [ evpn ]

Copilot uses AI. Check for mistakes.
Comment on lines 50 to 55
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The vPTX EVPN template explicitly states _junos_default_macvrf mode is not supported on EVO, but the quirk code doesn’t prevent users/tests from setting evpn._junos_default_macvrf: true, which would cause evpn/vptx.j2 (via junos-common.j2) to skip MAC-VRF generation and produce an incomplete EVPN config. Consider adding a device_quirks check that reports an error (or forces the flag to False) when this knob is set on vPTX.

Suggested change
def check_default_macvrf_unsupported(node: Box, topology: Box) -> None:
"""
vPTX (Junos EVO) does not support evpn._junos_default_macvrf mode.
If the knob is set, report a quirk and force it back to False to avoid
generating incomplete EVPN configuration.
"""
if 'evpn' not in node.get('module',[]):
return
if node.get('evpn._junos_default_macvrf', False):
report_quirk(
f'node {node.name} cannot use evpn._junos_default_macvrf mode on vPTX (Junos EVO); the knob is not supported and will be ignored',
node=node,
category=log.IncorrectType,
more_hints=[
'Remove evpn._junos_default_macvrf from the node configuration or use MAC-VRF-based EVPN services instead'
],
quirk='evpn_macvrf'
)
# Normalize the configuration so downstream quirks and templates see a supported setting
try:
# Ensure evpn sub-Box exists before assignment
evpn = node.evpn
except AttributeError:
return
evpn._junos_default_macvrf = False
class VPTX(_JUNOS):
@classmethod
def device_quirks(self, node: Box, topology: Box) -> None:
if log.debug_active('quirks'):
print(f"*** DEVICE QUIRKS FOR vPTX {node.name}")
check_default_macvrf_unsupported(node,topology)

Copilot uses AI. Check for mistakes.
@rickycraft
Copy link
Contributor Author

However, I wonder why you decided to enable the anycast gateway support.

I will see how well that works in the "traditional" (VLAN) anycast scenario, if it doesn't then I'll limit it to EVPN only (I'll have to do something similar for Cisco IOS XE and XR anyway).

I wanted to use it in my test scenario, it makes sense limiting it only to EVPN.

@ipspace ipspace merged commit 6b4f52c into ipspace:dev Mar 2, 2026
6 checks passed
@ipspace
Copy link
Owner

ipspace commented Mar 2, 2026

Integration tests passed, merged the PR. Thanks again!!! and welcome to netlab contributors!

What's next? vJunos-router?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants