Man pages for arptables and ebtables
Phil Sutter
reviewercover Man pages for arptables and ebtables
Take over man pages from legacy ebtables and arptables repositories and adjust them to nft-variants' limitations/extensions.
Patches 5 and 6 contain two minor fixes found while working on the above.
Phil Sutter (6):
doc: Add arptables-nft man pages
doc: Adjust arptables man pages
doc: Add ebtables man page
doc: Adjust ebtables man page xtables-legacy.8: Remove stray colon
xtables-save: Point at existing man page in help text
iptables/Makefile.am | 4 + iptables/arptables-nft-restore.8 | 39 ++ iptables/arptables-nft-save.8 | 47 ++ iptables/arptables-nft.8 | 348 ++++++++++ iptables/ebtables-nft.8 | 1116 ++++++++++++++++++++++++++++++ iptables/xtables-legacy.8 | 2 +- iptables/xtables-save.c | 9 +- 7 files changed, 1561 insertions(+), 4 deletions(-) create mode 100644 iptables/arptables-nft-restore.8 create mode 100644 iptables/arptables-nft-save.8 create mode 100644 iptables/arptables-nft.8 create mode 100644 iptables/ebtables-nft.8
Signature · 1 line
2.21.0
Phil Sutter
reviewerPATCH 1/6 doc: Add arptables-nft man pages
These are 1:1 copies from legacy arptables repository.
--- iptables/Makefile.am | 3 + iptables/arptables-nft-restore.8 | 41 ++++ iptables/arptables-nft-save.8 | 37 ++++ iptables/arptables-nft.8 | 352 +++++++++++++++++++++++++++++++ 4 files changed, 433 insertions(+) create mode 100644 iptables/arptables-nft-restore.8 create mode 100644 iptables/arptables-nft-save.8 create mode 100644 iptables/arptables-nft.8
iptables/Makefile.am +3 -0
@@ -62,6 +62,9 @@ man_MANS = iptables.8 iptables-restore.8 iptables-save.8 \ xtables-nft.8 xtables-translate.8 xtables-legacy.8 \ iptables-translate.8 ip6tables-translate.8 \ xtables-monitor.8 +if ENABLE_NFTABLES +man_MANS += arptables-nft.8 arptables-nft-restore.8 arptables-nft-save.8 +endif CLEANFILES = iptables.8 xtables-monitor.8 \ iptables-translate.8 ip6tables-translate.8 \ xtables-config-parser.c xtables-config-syntax.c
iptables/arptables-nft-restore.8 new file +41 -0
41 lines not on this page · raw message
iptables/arptables-nft-save.8 new file +37 -0
@@ -0,0 +1,37 @@ +.TH ARPTABLES-SAVE 8 "Nov 07, 2013" "" "" +.\" +.\" Man page written by Jesper Dangaard Brouer <[email protected]> based on a +.\" Man page written by Harald Welte <[email protected]> +.\" It is based on the iptables-save man page. +.\" +.\" This program is free software; you can redistribute it and/or modify +.\" it under the terms of the GNU General Public License as published by +.\" the Free Software Foundation; either version 2 of the License, or +.\" (at your option) any later version. +.\" +.\" This program is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public License +.\" along with this program; if not, write to the Free Software +.\" Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +.\" +.\" +.SH NAME +arptables-save \(em dump arptables rules to stdout +.SH SYNOPSIS +\fBarptables\-save +.SH DESCRIPTION +.PP +.B arptables-save +is used to dump the contents of an ARP Table in easily parseable format +to STDOUT. Use I/O-redirection provided by your shell to write to a file. +.SH BUGS +None known as of arptables-0.0.4 release +.SH AUTHOR +Jesper Dangaard Brouer <[email protected]> +.SH SEE ALSO +\fBarptables\-restore\fP(8), \fBarptables\fP(8) +.PP
iptables/arptables-nft.8 new file +352 -0
352 lines not on this page · raw message
Signature · 1 line
2.21.0
Phil Sutter
reviewerPATCH 2/6 doc: Adjust arptables man pages
In reply to Phil SutterChange content to suit the shipped nft-based variant. Most relevant changes:
* FORWARD chain is not supported
* arptables-nft-save supports a few parameters
--- iptables/arptables-nft-restore.8 | 6 ++-- iptables/arptables-nft-save.8 | 20 +++++++++---- iptables/arptables-nft.8 | 48 +++++++++++++++----------------- 3 files changed, 39 insertions(+), 35 deletions(-)
iptables/arptables-nft-restore.8 +2 -4
@@ -1,4 +1,4 @@ -.TH ARPTABLES-RESTORE 8 "Nov 07, 2013" "" "" +.TH ARPTABLES-RESTORE 8 "March 2019" "" "" .\" .\" Man page written by Jesper Dangaard Brouer <[email protected]> based on a .\" Man page written by Harald Welte <[email protected]>
@@ -20,7 +20,7 @@ .\" .\" .SH NAME -arptables-restore \(em Restore ARP Tables +arptables-restore \- Restore ARP Tables (nft-based) .SH SYNOPSIS \fBarptables\-restore .SH DESCRIPTION
@@ -32,8 +32,6 @@ Use I/O redirection provided by your shell to read from a file .TP .B arptables-restore flushes (deletes) all previous contents of the respective ARP Table. -.SH BUGS -None known as of arptables-0.0.4 release .SH AUTHOR Jesper Dangaard Brouer <[email protected]> .SH SEE ALSO
iptables/arptables-nft-save.8 +15 -5
@@ -1,4 +1,4 @@ -.TH ARPTABLES-SAVE 8 "Nov 07, 2013" "" "" +.TH ARPTABLES-SAVE 8 "March 2019" "" "" .\" .\" Man page written by Jesper Dangaard Brouer <[email protected]> based on a .\" Man page written by Harald Welte <[email protected]>
@@ -20,16 +20,26 @@ .\" .\" .SH NAME -arptables-save \(em dump arptables rules to stdout +arptables-save \- dump arptables rules to stdout (nft-based) .SH SYNOPSIS -\fBarptables\-save +\fBarptables\-save\fP [\fB\-M\fP \fImodprobe\fP] [\fB\-c\fP] +.P +\fBarptables\-save\fP [\fB\-V\fP] .SH DESCRIPTION .PP .B arptables-save is used to dump the contents of an ARP Table in easily parseable format to STDOUT. Use I/O-redirection provided by your shell to write to a file. -.SH BUGS -None known as of arptables-0.0.4 release +.TP +\fB\-M\fR, \fB\-\-modprobe\fR \fImodprobe_program\fP +Specify the path to the modprobe program. By default, arptables-save will +inspect /proc/sys/kernel/modprobe to determine the executable's path. +.TP +\fB\-c\fR, \fB\-\-counters\fR +Include the current values of all packet and byte counters in the output. +.TP +\fB\-V\fR, \fB\-\-version\fR +Print version information and exit. .SH AUTHOR Jesper Dangaard Brouer <[email protected]> .SH SEE ALSO
iptables/arptables-nft.8 +22 -26
89 lines not on this page · raw message
Signature · 1 line
2.21.0
Phil Sutter
reviewerPATCH 3/6 doc: Add ebtables man page
In reply to Phil SutterThis is a 1:1 copy from legacy ebtables repository.
--- iptables/Makefile.am | 3 +- iptables/ebtables-nft.8 | 1146 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 1148 insertions(+), 1 deletion(-) create mode 100644 iptables/ebtables-nft.8
iptables/Makefile.am +2 -1
@@ -63,7 +63,8 @@ man_MANS = iptables.8 iptables-restore.8 iptables-save.8 \ iptables-translate.8 ip6tables-translate.8 \ xtables-monitor.8 if ENABLE_NFTABLES -man_MANS += arptables-nft.8 arptables-nft-restore.8 arptables-nft-save.8 +man_MANS += arptables-nft.8 arptables-nft-restore.8 arptables-nft-save.8 \ + ebtables-nft.8 endif CLEANFILES = iptables.8 xtables-monitor.8 \ iptables-translate.8 ip6tables-translate.8 \
iptables/ebtables-nft.8 new file +1146 -0
1,146 lines not on this page · raw message
Signature · 1 line
2.21.0
Phil Sutter
reviewerPATCH 4/6 doc: Adjust ebtables man page
In reply to Phil SutterChange content to match nft-variant, most notably:
* There is no broute table, drop all references to it
* Comment out description of among and string matches, we don't support them (yet)
--- iptables/ebtables-nft.8 | 164 ++++++++++++++++------------------------ 1 file changed, 67 insertions(+), 97 deletions(-)
iptables/ebtables-nft.8 +67 -97
@@ -24,7 +24,7 @@ .\" .\" .SH NAME -ebtables-legacy (2.0.10.4@) \- Ethernet bridge frame table administration (legacy) +ebtables \- Ethernet bridge frame table administration (nft-based) .SH SYNOPSIS .BR "ebtables " [ -t " table ] " - [ ACDI "] chain rule specification [match extensions] [watcher extensions] target" .br
@@ -51,17 +51,6 @@ ebtables-legacy (2.0.10.4@) \- Ethernet bridge frame table administration (legac .BR "ebtables " [ -t " table ] [" --atomic-file " file] " --atomic-save .br -.SH LEGACY -This tool uses the old xtables/setsockopt framework, and is a legacy version -of ebtables. That means that a new, more modern tool exists with the same -functionality using the nf_tables framework and you are encouraged to migrate now. -The new binaries (known as ebtables-nft and formerly known as ebtables-compat) -uses the same syntax and semantics than this legacy one. - -You can still use this legacy tool. You should probably get some specific -information from your Linux distribution or vendor. -More docs are available at https://wiki.nftables.org - .SH DESCRIPTION .B ebtables is an application program used to set up and maintain the
@@ -72,7 +61,7 @@ It is analogous to the application, but less complicated, due to the fact that the Ethernet protocol is much simpler than the IP protocol. .SS CHAINS -There are three ebtables tables with built-in chains in the +There are two ebtables tables with built-in chains in the Linux kernel. These tables are used to divide functionality into different sets of rules. Each set of rules is called a chain. Each chain is an ordered list of rules that can match Ethernet frames. If a
@@ -98,10 +87,7 @@ an 'extension' (see below) or a jump to a user-defined chain. .B ACCEPT means to let the frame through. .B DROP -means the frame has to be dropped. In the -.BR BROUTING " chain however, the " ACCEPT " and " DROP " target have different" -meanings (see the info provided for the -.BR -t " option)." +means the frame has to be dropped. .B CONTINUE means the next rule has to be checked. This can be handy, f.e., to know how many frames pass a certain point in the chain, to log those frames or to apply multiple
@@ -113,14 +99,16 @@ For the extension targets please refer to the .B "TARGET EXTENSIONS" section of this man page. .SS TABLES -As stated earlier, there are three ebtables tables in the Linux +As stated earlier, there are two ebtables tables in the Linux kernel. The table names are -.BR filter ", " nat " and " broute . -Of these three tables, +.BR filter " and " nat . +Of these two tables, the filter table is the default table that the command operates on. If you are working with the filter table, then you can drop the '-t filter' argument to the ebtables command. However, you will need to provide -the -t argument for the other two tables. Moreover, the -t argument must be the +the -t argument for +.B nat +table. Moreover, the -t argument must be the first argument on the ebtables command line, if used. .TP .B "-t, --table"
@@ -149,25 +137,6 @@ iptables world to ebtables it is easier to have the same names. Note that you can change the name .BR "" ( -E ) if you don't like the default. -.br -.br -.B broute -is used to make a brouter, it has one built-in chain: -.BR BROUTING . -The targets -.BR DROP " and " ACCEPT -have a special meaning in the broute table (these names are used instead of -more descriptive names to keep the implementation generic). -.B DROP -actually means the frame has to be routed, while -.B ACCEPT -means the frame has to be bridged. The -.B BROUTING -chain is traversed very early. However, it is only traversed by frames entering on -a bridge port that is in forwarding state. Normally those frames -would be bridged, but you can decide otherwise here. The -.B redirect -target is very handy here. .SH EBTABLES COMMAND LINE ARGUMENTS After the initial ebtables '-t table' command line argument, the remaining arguments can be divided into several groups. These groups
@@ -553,35 +522,35 @@ If the 802.3 DSAP and SSAP values are 0xaa then the SNAP type field must be consulted to determine the payload protocol. This is a two byte (hexadecimal) argument. Only 802.3 frames with DSAP/SSAP 0xaa are checked for type. -.SS among -Match a MAC address or MAC/IP address pair versus a list of MAC addresses -and MAC/IP address pairs. -A list entry has the following format: -.IR xx:xx:xx:xx:xx:xx[=ip.ip.ip.ip][,] ". Multiple" -list entries are separated by a comma, specifying an IP address corresponding to -the MAC address is optional. Multiple MAC/IP address pairs with the same MAC address -but different IP address (and vice versa) can be specified. If the MAC address doesn't -match any entry from the list, the frame doesn't match the rule (unless "!" was used). -.TP -.BR "--among-dst " "[!] \fIlist\fP" -Compare the MAC destination to the given list. If the Ethernet frame has type -.IR IPv4 " or " ARP , -then comparison with MAC/IP destination address pairs from the -list is possible. -.TP -.BR "--among-src " "[!] \fIlist\fP" -Compare the MAC source to the given list. If the Ethernet frame has type -.IR IPv4 " or " ARP , -then comparison with MAC/IP source address pairs from the list -is possible. -.TP -.BR "--among-dst-file " "[!] \fIfile\fP" -Same as -.BR --among-dst " but the list is read in from the specified file." -.TP -.BR "--among-src-file " "[!] \fIfile\fP" -Same as -.BR --among-src " but the list is read in from the specified file." +.\" .SS among +.\" Match a MAC address or MAC/IP address pair versus a list of MAC addresses +.\" and MAC/IP address pairs. +.\" A list entry has the following format: +.\" .IR xx:xx:xx:xx:xx:xx[=ip.ip.ip.ip][,] ". Multiple" +.\" list entries are separated by a comma, specifying an IP address corresponding to +.\" the MAC address is optional. Multiple MAC/IP address pairs with the same MAC address +.\" but different IP address (and vice versa) can be specified. If the MAC address doesn't +.\" match any entry from the list, the frame doesn't match the rule (unless "!" was used). +.\" .TP +.\" .BR "--among-dst " "[!] \fIlist\fP" +.\" Compare the MAC destination to the given list. If the Ethernet frame has type +.\" .IR IPv4 " or " ARP , +.\" then comparison with MAC/IP destination address pairs from the +.\" list is possible. +.\" .TP +.\" .BR "--among-src " "[!] \fIlist\fP" +.\" Compare the MAC source to the given list. If the Ethernet frame has type +.\" .IR IPv4 " or " ARP , +.\" then comparison with MAC/IP source address pairs from the list +.\" is possible. +.\" .TP +.\" .BR "--among-dst-file " "[!] \fIfile\fP" +.\" Same as +.\" .BR --among-dst " but the list is read in from the specified file." +.\" .TP +.\" .BR "--among-src-file " "[!] \fIfile\fP" +.\" Same as +.\" .BR --among-src " but the list is read in from the specified file." .SS arp Specify (R)ARP fields. The protocol must be specified as .IR ARP " or " RARP .
@@ -822,26 +791,26 @@ The hello time timer (0-65535) range. .TP .BR "--stp-forward-delay " "[!] [\fIdelay\fP][:\fIdelay\fP]" The forward delay timer (0-65535) range. -.SS string -This module matches on a given string using some pattern matching strategy. -.TP -.BR "--string-algo " "\fIalgorithm\fP" -The pattern matching strategy. (bm = Boyer-Moore, kmp = Knuth-Pratt-Morris) -.TP -.BR "--string-from " "\fIoffset\fP" -The lowest offset from which a match can start. (default: 0) -.TP -.BR "--string-to " "\fIoffset\fP" -The highest offset from which a match can start. (default: size of frame) -.TP -.BR "--string " "[!] \fIpattern\fP" -Matches the given pattern. -.TP -.BR "--string-hex " "[!] \fIpattern\fP" -Matches the given pattern in hex notation, e.g. '|0D 0A|', '|0D0A|', 'www|09|netfilter|03|org|00|' -.TP -.BR "--string-icase" -Ignore case when searching. +.\" .SS string +.\" This module matches on a given string using some pattern matching strategy. +.\" .TP +.\" .BR "--string-algo " "\fIalgorithm\fP" +.\" The pattern matching strategy. (bm = Boyer-Moore, kmp = Knuth-Pratt-Morris) +.\" .TP +.\" .BR "--string-from " "\fIoffset\fP" +.\" The lowest offset from which a match can start. (default: 0) +.\" .TP +.\" .BR "--string-to " "\fIoffset\fP" +.\" The highest offset from which a match can start. (default: size of frame) +.\" .TP +.\" .BR "--string " "[!] \fIpattern\fP" +.\" Matches the given pattern. +.\" .TP +.\" .BR "--string-hex " "[!] \fIpattern\fP" +.\" Matches the given pattern in hex notation, e.g. '|0D 0A|', '|0D0A|', 'www|09|netfilter|03|org|00|' +.\" .TP +.\" .BR "--string-icase" +.\" Ignore case when searching. .SS vlan Specify 802.1Q Tag Control Information fields. The protocol must be specified as
@@ -1026,7 +995,6 @@ The default target The .B dnat target can only be used in the -.BR BROUTING " chain of the " broute " table and the " .BR PREROUTING " and " OUTPUT " chains of the " nat " table." It specifies that the destination MAC address has to be changed. .TP
@@ -1089,11 +1057,8 @@ The .B redirect target will change the MAC target address to that of the bridge device the frame arrived on. This target can only be used in the -.BR BROUTING " chain of the " broute " table and the " .BR PREROUTING " chain of the " nat " table." -In the -.BR BROUTING " chain, the MAC address of the bridge port is used as destination address," -.BR "" "in the " PREROUTING " chain, the MAC address of the bridge is used." +The MAC address of the bridge is used as destination address." .TP .BR "--redirect-target " "\fItarget\fP" .br
@@ -1135,12 +1100,17 @@ arp message and the hardware address length in the arp header is 6 bytes. .br .SH FILES .I /etc/ethertypes -.I /var/lib/ebtables/lock .SH ENVIRONMENT VARIABLES .I EBTABLES_ATOMIC_FILE .SH MAILINGLISTS .BR "" "See " http://netfilter.org/mailinglists.html +.SH BUGS +The version of ebtables this man page ships with does not support the +.B broute +table. Also there is no support for +.BR among " and " string +matches. And finally, this list is probably not complete. .SH SEE ALSO -.BR iptables "(8), " brctl "(8), " ifconfig "(8), " route (8) +.BR xtables-nft "(8), " iptables "(8), " ip (8) .PP -.BR "" "See " http://ebtables.sf.net +.BR "" "See " https://wiki.nftables.org
Signature · 1 line
2.21.0
Phil Sutter
reviewerPATCH 5/6 xtables-legacy.8: Remove stray colon
In reply to Phil SutterThis obviously doesn't belong there.
--- iptables/xtables-legacy.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
iptables/xtables-legacy.8 +1 -1
@@ -67,7 +67,7 @@ iptables-legacy-save and checking for any differences in output. .B xtables\-monitor(8) will need the .B xtables\-nft(8) -versions to work, it cannot display changes made using the. +versions to work, it cannot display changes made using the .B iptables-legacy tools.
Signature · 1 line
2.21.0
Phil Sutter
reviewerPATCH 6/6 xtables-save: Point at existing man page in help text
In reply to Phil Sutter--- iptables/xtables-save.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
iptables/xtables-save.c +6 -3
@@ -187,7 +187,8 @@ xtables_save_main(int family, const char *progname, int argc, char *argv[])exit (0 );default :fprintf (stderr, -"Look at manual page `xtables-save.8' for more information.\n" ); +"Look at manual page `%s.8' for more information.\n" , + prog_name);exit (1 ); } }
@@ -333,7 +334,8 @@ int xtables_eb_save_main(int argc_, char *argv_[])exit (0 );default :fprintf (stderr, -"Look at manual page `xtables-save.8' for more information.\n" ); +"Look at manual page `%s.8' for more information.\n" , + prog_name);exit (1 ); } }
@@ -380,7 +382,8 @@ int xtables_arp_save_main(int argc, char **argv)exit (0 );default :fprintf (stderr, -"Look at manual page `xtables-save.8' for more information.\n" ); +"Look at manual page `%s.8' for more information.\n" , + prog_name);exit (1 ); } }
Signature · 1 line
2.21.0
Florian Westphal
maintainerQuoted 2 lines · Phil Sutter
Take over man pages from legacy ebtables and arptables repositories and adjust them to nft-variants' limitations/extensions.
Series applied, thanks Phil.