All of lore.kernel.org
 help / color / mirror / Atom feed
From: "William N." <netfilter@riseup.net>
To: netfilter@vger.kernel.org
Subject: Correct way of setting the TCP max segment sizes for IPv4 and IPv6?
Date: Mon, 8 Apr 2024 19:24:41 -0000	[thread overview]
Message-ID: <20240408192441.657ac116@localhost> (raw)

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)

             reply	other threads:[~2024-04-08 19:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-08 19:24 William N. [this message]
2024-04-09 18:43 ` Correct way of setting the TCP max segment sizes for IPv4 and IPv6? 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.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240408192441.657ac116@localhost \
    --to=netfilter@riseup.net \
    --cc=netfilter@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.