Problem
Several initial-configuration templates calculate device-facing physical MTU from the normalized IP MTU using inline arithmetic and magic constants:
{{ mtu + 14 }}
{{ [l.mtu + 14, 1500]|max }}
{{ l.mtu + 32 }}
The calculations currently appear in SR Linux, Dell OS10, and IOS XR templates. SR Linux also defines the same 14-byte overhead in Python for MTU validation, so rendering and validation duplicate one platform rule and could drift apart. Junos already provides a useful precedent by calculating _junos_mtu_with_headers in device quirk code.
Suggested enhancement
Move physical/frame MTU calculation into device transformation or quirk code, using named constants and producing render-ready node and interface attributes. Reuse those derived values for both validation and rendering.
Acceptance criteria
- SR Linux, Dell OS10, and IOS XR physical MTU values are calculated in Python.
- Named platform constants replace template magic numbers.
- SR Linux validation and rendering use the same derived value or calculation helper.
- Existing generated configurations remain unchanged.
- Initial configuration templates no longer add MTU overhead inline.
- Tests cover node-level, interface-level, minimum-frame-size, and platform-limit behavior.
Problem
Several initial-configuration templates calculate device-facing physical MTU from the normalized IP MTU using inline arithmetic and magic constants:
The calculations currently appear in SR Linux, Dell OS10, and IOS XR templates. SR Linux also defines the same 14-byte overhead in Python for MTU validation, so rendering and validation duplicate one platform rule and could drift apart. Junos already provides a useful precedent by calculating
_junos_mtu_with_headersin device quirk code.Suggested enhancement
Move physical/frame MTU calculation into device transformation or quirk code, using named constants and producing render-ready node and interface attributes. Reuse those derived values for both validation and rendering.
Acceptance criteria