Skip to content

Commit a81d36a

Browse files
committed
Fix: Enable EVPN on IPv6 BGP sessions on control-plane-only nodes
This fix uses node-level vxlan.transport variable for data-plane nodes and topology-level vxlan.use_v6_vtep variable for control-plane-only nodes to figure out which BGP transport session to use for EVPN AF in VXLAN deployments. Other changes: * Consistently set 'vxlan.transport' node variable to 'ipv4' or 'ipv6' (previously, it was only set to 'ipv6') * Modify the EVPN/VXLAN-over-IPv6 integration test to check the activation of EVPN over IPv6 BGP session Closes #3262
1 parent 16debab commit a81d36a

File tree

10 files changed

+41
-23
lines changed

10 files changed

+41
-23
lines changed

netsim/modules/evpn.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,21 @@ def validate_evpn_lists(toponode: Box, obj_path: str, topology: Box, create: boo
4848

4949
def get_evpn_af(node: Box, topology: Box) -> typing.Optional[str]:
5050
evpn_transport = node.get('evpn.transport','vxlan')
51-
if evpn_transport == 'vxlan': # For VXLAN transport
52-
evpn_af = node.get('vxlan.transport','ipv4') # Check the transport address family
53-
if evpn_af == 'ipv6': # ... and enable EVPN over corresponding BGP session
54-
features = devices.get_device_features(node,topology.defaults)
55-
if not features.evpn.ipv6: # ... but only if the device supports it
56-
log.error(
57-
f'node {node.name}/device {node.device} cannot use EVPN with IPv6 next hops',
58-
more_hints=['The node is using VXLAN-over-IPv6 transport, but does not support EVPN over IPv6'],
59-
category=log.IncorrectValue)
60-
return None
61-
else: # For MPLS transport
62-
evpn_af = 'ipv4' # ... assume we're using IPv4 with LDP
51+
if evpn_transport != 'vxlan': # Are we using VXLAN transport?
52+
return 'ipv4' # No, assume IPv4 next hops for MPLS/LDP and SR-MPLS transport
53+
54+
if 'vxlan.transport' in node: # Data-plane node with VXLAN module?
55+
evpn_af = node.vxlan.transport
56+
else: # Otherwise figure out the AF from topology settings
57+
evpn_af = 'ipv6' if topology.get('vxlan.use_v6_vtep',False) else 'ipv4'
58+
if evpn_af == 'ipv6': # Enable EVPN over IPv6 BGP sessions
59+
features = devices.get_device_features(node,topology.defaults)
60+
if not features.evpn.ipv6: # ... only if the device supports it
61+
log.error(
62+
f'node {node.name}/device {node.device} cannot use EVPN with IPv6 next hops',
63+
more_hints=['The node is using VXLAN-over-IPv6 transport, but does not support EVPN over IPv6'],
64+
category=log.IncorrectValue)
65+
return None
6366

6467
return evpn_af
6568

netsim/modules/vxlan.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ def node_set_vtep(node: Box, topology: Box) -> bool:
110110
if topology.get('vxlan.use_v6_vtep',False):
111111
vtep_af = 'ipv6'
112112
features = devices.get_device_features(node,topology.defaults)
113-
node.vxlan.transport = vtep_af
114113
if not features.get('vxlan.vtep6'):
115114
log.error(
116115
f'Device {node.device} (node {node.name}) does not support VXLAN over IPv6',
@@ -120,6 +119,8 @@ def node_set_vtep(node: Box, topology: Box) -> bool:
120119
else:
121120
vtep_af = 'ipv4'
122121

122+
node.vxlan.transport = vtep_af
123+
123124
if not vtep_af in vtep_interface:
124125
log.error(
125126
f'VXLAN module needs an {vtep_af.upper()} address on interface {loopback_name} of {node.name}',

tests/integration/evpn/41-vxlan-ipv6-bridging.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,16 @@ validate:
8888
wait_msg: Waiting for IBGP session
8989
plugin: bgp_neighbor(node.bgp.neighbors,'s2',af='ipv6')
9090

91-
# evpn_adj_s1:
92-
# description: Check EVPN AF on IBGP adjacencies with S1
93-
# nodes: [ probe ]
94-
# plugin: bgp_neighbor(node.bgp.neighbors,'s1',activate='evpn',af='ipv6')
95-
# stop_on_error: True
96-
# evpn_adj_s2:
97-
# description: Check EVPN AF on IBGP adjacencies with S2
98-
# nodes: [ probe ]
99-
# plugin: bgp_neighbor(node.bgp.neighbors,'s2',activate='evpn',af='ipv6')
100-
# stop_on_error: True
91+
evpn_adj_s1:
92+
description: Check EVPN AF on IBGP adjacencies with S1
93+
nodes: [ probe ]
94+
plugin: bgp_neighbor(node.bgp.neighbors,'s1',activate='evpn',af='ipv6')
95+
stop_on_error: True
96+
evpn_adj_s2:
97+
description: Check EVPN AF on IBGP adjacencies with S2
98+
nodes: [ probe ]
99+
plugin: bgp_neighbor(node.bgp.neighbors,'s2',activate='evpn',af='ipv6')
100+
stop_on_error: True
101101

102102
ping_red:
103103
description: Ping-based reachability test in VLAN red

tests/topology/expected/evpn-asymmetric-irb-ospf.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,7 @@ nodes:
758758
vxlan:
759759
domain: global
760760
flooding: evpn
761+
transport: ipv4
761762
vlans:
762763
- red
763764
- blue
@@ -1118,6 +1119,7 @@ nodes:
11181119
vxlan:
11191120
domain: global
11201121
flooding: evpn
1122+
transport: ipv4
11211123
vlans:
11221124
- red
11231125
- blue

tests/topology/expected/evpn-hub-spoke.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ nodes:
156156
flooding: evpn
157157
l3vnis:
158158
- hub
159+
transport: ipv4
159160
vtep: 10.0.0.1
160161
vtep_interface: Loopback0
161162
r2:
@@ -266,6 +267,7 @@ nodes:
266267
flooding: evpn
267268
l3vnis:
268269
- spoke
270+
transport: ipv4
269271
vtep: 10.0.0.2
270272
vtep_interface: Loopback0
271273
provider: clab

tests/topology/expected/evpn-node-vrf.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ nodes:
183183
flooding: evpn
184184
l3vnis:
185185
- tenant
186+
transport: ipv4
186187
vlans:
187188
- red
188189
vtep: 10.0.0.1

tests/topology/expected/evpn-vlan-attr.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ nodes:
149149
vxlan:
150150
domain: global
151151
flooding: evpn
152+
transport: ipv4
152153
vlans:
153154
- red
154155
vtep: 10.0.0.1

tests/topology/expected/evpn-vxlan.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,7 @@ nodes:
682682
vxlan:
683683
domain: global
684684
flooding: evpn
685+
transport: ipv4
685686
vlans:
686687
- red
687688
- blue
@@ -873,6 +874,7 @@ nodes:
873874
vxlan:
874875
domain: global
875876
flooding: evpn
877+
transport: ipv4
876878
vlans:
877879
- red
878880
vtep: 10.0.0.2
@@ -1016,6 +1018,7 @@ nodes:
10161018
vxlan:
10171019
domain: global
10181020
flooding: evpn
1021+
transport: ipv4
10191022
vlans:
10201023
- blue
10211024
vtep: 10.0.0.3

tests/topology/expected/vxlan-router-stick.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ nodes:
253253
vxlan:
254254
domain: global
255255
flooding: static
256+
transport: ipv4
256257
vlans:
257258
- red
258259
- blue
@@ -582,6 +583,7 @@ nodes:
582583
vxlan:
583584
domain: global
584585
flooding: static
586+
transport: ipv4
585587
vlans:
586588
- blue
587589
- red

tests/topology/expected/vxlan-vrf-lite.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,7 @@ nodes:
829829
vxlan:
830830
domain: global
831831
flooding: static
832+
transport: ipv4
832833
vlans:
833834
- red_transport
834835
- blue_transport
@@ -1131,6 +1132,7 @@ nodes:
11311132
vxlan:
11321133
domain: global
11331134
flooding: static
1135+
transport: ipv4
11341136
vlans:
11351137
- red_transport
11361138
- blue_transport
@@ -1324,6 +1326,7 @@ nodes:
13241326
vxlan:
13251327
domain: global
13261328
flooding: static
1329+
transport: ipv4
13271330
vlans:
13281331
- red_transport
13291332
vtep: 10.0.0.8

0 commit comments

Comments
 (0)