Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to Switch link with pool l2only #1433

Closed
DanPartelly opened this issue Oct 25, 2024 · 7 comments
Closed

Switch to Switch link with pool l2only #1433

DanPartelly opened this issue Oct 25, 2024 · 7 comments
Assignees

Comments

@DanPartelly
Copy link
Collaborator

Currently a topology like (see below) results on Cisco devices results in a interface config like:

interface Ethernet0/1
description s2 -> s1
no switchport
no ip address

Wouldn't have more sense to just leave the interface of layer2 device in access mode instead of automatically turning it into a routed interface?

defaults:
    provider: clab
    device: ioll2
      
nodes: [s1, s2, s3]
links:
- s1:
  s2:
  pool: l2only  
@jbemmel
Copy link
Collaborator

jbemmel commented Oct 25, 2024

Makes sense to me (and is arguably a bug)

switchport unless an ip is assigned

OTOH this seems to be the line:

{% elif l.virtual_interface is not defined and netlab_device_type in ['iosvl2','ioll2'] %}

So it's specific to netlab_device_type in ['iosvl2','ioll2'] - there is likely a reason for that

@DanPartelly
Copy link
Collaborator Author

Probably a remnant of what is needed to get management interface on interface 0/1 Cisco L2 devices , we needed a routed interface for that.

If Ivan confirms there is no other reason, Ill fix it.

So it's specific to netlab_device_type in ['iosvl2','ioll2'] - there is likely a reason for that

@ipspace
Copy link
Owner

ipspace commented Oct 25, 2024

Wouldn't have more sense to just leave the interface of layer2 device in access mode instead of automatically turning it into a routed interface?

No. The l2only pool (we could argue whether the name is the best we could do) really means ipv4: False and ipv6: False. It was implemented because Jeroen wanted to implement EVPN-based pseudowires (or some such).

It does not mean we have a switched interface but we do not have IPv4 or IPv6 addresses on this interface. If you want to have a switched interface, you have the VLAN module.

There are two reasons for this distinction:

  • Historically, netlab started with the assumption that devices are routers and that you have to use vlan module to turn them into bridges.
  • Turning interfaces with no IP addresses into bridged interfaces on L2 images would result in device-dependent behavior. The same node might act as a bridge or as a router depending on what device you would choose.

On a completely different topic, if you'd like to have a shortcut for "I want to have these interfaces as access interfaces in VLAN 1" then we can discuss that ;)

@DanPartelly
Copy link
Collaborator Author

DanPartelly commented Oct 26, 2024

Thanks for the detailed explanation. I get it now.

I would like a shortcut. It's one of those nice to have things. During this iouyap debacle I made some simple topologies with weird links just to see what packets fly out on the wire. This is why I even got to see how this is handled in netlab.
It may come handy again in the future sometime.

On a completely different topic, if you'd like to have a shortcut for "I want to have these interfaces as access interfaces in VLAN 1" then we can discuss that ;)

@ipspace
Copy link
Owner

ipspace commented Oct 26, 2024

What we might do is to add more meaning to the role parameter. Right now, it's used primarily with Linux-based devices to implement static routing versus loopback+control plane.

We could add bridge value to the role parameter meaning "do not use no switchport" on IOSvL2/EOS/NXOS or connect everything into a single Linux bridge for Linux-based devices.

Likewise, we could turn host value of role parameter to mean "disable IP routing on this device"

Finally, we should start checking which devices support which roles. Makes sense?

@DanPartelly
Copy link
Collaborator Author

Yes it does. Ill start working on this as soon as my work on iouyap is concluded.

Finally, we should start checking which devices support which roles. Makes sense?

@ipspace
Copy link
Owner

ipspace commented Oct 27, 2024

Moved to relevant bits to #1447

@ipspace ipspace closed this as completed Oct 27, 2024
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

No branches or pull requests

3 participants