Fix: Make the ifname of host-side part of vEth pair unique#2570
Merged
Conversation
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
added a commit
that referenced
this pull request
Aug 1, 2025
jbemmel
approved these changes
Aug 1, 2025
Collaborator
jbemmel
left a comment
There was a problem hiding this comment.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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