Skip to content

Fix: Make the ifname of host-side part of vEth pair unique#2570

Merged
ipspace merged 1 commit intodevfrom
clab-bridge-if
Aug 1, 2025
Merged

Fix: Make the ifname of host-side part of vEth pair unique#2570
ipspace merged 1 commit intodevfrom
clab-bridge-if

Conversation

@ipspace
Copy link
Owner

@ipspace ipspace commented Aug 1, 2025

We have to connect the host-side part of a vEth pair to a Linux bridge in a multi-access or multi-provider environment. To do that, we have to have a unique host-side interface name, and the current mechanisms failed for people who couldn't possibly make their node names unique in the first 10 characters.

This fix replaces the 'use the node name prefix' trick that helped keep the device name under 16 characters (until containerlab started using long interface names for SR-SIM) with a totally cryptic interface name that shouldn't exceed 16 characters unless you're doing something truly crazy (for example, 8-digit multilab ID).

As we're not using the bridge-side interface names anywhere else in the code ('netlab capture' command is started within the container NS), this SHOULD NOT (BUT WHO KNOWS) affect anything else.

Fixes #2564

We have to connect the host-side part of a vEth pair to a Linux bridge
in a multi-access or multi-provider environment. To do that, we have to
have a unique host-side interface name, and the current mechanisms
failed for people who couldn't possibly make their node names unique in
the first 10 characters.

This fix replaces the 'use the node name prefix' trick that helped keep
the device name under 16 characters (until containerlab started using
long interface names for SR-SIM) with a totally cryptic interface name
that shouldn't exceed 16 characters unless you're doing something truly
crazy (for example, 8-digit multilab ID).

As we're not using the bridge-side interface names anywhere else in the
code ('netlab capture' command is started within the container NS),
this SHOULD NOT (BUT WHO KNOWS) affect anything else.

Fixes #2564
@ipspace ipspace requested a review from jbemmel August 1, 2025 17:02
ipspace added a commit that referenced this pull request Aug 1, 2025
Copy link
Collaborator

@jbemmel jbemmel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shortening the node names is the first thing I did, which "fixed" the issue for me locally. However, out of consideration for the fact that unsuspecting other Netlab users might encounter the same scenario, I decided to submit an issue to document the potential problem and alert the community.

I appreciate the author spending the time to fix this edge case

@ipspace ipspace merged commit c2d61ad into dev Aug 1, 2025
@ipspace ipspace deleted the clab-bridge-if branch August 1, 2025 17:34
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

Successfully merging this pull request may close these issues.

[BUG] Issue with long node names in hybrid provider scenarios

2 participants