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

Configurable MTU for IPv6 and other non-1500 configurations #102

Closed
mk-fg opened this issue May 31, 2021 · 2 comments
Closed

Configurable MTU for IPv6 and other non-1500 configurations #102

mk-fg opened this issue May 31, 2021 · 2 comments

Comments

@mk-fg
Copy link

mk-fg commented May 31, 2021

Hi,

Current shared/src/wg.rs code has ip link set mtu 1420 ... hardcoded, which is presumably derived from 1420 B payload + 54 B wg header + 20 B IPv4 header, and sums up to just under 1500 B, which is a typical MTU you'd see on eth0 interface.

Such calculation of course breaks down with IPv6, where header is 40B, causing fragmentation on 1500B ifaces.
This might be somewhat related to #15.

But more generally, if innernet is used over e.g. batman-adv mesh (which makes sense to use with such overlay network), MTU can be something like 1450 there anyway, so switching 1420 -> 1400 in the code won't cover this use-case like configurable MTU value might.

Given that "inn up" operation creates interface, sets mtu and immediately tries to contact innernet-server over it, I think such mtu adjustment might need to be done by innernet tool itself, as doing that after it runs or from some netlink event-monitor might be too late or at least racy, and tool will fail if mtu prevents it talking to server for long enough.

Thanks!

@kbknapp
Copy link
Contributor

kbknapp commented Jun 3, 2021

Adding to this, a long term goal could be to do something like PMTU discovery dynamically.

@mcginty
Copy link
Collaborator

mcginty commented Jun 14, 2021

Sorry for the late reply! Just pushed a change to make MTU configurable via the CLI, ex. inn --mtu 1350 up foo. Will also add some logic in to set the default MTU to 1400 if the network's CIDR range is IPv6.

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

No branches or pull requests

3 participants