Closed jbemmel closed 1 year ago
This is not a bug but a FAD (Functions as Designed). netlab can't read your mind and treats N2 like any other host (or non-VLAN router) attached to a VLAN. The 'vlan.mode' attribute applies only to the nodes with VLAN module, otherwise we would never get IP addresses assigned to hosts attached to a VLAN.
Please note that the IP address gets assigned to the physical interface of the node, and that interface has no VLAN attributes -- it's just a router attached to a segment.
If you don't want to assign IP addresses to nodes attached to a link, you should use the prefix or pool link (or VLAN) attribute.
In my mind, if my intention was to have n1 on the vlan but not n2, I would do like this:
links:
- n1:
vlan.access: v1
n2:
There could be a warning when a vlan attribute is applied to a link and one or more attached nodes don't have the vlan module enabled - but it's not a big issue
In my mind, if my intention was to have n1 on the vlan but not n2, I would do like this:
links: - n1: vlan.access: v1 n2:
OTOH, in #868 you argue that
For consistency, custom attributes defined on the physical interface should also be removed from the neighbor interfaces
... which directly contradicts what you wrote above. You can't have both.
In #868 I am talking about attributes under the ‘neighbors’ key, which are copied there by transformation. It’s about cleaning up the data model
Describe the bug
In the below topology, the user forgot to enable the vlan module for n2. Instead of an error message, the 'bridge' interface gets an IP address assigned
To Reproduce
netlab create test.yml
Expected behavior
Error message: vlan module not enabled for n2
Lab topology
Output
host_vars/n2/topology.yml
Version
netlab version 1.6.2