netfilter.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Correct way of setting the TCP max segment sizes for IPv4 and IPv6?
@ 2024-04-08 19:24 William N.
  2024-04-09 18:43 ` Slavko
  0 siblings, 1 reply; 7+ messages in thread
From: William N. @ 2024-04-08 19:24 UTC (permalink / raw)
  To: netfilter

Hi,

I have been looking at some firewall hardening examples which suggest
setting the TCP maximum segment sizes but they do it only for IPv4.

Looking at RFC 9293, §3.7.1, I see those MSS values are different for
IPv6, so I am approaching this like this:

chain ingress {
	type filter hook ingress device "eth0" priority -500; policy accept;
	
	# ...

	# IPv4
	meta protocol ip tcp flags syn tcp option maxseg size < 536 drop
	# IPv6
	meta protocol ip6 tcp flags syn tcp option maxseg size < 1220 drop
}

My questions:

1. Is this the correct way to do this?
2. Is it good to do this (setting TCP MSS) at all?
3. Which is better and why:

meta protocol ip tcp flags syn tcp option maxseg size < 536 drop

or

meta protocol ip tcp flags syn tcp option maxseg size 1-535 drop

4. How do I test if this works correctly? (Debian 12 here)

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-04-10 18:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-08 19:24 Correct way of setting the TCP max segment sizes for IPv4 and IPv6? William N.
2024-04-09 18:43 ` Slavko
2024-04-09 19:33   ` William N.
2024-04-09 22:04     ` Slavko
2024-04-10 15:48       ` William N.
2024-04-10 18:02         ` Slavko
2024-04-10 18:24           ` William N.

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).