Skip to content

Avoid gretap fragmentation with nftables on bridge

Michael Braun netfilter-devel 1 version Applied

Status from this message: Applied, thanks.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 2 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/3nftables: add frag-needed (ipv4) to reject optionsdoc/data-types.txt src/datatype.c+3 -00 replies
2/3nftables: enable reject with 802.1qsrc/evaluate.c+1 -10 replies
3/3netfilter: enable reject with bridge vlannet/bridge/netfilter/nft_reject_bridge.c+6 -01 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] Avoid gretap fragmentation with nftables on bridge

Hi,

I have a bridge with connects an gretap tunnel with some ethernet lan. On the gretap device I use ignore-df to avoid packets being lost without icmp reject to the sender of the bridged packet.

Still I want to avoid packet fragmentation with the gretap packets. So I though about adding an nftables rule like this:

nft insert rule bridge filter FORWARD \
ip protocol tcp \
ip length > 1400 \
ip frag-off & 0x4000 != 0 \
reject with icmp type frag-needed

This would reject all tcp packets with ip dont-fragment bit set that are bigger than some threshold (here 1400 bytes). The sender would then receive ICMP unreachable - fragmentation needed and reduce its packet size (as defined with PMTU).

This patch series
1. adds frag-needed ipv4 flag to nftables
2. enables to use this with bridge vlans.

For IPv6, this would need ICMPV6_PKT_TOOBIG instead of ICMPV6_DEST_UNREACH in nft_reject_br_send_v6_unreach, so this is not part of this series.

Regards,
M. Braun

Signature · 1 line
2.20.1