T8242: interfaces add bidirectional support for interface adjust-mss#4973
T8242: interfaces add bidirectional support for interface adjust-mss#4973jd82k wants to merge 1 commit intovyos:currentfrom
Conversation
|
👍 |
|
Please help me change to PR title. I don't know why it doesn't meet the requirements. |
e288e3f to
0f0f1ca
Compare
|
Ingress would need to be applied to a new chain with a Default values are canonically not done in code, but rather using the |
Thanks for the review. I have addressed both points in the latest update:
|
I want to note that I'm not a maintainer, so these are just my opinions and may not necessarily mate up with the actual VyOS maintainers.
|
Thanks for the feedback. I agree that MSS tuning can be affected by multiple encapsulation layers (VXLAN/GRE/IPIP/IPsec), and a static guess is not universally correct. That said, for interface-scoped MSS adjustment, there is still practical value in deriving ingress MSS from the interface MTU when clamp-mss-to-pmtu is requested: A common real-world case is tunnel interfaces (for example WireGuard), where operators explicitly set interface MTU (e.g. 1420). If maintainers still prefer strict behavior, I can switch to validation that rejects clamp-mss-to-pmtu for inbound/both and requires an explicit numeric MSS instead. |
PMTUD has a well-defined, RFC based behavior, so I think trying to create a non-standards based behavior when configuring PMTUD is ultimately wrong. That's not to say you couldn't do something like I think |
7ab86f0 to
98f9102
Compare
|
I reverted the ingress implementation back to the existing postrouting MSS chain. Reasoning:
What remains:
So this change prioritizes semantic correctness, predictability, and lower maintenance risk. |
|
|
I have read the CLA Document and I hereby sign the CLA |
Thanks for the clarification. You are correct that My intent here is:
For traffic terminated on the router (
So for local services, the router TCP stack already advertises an MSS consistent with its own MTU/path, and the peer will limit segment size accordingly. So the behavior difference is intentional: ingress ( |
That isn't quite accurate. It will advertise an MSS consistent with it's MTU, but the path relies on PMTUD working end-to-end, where it's not uncommon for unreachables being blocked somewhere along the path (especially with many security requirements/guides recommending them to be disabled). One major issue with ignoring local traffic is if someone wanted a single touch point to clamp BGP sessions. They would be left troubleshooting why it's not working. I don't personally see any sane reason to not keep parity with the existing behavior (outbound), when adding the new behavior (inbound). Do you have a specific reason you don't want to keep parity in the behaviors? |
Add a new optional CLI leaf `adjust-mss-direction` under both `interfaces ... ip` and `interfaces ... ipv6`. Supported values: - outbound (default, existing behavior) - inbound - both Behavior: - outbound: always installs MSS rewrite rules in postrouting using `oifname` - inbound: - `clamp-mss-to-pmtu`: installs in postrouting using `iifname` - numeric MSS: installs in prerouting using `iifname` (so input traffic is covered) - both: installs outbound + inbound rules according to the logic above Implementation details: - Extend MSS rule generation in `Interface` to be direction- and mode-aware (match key + nft chain selection). - Add prerouting MSS chains (`VYOS_TCP_MSS_PREROUTING`) for IPv4/IPv6 raw tables. - Keep backward compatibility by treating missing direction as `outbound`. - Improve MSS cleanup to remove stale interface rules from both postrouting and prerouting chains, for both `oifname` and `iifname` matches. - Wire direction config into the IPv4 and IPv6 interface update paths. - Extend interface smoketests to validate: - direction behavior (`outbound` / `inbound` / `both`) - correct chain placement (postrouting vs prerouting) - both IPv4 and IPv6 MSS rule generation.
Thanks, this is a fair point, especially for local services (for example BGP sessions) where operators expect a single control point. I’ve updated the implementation accordingly:
So the behavior is now:
This keeps backward compatibility for clamp while making fixed-MSS inbound behavior useful for local services. |
|
CI integration ❌ failed! Details
|
|
Please review this PR. @c-po @dmbaturin @sarthurdev @sever-sever |
|
Please assign this PR to me. Thanks! |
sarthurdev
left a comment
There was a problem hiding this comment.
Much improved approach, code looks good, adds smoketest coverage and passes.
Change summary
Add a new optional CLI leaf
adjust-mss-directionunder bothinterfaces ... ipandinterfaces ... ipv6.Supported values:
Behavior:
oifnameclamp-mss-to-pmtu: installs in postrouting usingiifnameiifname(so input traffic is covered)Implementation details:
Interfaceto be direction- and mode-aware(match key + nft chain selection).
VYOS_TCP_MSS_PREROUTING) for IPv4/IPv6 raw tables.outbound.prerouting chains, for both
oifnameandiifnamematches.outbound/inbound/both)Types of changes
Related Task(s)
https://vyos.dev/T8242
Related PR(s)
How to test / Smoketest result
Checklist: