Skip to content

Technology-specific tunnel interface names - #3716

Merged
ipspace merged 2 commits into
devfrom
tun-ifname
Jul 30, 2026
Merged

Technology-specific tunnel interface names#3716
ipspace merged 2 commits into
devfrom
tun-ifname

Conversation

@ipspace

@ipspace ipspace commented Jul 29, 2026

Copy link
Copy Markdown
Owner

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.

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.
@ipspace
ipspace requested a review from DanPartelly July 29, 2026 14:10
@ipspace

ipspace commented Jul 29, 2026

Copy link
Copy Markdown
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
@snuffy22

Copy link
Copy Markdown
Contributor

Yes please, that is what I was looking for.

Thanks alot

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 (with default fallback).
  • 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 thread netsim/augment/links.py
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')
@ipspace
ipspace merged commit 7a4806d into dev Jul 30, 2026
12 checks passed
@ipspace
ipspace deleted the tun-ifname branch July 30, 2026 09: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.

3 participants