Skip to content

Interface MTU has to be equal or less then 32767 (2^15-1), but it should be 2^16-1 #2354

@ghost

Description

Environment

  • Python version: 3.5.2
  • NetBox version: 2.3.8-dev

Steps to Reproduce

Edit an interface of a device, and set an MTU of i.e. 65536.

Expected Behavior

Accept an 16-bit value, or at least 16-bit minus 1.

Observed Behavior

Netbox threw an error: "Ensure this value is less than or equal to 32767."

Additional notes

I'm somehow confused that Linux has an MTU for the loopback interface lo a value of 65536, seen by

# cat /sys/class/net/lo/mtu
65536
# uname -r
4.17.0-1-amd64

but regarding to https://tools.ietf.org/html/rfc791 the maximum value of MTU is just 65535 (2^16-1).

The value of 2^16 comes directly from https://github.com/torvalds/linux/blob/master/drivers/net/loopback.c#L176

	dev->mtu	= 64 * 1024;

So one thing is that the max. MTU in netbox is not as big as the RFC says it can be; and why David and Eric had chosen 2^16 instead of 2^16-1 is another :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions