netfilter.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Combining/compacting 2 rules into 1
@ 2024-04-16 17:47 William N.
  2024-04-16 18:54 ` Kerin Millar
  0 siblings, 1 reply; 19+ messages in thread
From: William N. @ 2024-04-16 17:47 UTC (permalink / raw)
  To: netfilter

Hello,

I am trying to "compact" the following rules:

table netdev filter {
	chain ingress {
		type filter hook ingress device "eth0" priority -500;
		# ...

		meta protocol ip \
			tcp flags syn \
			tcp option maxseg size lt 536 \
			log prefix "TCP MSS: " \
			counter packets 0 bytes 0 \
			drop

		meta protocol ip6 \
			tcp flags syn \
			tcp option maxseg size lt 1220 \
			log prefix "TCP MSS: " \
			counter packets 0 bytes 0 \
			drop
	}
}

into something like:

table netdev filter {
	chain ingress {
		type filter hook ingress device "eth0" priority -500;
		# ...

		meta protocol tcp option maxseg size map lt {
				ip : 536,
				ip6 : 1220
			} \
			tcp flags syn \
			log prefix "TCP MSS: " \
			counter packets 0 bytes 0 \
			drop
	}
}

but I am getting errors, as my syntax is obviously wrong. The first error is:

Error: syntax error, unexpected size, expecting newline or semicolon
                meta protocol tcp option maxseg size map lt {
                                                ^^^^

What is the correct syntax for this?

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

end of thread, other threads:[~2024-04-20 19:20 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-16 17:47 Combining/compacting 2 rules into 1 William N.
2024-04-16 18:54 ` Kerin Millar
2024-04-16 19:12   ` William N.
2024-04-16 20:08     ` Kerin Millar
2024-04-17  8:29       ` William N.
2024-04-17  8:54         ` Slavko
2024-04-17  9:16           ` Kerin Millar
2024-04-17  9:23             ` Slavko
2024-04-17  9:50               ` Kerin Millar
2024-04-17 14:12                 ` William N.
2024-04-17 15:30                   ` Slavko
2024-04-19 10:55   ` William N.
2024-04-19 11:01     ` Serhii
2024-04-19 11:18       ` William N.
2024-04-19 12:54       ` William N.
2024-04-19 14:31         ` Serhii
2024-04-20  2:36     ` Kerin Millar
2024-04-20  8:51       ` William N.
2024-04-20 19:19         ` Kerin Millar

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).