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

Truncate source and dest interface at the beginning #177

Merged
merged 1 commit into from
Jul 20, 2022

Conversation

ak-1
Copy link
Contributor

@ak-1 ak-1 commented Jul 19, 2022

Truncate source and dest interface at the beginning to make name clashes less likely.
This solves an issue where different vpn configurations result in the same device name.

@jamesmcm
Copy link
Owner

Thanks, it looks good!

It could even be worth calculating a checksum here if this is such an issue (like we do for custom VPN provider files), since it's no longer going to be easy to read or understand the substring anyway.

@alexmo1997
Copy link

This change is a bit problematic for me. In my firewall (nftables) configuration, I disallow forwards by default and used to allow accept vopono* interfaces, but that is now not possible anymore.

@ak-1
Copy link
Contributor Author

ak-1 commented Mar 22, 2023

Maybe we could define a two or three letter code for everything. That could be enough to not exceed the name length limit and still have some legibility and names that can still be useful for firewall rules and such

@jamesmcm
Copy link
Owner

Yeah, that seems like a good trade-off.

@ak-1 ak-1 deleted the upstream branch March 23, 2023 12:50
@ak-1
Copy link
Contributor Author

ak-1 commented Mar 24, 2023

So there are 15 ascii chars available for the interface names.
Here is one way to allocate those chars:

123456789012345
vo_PN_CNFNAME_D
  • vo_ would be a fixed prefix for all interfaces created by vopono.
  • PN would be a two character code for the provider.
  • CNFNAME are seven chars available for the config/server name.
  • D is s or d for source and destination of the veth pair.

For config names longer than seven chars we could still use a seven char checksum instead.

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.

None yet

3 participants