ipspace / netlab

Making virtual networking labs suck less
https://netlab.tools
Other
440 stars 66 forks source link

[BUG] Node interface IP/gateway IP overlap on VLAN links #1351

Open ipspace opened 2 weeks ago

ipspace commented 2 weeks ago

Describe the bug

The gateway IP can overlap the node IP on the VLAN links when the gateway.id is not set globally (so it cannot be taken out of the ID pool).

Lab topology

provider: clab
defaults.device: eos

module: [vlan,gateway]

nodes: [n1,n2]

vlans:
 v1:
  gateway:
   id: 1
links:
- n1:
  n2:
  vlan.trunk: [v1]

Solutions

In theory, we could scan through all link and VLAN data to find gateway.id values and remove them from the ID pool.

In practice, we'll just check for an overlap and report an error explaining that the gateway.id has to be set globally if you want to set it to a low value.

ipspace commented 2 weeks ago

Left to do: create an error if we ever manage to create node address equal to gateway address.