Skip to content

Commit e034efc

Browse files
authored
Fix: Use topology-level vxlan.use_v6_vtep attribute (#3301)
The VXLAN module used defaults.vxlan.use_v6_vtep attribute instead of the topology-level one. This commit fixes that discrepancy but also: * Changes the settings in IPv6 VXLAN and EVPN integration tests to ensure they are tested with the correct settings. * Consistently uses correct settings in transformation tests * Converts an EVPN integration test to use IPv6 VXLAN transport Closes #3265
1 parent 99f5d74 commit e034efc

File tree

6 files changed

+39
-10
lines changed

6 files changed

+39
-10
lines changed

netsim/modules/vxlan.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def node_set_vtep(node: Box, topology: Box) -> bool:
107107
loopback_name = intf.ifname
108108
break
109109

110-
if topology.defaults.vxlan.use_v6_vtep:
110+
if topology.get('vxlan.use_v6_vtep',False):
111111
vtep_af = 'ipv6'
112112
features = devices.get_device_features(node,topology.defaults)
113113
node.vxlan.transport = vtep_af
@@ -196,7 +196,6 @@ def module_post_transform(self, topology: Box) -> None:
196196

197197
if not 'use_v6_vtep' in topology.vxlan: # Copy IPv6 VTEP setting into global parameter
198198
topology.vxlan.use_v6_vtep = topology.defaults.vxlan.use_v6_vtep
199-
200199
for name,ndata in topology.nodes.items():
201200
if not 'vxlan' in ndata.get('module',[]): # Skip nodes without VXLAN module
202201
continue

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ addressing:
2222
p2p.ipv6: 2001:db8:1::/48
2323
p2p.ipv4: False
2424

25-
defaults.vxlan.use_v6_vtep: true
25+
vxlan.use_v6_vtep: true
2626

2727
module: [ vlan, vxlan, ospf, bgp, evpn ]
2828

tests/integration/vxlan/07-vxlan-bridging-v6only.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ message: |
1212
defaults.sources.extra: [ ../wait_times.yml, ../warnings.yml ]
1313
plugin: [ fix_mtu ]
1414

15-
defaults.vxlan.use_v6_vtep: true
15+
vxlan.use_v6_vtep: true
1616

1717
groups:
1818
_auto_create: True

tests/topology/expected/evpn-l3vni-only.yml

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,18 @@ links:
2727
- ifindex: 1
2828
ifname: eth1
2929
ipv4: 10.1.0.1/30
30+
ipv6: true
3031
node: r1
3132
- ifindex: 1
3233
ifname: eth1
3334
ipv4: 10.1.0.2/30
35+
ipv6: true
3436
node: r2
3537
linkindex: 1
3638
node_count: 2
3739
prefix:
3840
ipv4: 10.1.0.0/30
41+
ipv6: true
3942
type: p2p
4043
- _linkname: vrfs.red.links[1]
4144
bridge: input_2
@@ -77,10 +80,12 @@ nodes:
7780
r1:
7881
af:
7982
ipv4: true
83+
ipv6: true
8084
vpnv4: true
8185
bgp:
8286
advertise:
8387
- ipv4: 10.0.0.1/32
88+
ipv6: 2001:db8:cafe:1::/64
8489
advertise_loopback: true
8590
as: 65000
8691
community:
@@ -93,19 +98,23 @@ nodes:
9398
- standard
9499
- extended
95100
ipv4: true
101+
ipv6: true
96102
neighbors:
97103
- _source_intf:
98104
ifindex: 0
99105
ifname: Loopback0
100106
ipv4: 10.0.0.1/32
107+
ipv6: 2001:db8:cafe:1::1/64
101108
neighbors: []
102109
type: loopback
103110
virtual_interface: true
104111
activate:
105112
ipv4: true
113+
ipv6: true
106114
as: 65000
107-
evpn: ipv4
115+
evpn: ipv6
108116
ipv4: 10.0.0.2
117+
ipv6: 2001:db8:cafe:2::1
109118
name: r2
110119
next_hop_self: ebgp
111120
type: ibgp
@@ -125,11 +134,13 @@ nodes:
125134
- ifindex: 1
126135
ifname: eth1
127136
ipv4: 10.1.0.1/30
137+
ipv6: true
128138
linkindex: 1
129139
name: r1 -> r2
130140
neighbors:
131141
- ifname: eth1
132142
ipv4: 10.1.0.2/30
143+
ipv6: true
133144
node: r2
134145
ospf:
135146
area: 0.0.0.0
@@ -154,6 +165,7 @@ nodes:
154165
ifindex: 0
155166
ifname: Loopback0
156167
ipv4: 10.0.0.1/32
168+
ipv6: 2001:db8:cafe:1::1/64
157169
neighbors: []
158170
ospf:
159171
area: 0.0.0.0
@@ -175,6 +187,7 @@ nodes:
175187
ospf:
176188
af:
177189
ipv4: true
190+
ipv6: true
178191
area: 0.0.0.0
179192
areas:
180193
- _area_int: 0
@@ -210,15 +223,18 @@ nodes:
210223
flooding: evpn
211224
l3vnis:
212225
- red
213-
vtep: 10.0.0.1
226+
transport: ipv6
227+
vtep: 2001:db8:cafe:1::1
214228
vtep_interface: Loopback0
215229
r2:
216230
af:
217231
ipv4: true
232+
ipv6: true
218233
vpnv4: true
219234
bgp:
220235
advertise:
221236
- ipv4: 10.0.0.2/32
237+
ipv6: 2001:db8:cafe:2::/64
222238
advertise_loopback: true
223239
as: 65000
224240
community:
@@ -231,19 +247,23 @@ nodes:
231247
- standard
232248
- extended
233249
ipv4: true
250+
ipv6: true
234251
neighbors:
235252
- _source_intf:
236253
ifindex: 0
237254
ifname: Loopback0
238255
ipv4: 10.0.0.2/32
256+
ipv6: 2001:db8:cafe:2::1/64
239257
neighbors: []
240258
type: loopback
241259
virtual_interface: true
242260
activate:
243261
ipv4: true
262+
ipv6: true
244263
as: 65000
245-
evpn: ipv4
264+
evpn: ipv6
246265
ipv4: 10.0.0.1
266+
ipv6: 2001:db8:cafe:1::1
247267
name: r1
248268
next_hop_self: ebgp
249269
type: ibgp
@@ -263,11 +283,13 @@ nodes:
263283
- ifindex: 1
264284
ifname: eth1
265285
ipv4: 10.1.0.2/30
286+
ipv6: true
266287
linkindex: 1
267288
name: r2 -> r1
268289
neighbors:
269290
- ifname: eth1
270291
ipv4: 10.1.0.1/30
292+
ipv6: true
271293
node: r1
272294
ospf:
273295
area: 0.0.0.0
@@ -292,6 +314,7 @@ nodes:
292314
ifindex: 0
293315
ifname: Loopback0
294316
ipv4: 10.0.0.2/32
317+
ipv6: 2001:db8:cafe:2::1/64
295318
neighbors: []
296319
ospf:
297320
area: 0.0.0.0
@@ -313,6 +336,7 @@ nodes:
313336
ospf:
314337
af:
315338
ipv4: true
339+
ipv6: true
316340
area: 0.0.0.0
317341
areas:
318342
- _area_int: 0
@@ -348,7 +372,8 @@ nodes:
348372
flooding: evpn
349373
l3vnis:
350374
- red
351-
vtep: 10.0.0.2
375+
transport: ipv6
376+
vtep: 2001:db8:cafe:2::1
352377
vtep_interface: Loopback0
353378
ospf:
354379
area: 0.0.0.0
@@ -369,4 +394,4 @@ vrfs:
369394
vxlan:
370395
domain: global
371396
flooding: evpn
372-
use_v6_vtep: false
397+
use_v6_vtep: true

tests/topology/input/evpn-l3vni-only.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ defaults.device: none
22
provider: clab
33
module: [bgp, vlan, vxlan, vrf, evpn, ospf]
44

5+
addressing:
6+
loopback.ipv6: 2001:db8:cafe::/48
7+
p2p.ipv6: True
8+
vxlan.use_v6_vtep: True
9+
510
bgp.as: 65000
611

712
vrfs:

tests/topology/input/vxlan-static.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ addressing:
55
loopback.ipv6: 2001:db8:cafe::/48
66
p2p.ipv6: True
77

8-
defaults.vxlan.use_v6_vtep: True
8+
vxlan.use_v6_vtep: True
99

1010
vlans:
1111
red:

0 commit comments

Comments
 (0)