Skip to contentSkip to conversation

iptables manpage updates

PATCH New Jan Engelhardt 2 participants 9 messages Nov 13, 2023 – Nov 15, 2023 netfilter

lore
Share & tools
lore
#0 lore raw

The following changes since commit 3be599b62869f2437f499e2386008d73b8c2e71b:

extensions: libarpt_standard.t: Add a rule with builtin option masks (2023-11-09 15:55:33 +0100)

are available in the Git repository at:

https://git.inai.de/iptables master

for you to fetch changes up to 4b0c168a7b50032ba64f75565f73340fc447bfab:

man: more backslash-encoding of characters (2023-11-13 11:28:19 +0100)

----------------------------------------------------------------
Jan Engelhardt (7):
man: consistent use of \(em in Name sections
man: remove lone .nh command
man: repeal manual hyphenation
man: stop putting non-terminals in italic
man: copy synopsis markup from iptables.8 to arptables-nft.8
man: limit targets for -P option synopsis
man: more backslash-encoding of characters

 extensions/libxt_CONNMARK.man    |   4 +-
 extensions/libxt_NFLOG.man       |   2 +-
 iptables/arptables-nft-restore.8 |   4 +-
 iptables/arptables-nft-save.8    |   2 +-
 iptables/arptables-nft.8         | 154 +++++++++++++++++++++------------------
 iptables/ebtables-nft.8          |   4 +-
 iptables/iptables-apply.8.in     |   4 +-
 iptables/iptables.8.in           |   8 +-
 iptables/xtables-nft.8           |  16 ++--
 iptables/xtables-translate.8     |  32 ++++----
 utils/nfbpf_compile.8.in         |   2 +-
 utils/nfnl_osf.8.in              |   2 +-
 12 files changed, 123 insertions(+), 111 deletions(-)
#1 lore raw

PATCH 1/7 man: consistent use of \(em in Name sections

---
 iptables/arptables-nft-restore.8 | 2 +-
 iptables/arptables-nft-save.8    | 2 +-
 iptables/arptables-nft.8         | 2 +-
 iptables/ebtables-nft.8          | 2 +-
 iptables/iptables-apply.8.in     | 2 +-
 utils/nfbpf_compile.8.in         | 2 +-
 utils/nfnl_osf.8.in              | 2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)
iptables/arptables-nft-restore.8 +1 -1
index 09d9082c..0e525fe3 100644
@@ -20,7 +20,7 @@
 .\"
 .\"
 .SH NAME
-arptables-restore \- Restore ARP Tables (nft-based)
+arptables-restore \(em Restore ARP Tables (nft-based)
 .SH SYNOPSIS
 \fBarptables\-restore
 .SH DESCRIPTION
iptables/arptables-nft-save.8 +1 -1
index 905e5985..e9171d5d 100644
@@ -20,7 +20,7 @@
 .\"
 .\"
 .SH NAME
-arptables-save \- dump arptables rules to stdout (nft-based)
+arptables-save \(em dump arptables rules to stdout (nft-based)
 .SH SYNOPSIS
 \fBarptables\-save\fP [\fB\-M\fP \fImodprobe\fP] [\fB\-c\fP]
 .P
iptables/arptables-nft.8 +1 -1
index ea31e084..659a2542 100644
@@ -22,7 +22,7 @@
 .\"
 .\"
 .SH NAME
-arptables \- ARP table administration (nft-based)
+arptables \(em ARP table administration (nft-based)
 .SH SYNOPSIS
 .BR "arptables " [ "-t table" ] " -" [ AD ] " chain rule-specification " [ options ]
 .br
iptables/ebtables-nft.8 +1 -1
index ca12e2df..9fc845a1 100644
@@ -24,7 +24,7 @@
 .\"     
 .\"
 .SH NAME
-ebtables \- Ethernet bridge frame table administration (nft-based)
+ebtables \(em Ethernet bridge frame table administration (nft-based)
 .SH SYNOPSIS
 .BR "ebtables " [ -t " table ] " - [ ACDI "] chain rule specification [match extensions] [watcher extensions] target"
 .br
iptables/iptables-apply.8.in +1 -1
index f0ed4e5f..5485199c 100644
@@ -6,7 +6,7 @@
 .\" disable hyphenation
 .nh
 .SH NAME
-iptables-apply \- a safer way to update iptables remotely
+iptables-apply \(em a safer way to update iptables remotely
 .SH SYNOPSIS
 \fBiptables\-apply\fP [\-\fBhV\fP] [\fB-t\fP \fItimeout\fP] [\fB-w\fP \fIsavefile\fP] {[\fIrulesfile]|-c [runcmd]}\fP
 .SH "DESCRIPTION"
utils/nfbpf_compile.8.in +1 -1
index d02979a5..b19d4fbb 100644
@@ -1,7 +1,7 @@
 .TH NFBPF_COMPILE 8 "" "@PACKAGE_STRING@" "@PACKAGE_STRING@"
 
 .SH NAME
-nfbpf_compile \- generate bytecode for use with xt_bpf
+nfbpf_compile \(em generate bytecode for use with xt_bpf
 .SH SYNOPSIS
 
 .ad l
utils/nfnl_osf.8.in +1 -1
index 140b5c3f..7ade705a 100644
@@ -1,7 +1,7 @@
 .TH NFNL_OSF 8 "" "@PACKAGE_STRING@" "@PACKAGE_STRING@"
 
 .SH NAME
-nfnl_osf \- OS fingerprint loader utility
+nfnl_osf \(em OS fingerprint loader utility
 .SH SYNOPSIS
 
 .ad l
Signature · 1 line
2.42.1
#2 lore raw

PATCH 2/7 man: remove lone .nh command

In reply to Jan Engelhardt

No other manpage files use .nh, and I cannot see a reason iptables-apply would exceptionally need it.

---
 iptables/iptables-apply.8.in | 2 --
 1 file changed, 2 deletions(-)
iptables/iptables-apply.8.in +0 -2
index 5485199c..33fd79fe 100644
@@ -3,8 +3,6 @@
 .\"      Date: May 10, 2010
 .\"
 .TH IPTABLES\-APPLY 8 "" "@PACKAGE_STRING@" "@PACKAGE_STRING@"
-.\" disable hyphenation
-.nh
 .SH NAME
 iptables-apply \(em a safer way to update iptables remotely
 .SH SYNOPSIS
Signature · 1 line
2.42.1
#3 lore raw

PATCH 3/7 man: repeal manual hyphenation

In reply to Jan Engelhardt
---
 iptables/arptables-nft.8 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
iptables/arptables-nft.8 +2 -2
index 659a2542..84775a86 100644
@@ -303,8 +303,8 @@ Mangles Destination MAC Address to given value.
 Target of ARP mangle operation
 .BR "" ( DROP ", " CONTINUE " or " ACCEPT " -- default is " ACCEPT ).
 .SS CLASSIFY
-This  module  allows you to set the skb->priority value (and thus clas-
-sify the packet into a specific CBQ class).
+This module allows you to set the skb->priority value (and thus
+classify the packet into a specific CBQ class).
 
 .TP
 .BR "--set-class major:minor"
Signature · 1 line
2.42.1
#4 lore raw

PATCH 4/7 man: stop putting non-terminals in italic

In reply to Jan Engelhardt
---
 iptables/iptables.8.in | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
iptables/iptables.8.in +3 -3
index ecaa5553..90417e89 100644
@@ -49,11 +49,11 @@ iptables/ip6tables \(em administration tool for IPv4/IPv6 packet filtering and N
 .PP
 \fBiptables\fP [\fB\-t\fP \fItable\fP] \fB\-E\fP \fIold-chain-name new-chain-name\fP
 .PP
-rule-specification = [\fImatches...\fP] [\fItarget\fP]
+rule-specification := [matches...] [target]
 .PP
-match = \fB\-m\fP \fImatchname\fP [\fIper-match-options\fP]
+match := \fB\-m\fP \fImatchname\fP [per-match-options]
 .PP
-target = \fB\-j\fP \fItargetname\fP [\fIper\-target\-options\fP]
+target := \fB\-j\fP \fItargetname\fP [per-target-options]
 .SH DESCRIPTION
 \fBIptables\fP and \fBip6tables\fP are used to set up, maintain, and inspect the
 tables of IPv4 and IPv6 packet
Signature · 1 line
2.42.1
#5 lore raw

PATCH 5/7 man: copy synopsis markup from iptables.8 to arptables-nft.8

In reply to Jan Engelhardt
---
 iptables/arptables-nft.8 | 42 ++++++++++++++++++++++++++--------------
 1 file changed, 28 insertions(+), 14 deletions(-)
iptables/arptables-nft.8 +28 -14
index 84775a86..8b403ee8 100644
@@ -24,20 +24,34 @@
 .SH NAME
 arptables \(em ARP table administration (nft-based)
 .SH SYNOPSIS
-.BR "arptables " [ "-t table" ] " -" [ AD ] " chain rule-specification " [ options ]
-.br
-.BR "arptables " [ "-t table" ] " -" [ RI ] " chain rulenum rule-specification " [ options ]
-.br
-.BR "arptables " [ "-t table" ] " -D chain rulenum " [ options ]
-.br
-.BR "arptables " [ "-t table" ] " -" [ "LFZ" ] " " [ chain ] " " [ options ]
-.br
-.BR "arptables " [ "-t table" ] " -" [ "NX" ] " chain"
-.br
-.BR "arptables " [ "-t table" ] " -E old-chain-name new-chain-name"
-.br
-.BR "arptables " [ "-t table" ] " -P chain target " [ options ]
-
+\fBarptables\fP [\fB\-t\fP \fItable\fP] {\fB\-A|\-D\fP} \fIchain\fP
+\fIrule-specification\fP [options...]
+.PP
+\fBarptables\fP [\fB\-t\fP \fItable\fP] \fB\-I\fP \fIchain\fP [\fIrulenum\fP]
+\fIrule-specification\fP
+.PP
+\fBarptables\fP [\fB\-t\fP \fItable\fP] \fB\-R\fP \fIchain rulenum
+rule-specification\fP
+.PP
+\fBarptables\fP [\fB\-t\fP \fItable\fP] \fB\-D\fP \fIchain rulenum\fP
+.PP
+\fBarptables\fP [\fB\-t\fP \fItable\fP] {\fB\-F\fP|\fB\-L\fP|\fB\-Z\fP}
+[\fIchain\fP [\fIrulenum\fP]] [\fIoptions...\fP]
+.PP
+\fBarptables\fP [\fB\-t\fP \fItable\fP] \fB\-N\fP \fIchain\fP
+.PP
+\fBarptables\fP [\fB\-t\fP \fItable\fP] \fB\-X\fP [\fIchain\fP]
+.PP
+\fBarptables\fP [\fB\-t\fP \fItable\fP] \fB\-P\fP \fIchain target\fP
+.PP
+\fBarptables\fP [\fB\-t\fP \fItable\fP] \fB\-E\fP \fIold-chain-name
+new-chain-name\fP
+.PP
+rule-specification := [matches...] [target]
+.PP
+match := \fB\-m\fP \fImatchname\fP [per-match-options]
+.PP
+target := \fB\-j\fP \fItargetname\fP [per-target-options]
 .SH DESCRIPTION
 .B arptables
 is a user space tool, it is used to set up and maintain the
Signature · 1 line
2.42.1
#6 lore raw

PATCH 6/7 man: limit targets for -P option synopsis

In reply to Jan Engelhardt

Do not suggest that -P could be used with arbitrary targets.

---
 iptables/arptables-nft.8 | 2 +-
 iptables/iptables.8.in   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
iptables/arptables-nft.8 +1 -1
index 8b403ee8..444b0015 100644
@@ -42,7 +42,7 @@ rule-specification\fP
 .PP
 \fBarptables\fP [\fB\-t\fP \fItable\fP] \fB\-X\fP [\fIchain\fP]
 .PP
-\fBarptables\fP [\fB\-t\fP \fItable\fP] \fB\-P\fP \fIchain target\fP
+\fBarptables\fP [\fB\-t\fP \fItable\fP] \fB\-P\fP \fIchain policy\fP
 .PP
 \fBarptables\fP [\fB\-t\fP \fItable\fP] \fB\-E\fP \fIold-chain-name
 new-chain-name\fP
iptables/iptables.8.in +1 -1
index 90417e89..21fb891d 100644
@@ -45,7 +45,7 @@ iptables/ip6tables \(em administration tool for IPv4/IPv6 packet filtering and N
 .PP
 \fBiptables\fP [\fB\-t\fP \fItable\fP] \fB\-X\fP [\fIchain\fP]
 .PP
-\fBiptables\fP [\fB\-t\fP \fItable\fP] \fB\-P\fP \fIchain target\fP
+\fBiptables\fP [\fB\-t\fP \fItable\fP] \fB\-P\fP \fIchain policy\fP
 .PP
 \fBiptables\fP [\fB\-t\fP \fItable\fP] \fB\-E\fP \fIold-chain-name new-chain-name\fP
 .PP
Signature · 1 line
2.42.1
#7 lore raw

PATCH 7/7 man: more backslash-encoding of characters

In reply to Jan Engelhardt

"-" is the dash, "\-" is minus as we know, but groff lists some more
characters: "^" is "modifier circumflex" and "~" is "modifier tilde", which, too, need to be escaped for our use.

---
 extensions/libxt_CONNMARK.man    |   4 +-
 extensions/libxt_NFLOG.man       |   2 +-
 iptables/arptables-nft-restore.8 |   2 +-
 iptables/arptables-nft.8         | 108 +++++++++++++++----------------
 iptables/ebtables-nft.8          |   2 +-
 iptables/xtables-nft.8           |  16 ++---
 iptables/xtables-translate.8     |  32 ++++-----
 7 files changed, 83 insertions(+), 83 deletions(-)
extensions/libxt_CONNMARK.man +2 -2
index 93179239..742df11d 100644
@@ -8,7 +8,7 @@ Zero out the bits given by \fImask\fP and XOR \fIvalue\fP into the ctmark.
 Copy the packet mark (nfmark) to the connection mark (ctmark) using the given
 masks. The new nfmark value is determined as follows:
 .IP
-ctmark = (ctmark & ~ctmask) ^ (nfmark & nfmask)
+ctmark = (ctmark & \~ctmask) \^ (nfmark & nfmask)
 .IP
 i.e. \fIctmask\fP defines what bits to clear and \fInfmask\fP what bits of the
 nfmark to XOR into the ctmark. \fIctmask\fP and \fInfmask\fP default to
@@ -18,7 +18,7 @@ nfmark to XOR into the ctmark. \fIctmask\fP and \fInfmask\fP default to
 Copy the connection mark (ctmark) to the packet mark (nfmark) using the given
 masks. The new ctmark value is determined as follows:
 .IP
-nfmark = (nfmark & ~\fInfmask\fP) ^ (ctmark & \fIctmask\fP);
+nfmark = (nfmark & \~\fInfmask\fP) \^ (ctmark & \fIctmask\fP);
 .IP
 i.e. \fInfmask\fP defines what bits to clear and \fIctmask\fP what bits of the
 ctmark to XOR into the nfmark. \fIctmask\fP and \fInfmask\fP default to
extensions/libxt_NFLOG.man +1 -1
index 361311b2..43629893 100644
@@ -9,7 +9,7 @@ may subscribe to the group to receive the packets. Like LOG, this is a
 non-terminating target, i.e. rule traversal continues at the next rule.
 .TP
 \fB\-\-nflog\-group\fP \fInlgroup\fP
-The netlink group (0\(en2^16\-1) to which packets are (only applicable for
+The netlink group (0\(en2\^16\-1) to which packets are (only applicable for
 nfnetlink_log). The default value is 0.
 .TP
 \fB\-\-nflog\-prefix\fP \fIprefix\fP
iptables/arptables-nft-restore.8 +1 -1
index 0e525fe3..596ca1c9 100644
@@ -22,7 +22,7 @@
 .SH NAME
 arptables-restore \(em Restore ARP Tables (nft-based)
 .SH SYNOPSIS
-\fBarptables\-restore
+\fBarptables\-restore\fP
 .SH DESCRIPTION
 .PP
 .B arptables-restore
iptables/arptables-nft.8 +54 -54

271 lines not on this page · raw message

iptables/ebtables-nft.8 +1 -1
index 9fc845a1..641008cf 100644
@@ -858,7 +858,7 @@ Log with the default logging options
 .TP
 .B --nflog-group "\fInlgroup\fP"
 .br
-The netlink group (1\(en2^32\-1) to which packets are (only applicable for
+The netlink group (1\(en2\^32\-1) to which packets are (only applicable for
 nfnetlink_log). The default value is 1.
 .TP
 .B --nflog-prefix "\fIprefix\fP"
iptables/xtables-nft.8 +8 -8
index 702bf954..3ced29ca 100644
@@ -105,15 +105,15 @@ One basic example is creating the skeleton ruleset in nf_tables from the
 xtables-nft tools, in a fresh machine:
 
 .nf
-	root@machine:~# iptables\-nft \-L
+	root@machine:\~# iptables\-nft \-L
 	[...]
-	root@machine:~# ip6tables\-nft \-L
+	root@machine:\~# ip6tables\-nft \-L
 	[...]
-	root@machine:~# arptables\-nft \-L
+	root@machine:\~# arptables\-nft \-L
 	[...]
-	root@machine:~# ebtables\-nft \-L
+	root@machine:\~# ebtables\-nft \-L
 	[...]
-	root@machine:~# nft list ruleset
+	root@machine:\~# nft list ruleset
 	table ip filter {
 		chain INPUT {
 			type filter hook input priority 0; policy accept;
@@ -175,12 +175,12 @@ To migrate your complete filter ruleset, in the case of \fBiptables(8)\fP,
 you would use:
 
 .nf
-	root@machine:~# iptables\-legacy\-save > myruleset # reads from x_tables
-	root@machine:~# iptables\-nft\-restore myruleset   # writes to nf_tables
+	root@machine:\~# iptables\-legacy\-save > myruleset # reads from x_tables
+	root@machine:\~# iptables\-nft\-restore myruleset   # writes to nf_tables
 .fi
 or
 .nf
-	root@machine:~# iptables\-legacy\-save | iptables-translate-restore | less
+	root@machine:\~# iptables\-legacy\-save | iptables\-translate\-restore | less
 .fi
 
 to see how rules would look like in the nft
iptables/xtables-translate.8 +16 -16
index a048e8c9..ba16c525 100644
@@ -38,15 +38,15 @@ ruleset from \fBiptables(8)\fP, \fBip6tables(8)\fP and \fBebtables(8)\fP to
 The available commands are:
 
 .IP \[bu] 2
-iptables-translate
+iptables\-translate
 .IP \[bu]
-iptables-restore-translate
+iptables\-restore\-translate
 .IP \[bu] 2
-ip6tables-translate
+ip6tables\-translate
 .IP \[bu]
-ip6tables-restore-translate
+ip6tables\-restore\-translate
 .IP \[bu] 2
-ebtables-translate
+ebtables\-translate
 
 .SH USAGE
 They take as input the original
@@ -69,38 +69,38 @@ Basic operation examples.
 Single command translation:
 
 .nf
-root@machine:~# iptables-translate -A INPUT -p tcp --dport 22 -m conntrack --ctstate NEW -j ACCEPT
+root@machine:\~# iptables\-translate \-A INPUT \-p tcp \-\-dport 22 \-m conntrack \-\-ctstate NEW \-j ACCEPT
 nft add rule ip filter INPUT tcp dport 22 ct state new counter accept
 
-root@machine:~# ip6tables-translate -A FORWARD -i eth0 -o eth3 -p udp -m multiport --dports 111,222 -j ACCEPT
+root@machine:\~# ip6tables\-translate \-A FORWARD \-i eth0 \-o eth3 \-p udp \-m multiport \-\-dports 111,222 \-j ACCEPT
 nft add rule ip6 filter FORWARD iifname eth0 oifname eth3 meta l4proto udp udp dport { 111,222} counter accept
 .fi
 
 Whole ruleset translation:
 
 .nf
-root@machine:~# iptables-save > save.txt
-root@machine:~# cat save.txt
-# Generated by iptables-save v1.6.0 on Sat Dec 24 14:26:40 2016
+root@machine:\~# iptables\-save > save.txt
+root@machine:\~# cat save.txt
+# Generated by iptables\-save v1.6.0 on Sat Dec 24 14:26:40 2016
 *filter
 :INPUT ACCEPT [5166:1752111]
 :FORWARD ACCEPT [0:0]
 :OUTPUT ACCEPT [5058:628693]
--A FORWARD -p tcp -m tcp --dport 22 -m conntrack --ctstate NEW -j ACCEPT
+\-A FORWARD \-p tcp \-m tcp \-\-dport 22 \-m conntrack \-\-ctstate NEW \-j ACCEPT
 COMMIT
 # Completed on Sat Dec 24 14:26:40 2016
 
-root@machine:~# iptables-restore-translate -f save.txt
-# Translated by iptables-restore-translate v1.6.0 on Sat Dec 24 14:26:59 2016
+root@machine:\~# iptables\-restore\-translate \-f save.txt
+# Translated by iptables\-restore\-translate v1.6.0 on Sat Dec 24 14:26:59 2016
 add table ip filter
 add chain ip filter INPUT { type filter hook input priority 0; }
 add chain ip filter FORWARD { type filter hook forward priority 0; }
 add chain ip filter OUTPUT { type filter hook output priority 0; }
 add rule ip filter FORWARD tcp dport 22 ct state new counter accept
 
-root@machine:~# iptables-restore-translate -f save.txt > ruleset.nft
-root@machine:~# nft -f ruleset.nft
-root@machine:~# nft list ruleset
+root@machine:\~# iptables\-restore\-translate \-f save.txt > ruleset.nft
+root@machine:\~# nft \-f ruleset.nft
+root@machine:\~# nft list ruleset
 table ip filter {
 	chain INPUT {
 		type filter hook input priority 0; policy accept;
Signature · 1 line
2.42.1
maintainer
#8 lore raw
In reply to Jan Engelhardt
Quoted 8 lines · Jan Engelhardt

The following changes since commit 3be599b62869f2437f499e2386008d73b8c2e71b:

extensions: libarpt_standard.t: Add a rule with builtin option masks (2023-11-09 15:55:33 +0100)

are available in the Git repository at:

https://git.inai.de/iptables master

Also pulled, thanks Jan.