Technology-specific tunnel interface names - #3716
Merged
Merged
Conversation
Some devices (Junos, RouterOS7, OpenBSD) use different interface names for different tunnel types. This commit adds a generic "select interface name based on interface technology" function, and uses FRR as an implementation example.
Owner
Author
|
@snuffy22 -- This is what you asked for to implement WG on OpenBSD. I invited you as a repo collaborator so I could add you as a reviewer. |
ipspace
added a commit
that referenced
this pull request
Jul 29, 2026
Contributor
|
Yes please, that is what I was looking for. Thanks alot |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds technology-aware tunnel interface naming by introducing a helper that selects a device interface-name template based on per-interface “mode” (e.g., WireGuard vs GRE), and applies it to virtual interface creation (with FRR as the first concrete example).
Changes:
- Added
get_device_ifname()to select an interface-name template from either a string or a mode-keyed mapping (withdefaultfallback). - Switched virtual interface naming to use the new selector (affecting tunnels in particular).
- Updated FRR device defaults and adjusted WireGuard coverage expectations to reflect
wg*naming.
Reviewed changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/coverage/expected/wg-unique-ports.yml | Updates expected WireGuard tunnel interface names to wg0/wg1 for FRR. |
| tests/coverage/expected/wg-listen-port.yml | Updates expected WireGuard tunnel interface name to wg0 for FRR. |
| netsim/devices/frr.yml | Makes tunnel_interface_name mode-specific (gre, wireguard, default). |
| netsim/augment/links.py | Introduces get_device_ifname() and uses it for virtual interface naming. |
Comment on lines
+372
to
+376
| iff = devices.get_device_attribute(node,f'{devtype}_interface_name',defaults) | ||
| if not iff or isinstance(iff,str): # Missing interface name format, or a simple string | ||
| return iff # Just return it | ||
| if not isinstance(iff,Box): # Otherwise, it must be a box -- complain very loudly if needed | ||
| log.fatal(f'defaults.devices.{node.device}.{devtype}_interface_name has invalid value (expected string or dict), aborting') |
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.
Some devices (Junos, RouterOS7, OpenBSD) use different interface names for different tunnel types. This commit adds a generic "select interface name based on interface technology" function, and uses FRR as an implementation example.