{"id":4342,"date":"2022-12-20T17:49:01","date_gmt":"2022-12-20T20:49:01","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/shorewallaccountin-man5\/"},"modified":"2022-12-20T17:49:01","modified_gmt":"2022-12-20T20:49:01","slug":"shorewallaccountin-man5","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/shorewallaccountin-man5\/","title":{"rendered":"SHOREWALL&minus;ACCOUNTIN (man5)"},"content":{"rendered":"<h1 align=\"center\">SHOREWALL\u2212ACCOUNTIN<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#FILES\">FILES<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#NOTES\">NOTES<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">accounting \u2212 Shorewall Accounting file<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"43%\">\n<p style=\"margin-top: 1em\"><b>\/etc\/shorewall[6]\/accounting<\/b><\/p>\n<\/td>\n<td width=\"46%\"> <\/td>\n<\/tr>\n<\/table>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Accounting rules exist simply to count packets and bytes in categories that you define in this file. You may display these rules and their packet and byte counters using the <b>shorewall show accounting<\/b> command.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Beginning with Shorewall 4.4.18, the accounting structure can be created with three root chains:<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 <b>accountin<\/b>: Rules that are valid in the <b>INPUT<\/b> chain (may not specify an output interface).<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 <b>accountout<\/b>: Rules that are valid in the OUTPUT chain (may not specify an input interface or a MAC address).<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 <b>accounting<\/b>: Other rules.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The new structure is enabled by sectioning the accounting file in a manner similar to the <b><font color=\"#0000FF\">rules file<\/font><\/b> <small><font color=\"#000000\">[1]<\/font><\/small> <font color=\"#000000\">. The sections are <b>INPUT<\/b>, <b>OUTPUT<\/b> and <b>FORWARD<\/b> and must appear in that order (although any of them may be omitted). The first non\u2212commentary record in the accounting file must be a section header when sectioning is used.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><b><big>Warning<\/big><\/b> <br \/> If sections are not used, the Shorewall rules compiler cannot detect certain violations of netfilter restrictions. These violations can result in run\u2212time errors such as the following:<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><b>iptables\u2212restore v1.4.13: Can&#8217;t use \u2212o with INPUT<\/b><\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">Beginning with Shorewall 4.4.20, the ACCOUNTING_TABLE setting was added to shorewall.conf and shorewall6.conf. That setting determines the Netfilter table (filter or mangle) where the accounting rules are added. When ACCOUNTING_TABLE=mangle is specified, the available sections are <b>PREROUTING<\/b>, <b>INPUT<\/b>, <b>OUTPUT<\/b>, <b>FORWARD<\/b> and <b>POSTROUTING<\/b>.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">Section headers have the form:<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><b>?SECTION<\/b> <i>section\u2212name<\/i><\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">When sections are enabled:<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">\u2022 A jump to a user\u2212defined accounting chain must appear before entries that add rules to that chain. This eliminates loops and unreferenced chains.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">\u2022 An output interface may not be specified in the <b>PREROUTING<\/b> and <b>INPUT<\/b> sections.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">\u2022 In the <b>OUTPUT<\/b> and <b>POSTROUTING<\/b> sections:<\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\">\u2022 An input interface may not be specified<\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\">\u2022 Jumps to a chain defined in the <b>INPUT<\/b> or <b>PREROUTING<\/b> sections that specifies an input interface are prohibited<\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\">\u2022 MAC addresses may not be used<\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\">\u2022 Jump to a chain defined in the <b>INPUT<\/b> or <b>PREROUTING<\/b> section that specifies a MAC address are prohibited.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">\u2022 The default value of the CHAIN column is:<\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\">\u2022 <b>accountin<\/b> in the <b>INPUT<\/b> section<\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\">\u2022 <b>accountout<\/b> in the <b>OUTPUT<\/b> section<\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\">\u2022 <b>accountfwd<\/b> in the <b>FORWARD<\/b> section<\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\">\u2022 <b>accountpre<\/b> in the <b>PREROUTING<\/b> section<\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\">\u2022 <b>accountpost<\/b> in the <b>POSTROUTING<\/b> section<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">\u2022 Traffic addressed to the firewall goes through the rules defined in the INPUT section.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">\u2022 Traffic originating on the firewall goes through the rules defined in the OUTPUT section.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">\u2022 Traffic being forwarded through the firewall goes through the rules from the FORWARD sections.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">The columns in the file are as follows (where the column name is followed by a different name in parentheses, the different name is used in the alternate specification syntax):<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><b>ACTION<\/b> \u2212 {<b>COUNT<\/b>|<b>DONE<\/b>|<i>chain<\/i>[:<b>{COUNT<\/b>|JUMP}]|ACCOUNT(<i>table<\/i>,<i>network<\/i>)|[?]COMMENT <i>comment<\/i>}<\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">What to do when a matching packet is found.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><b>COUNT<\/b><\/font><\/p>\n<p style=\"margin-left:23%;\"><font color=\"#000000\">Simply count the match and continue with the next rule<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><b>DONE<\/b><\/font><\/p>\n<p style=\"margin-left:23%;\"><font color=\"#000000\">Count the match and don&#8217;t attempt to match any other accounting rules in the chain specified in the <b>CHAIN<\/b> column.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><i>chain<\/i>[<b>:COUNT<\/b>]<\/font><\/p>\n<p style=\"margin-left:23%;\"><font color=\"#000000\">Where <i>chain<\/i> is the name of a chain; shorewall will create the chain automatically if it doesn&#8217;t already exist. If a second chain is mentioned in the CHAIN column, then a jump from this second chain to <i>chain<\/i> is created. If no chain is named in the CHAIN column, then a jump from the default chain to <i>chain<\/i> is created. If <b>:COUNT<\/b> is included, a counting rule matching this entry will be added to <i>chain<\/i>. The <i>chain<\/i> may not exceed 29 characters in length and may be composed of letters, digits, dash (&#8216;\u2212&#8217;) and underscore (&#8216;_&#8217;).<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><i>chain<\/i>:JUMP<\/font><\/p>\n<p style=\"margin-left:23%;\"><font color=\"#000000\">Like the previous option without the <b>:COUNT<\/b> part.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><b>ACCOUNT(<\/b><i>table<\/i>,<i>network<\/i><b>)<\/b><\/font><\/p>\n<p style=\"margin-left:23%;\"><font color=\"#000000\">This action implements per\u2212IP accounting and was added in Shorewall 4.4.17. Requires the <i>ACCOUNT Target<\/i> capability in your iptables and kernel (see the output of <b>shorewall show capabilities<\/b>).<\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\"><i>table<\/i><\/font><\/p>\n<p style=\"margin-left:29%;\"><font color=\"#000000\">is the name of an accounting table (you choose the name). All rules specifying the same name will have their per\u2212IP counters accumulated in the same table.<\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\"><i>network<\/i><\/font><\/p>\n<p style=\"margin-left:29%;\"><font color=\"#000000\">is an IPv4 <b>network<\/b> in CIDR notation (e.g., 192.168.1.0\/24). The network can be as large as a \/8 (class A).<\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\">One nice feature of per\u2212IP accounting is that the counters survive <b>shorewall restart<\/b>. This has a downside, however. If you change the network associated with an accounting table, then you must <b>shorewall stop; shorewall start<\/b> to have a successful restart (counters will be cleared).<\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\">The counters in a <i>table<\/i> are printed using the <b>iptaccount<\/b> utility. For a command synopsis, type:<\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\"><b>iptaccount \u2212\u2212help<\/b><\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\">As of February 2011, the ACCOUNT Target capability and the iptaccount utility are only available when<\/font> <b><font color=\"#0000FF\">xtables\u2212addons<\/font><\/b> <small><font color=\"#000000\">[2]<\/font><\/small> <font color=\"#000000\">is installed. See<\/font> <b><font color=\"#0000FF\">https:\/\/shorewall.org\/Accounting.html#perIP<\/font><\/b> <small><font color=\"#000000\">[3]<\/font><\/small> <font color=\"#000000\">for additional information.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><b>INLINE<\/b><\/font><\/p>\n<p style=\"margin-left:23%;\"><font color=\"#000000\">Added in Shorewall 4.5.16. Allows free form iptables matches to be specified following a &#8216;;&#8217;. In the generated iptables rule(s), the free form matches will follow any matches that are generated by the column contents.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><b>NFACCT<\/b>({<i>object<\/i>[!]}[,&#8230;])<\/font><\/p>\n<p style=\"margin-left:23%;\"><font color=\"#000000\">Added in Shorewall 4.5.7. Provides a form of accounting that survives <b>shorewall stop\/shorewall<\/b> start and <b>shorewall restart<\/b>. Requires the NFaccnt Match capability in your kernel and iptables. <i>object<\/i> names an nfacct object (see man nfaccnt(8)). Multiple rules can specify the same <i>object<\/i>; all packets that match any of the rules increment the packet and bytes count of the object.<\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\">Prior to Shorewall 4.5.16, only one <i>object<\/i> could be specified. Beginning with Shorewall 4.5.16, an arbitrary number of objects may be given.<\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\">With Shorewall 4.5.16 or later, an nfacct <i>object<\/i> in the list may optionally be followed by <b>!<\/b> to indicate that the nfacct <i>object<\/i> will be incremented unconditionally for each packet. When <b>!<\/b> is omitted, the <i>object<\/i> will be incremented only if all of the matches in the rule succeed.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><b>NFLOG<\/b>[(nflog\u2212parameters)] \u2212 Added in Shorewall\u22124.4.20.<\/font><\/p>\n<p style=\"margin-left:23%;\"><font color=\"#000000\">Causes each matching packet to be sent via the currently loaded logging back\u2212end (usually nfnetlink_log) where it is available to accounting daemons through a netlink socket.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><b>?COMMENT<\/b><\/font><\/p>\n<p style=\"margin-left:23%;\"><font color=\"#000000\">The remainder of the line is treated as a comment which is attached to subsequent rules until another COMMENT line is found or until the end of the file is reached. To stop adding comments to rules, use a line with only the word ?COMMENT.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><b>CHAIN<\/b> \u2212 {<b>\u2212<\/b>|<i>chain<\/i>}<\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">The name of a <i>chain<\/i>. If specified as <b>\u2212<\/b> the <b>accounting<\/b> chain is assumed when the file is un\u2212sectioned. When the file is sectioned, the default is one of accountin, accountout, etc. depending on the section. This is the chain where the accounting rule is added. The <i>chain<\/i> will be created if it doesn&#8217;t already exist. The <i>chain<\/i> may not exceed 29 characters in length.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><b>SOURCE<\/b> \u2212 {<b>\u2212<\/b>|<b>any<\/b>|<b>all<\/b>|<i>interface<\/i>|<i>interface<\/i><b>:<\/b><i>address<\/i>|<i>address<\/i>}<\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">Packet Source.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">The name of an <i>interface<\/i>, an <i>address<\/i> (host or net) or an <i>interface<\/i> name followed by &#8220;:&#8221; and a host or net <i>address<\/i>. An ipset name is also accepted as an <i>address<\/i>.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><b>DEST<\/b> \u2212 {<b>\u2212<\/b>|<b>any<\/b>|<b>all<\/b>|<i>interface<\/i>|<i>interface<\/i><b>:<\/b><i>address<\/i>|<i>address<\/i>}<\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">This column was formerly named DESTINATION.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">Packet Destination.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">Format same as <b>SOURCE<\/b> column.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><b>PROTO<\/b> \u2212 {<b>\u2212<\/b>|<b>{any<\/b>|<b>all<\/b>|<i>protocol\u2212name<\/i>|<i>protocol\u2212number<\/i>|<b>ipp2p<\/b>[<b>:<\/b>{<b>udp<\/b>|<b>all<\/b>}]}[,&#8230;]}<\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">This column was formerly named PROTOCOL<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">A <i>protocol\u2212name<\/i> (from protocols(5)), a <i>protocol\u2212number<\/i>, <b>ipp2p<\/b>, <b>ipp2p:udp<\/b> or <b>ipp2p:all<\/b><\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">Beginning with Shorewall 4.5.12, this column can accept a comma\u2212separated list of protocols.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><b>DPORT<\/b> \u2212 {<b>\u2212<\/b>|<b>any<\/b>|<b>all<\/b>|<i>ipp2p\u2212option<\/i>|<i>port\u2212name\u2212or\u2212number<\/i>[,<i>port\u2212name\u2212or\u2212number<\/i>]&#8230;}<\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">Destination Port number. Service name from services(5) or <i>port number<\/i>. May only be specified if the protocol is TCP (6), UDP (17), DCCP (33), SCTP (132) or UDPLITE (136).<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">You may place a comma\u2212separated list of port names or numbers in this column if your kernel and iptables include multi\u2212port match support.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">If the PROTOCOL is <b>ipp2p<\/b> then this column must contain an <i>ipp2p\u2212option<\/i> (&#8220;iptables \u2212m ipp2p \u2212\u2212help&#8221;) without the leading &#8220;\u2212\u2212&#8221;. If no option is given in this column, <b>ipp2p<\/b> is assumed.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">This column was formerly named DEST PORT(S).<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><b>SPORT<\/b> \u2212 {<b>\u2212<\/b>|<b>any<\/b>|<b>all<\/b>|<i>port\u2212name\u2212or\u2212number<\/i>[,<i>port\u2212name\u2212or\u2212number<\/i>]&#8230;}<\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">Service name from services(5) or <i>port number<\/i>. May only be specified if the protocol is TCP (6), UDP (17), DCCP (33), SCTP (132) or UDPLITE (136).<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">You may place a comma\u2212separated list of port numbers in this column if your kernel and iptables include multi\u2212port match support.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">Beginning with Shorewall 4.5.15, you may place &#8216;=&#8217; in this column, provided that the DEST PORT(S) column is non\u2212empty. This causes the rule to match when either the source port or the destination port in a packet matches one of the ports specified in DPORT. Use of &#8216;=&#8217; requires multi\u2212port match in your iptables and kernel.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">This column was formerly labelled SOURCE PORT(S).<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><b>USER<\/b> \u2212 [<b>!<\/b>][<i>user\u2212name\u2212or\u2212number<\/i>][<b>:<\/b><i>group\u2212name\u2212or\u2212number<\/i>][<b>+<\/b><i>program\u2212name<\/i>]<\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">This column was formerly named USER\/GROUP and may only be non\u2212empty if the <b>CHAIN<\/b> is <b>OUTPUT<\/b>.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">When this column is non\u2212empty, the rule applies only if the program generating the output is running under the effective <i>user<\/i> and\/or <i>group<\/i> specified (or is NOT running under that id if &#8220;!&#8221; is given).<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">Examples:<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">joe<\/font><\/p>\n<p style=\"margin-left:23%;\"><font color=\"#000000\">program must be run by joe<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">:kids<\/font><\/p>\n<p style=\"margin-left:23%;\"><font color=\"#000000\">program must be run by a member of the &#8216;kids&#8217; group<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">!:kids<\/font><\/p>\n<p style=\"margin-left:23%;\"><font color=\"#000000\">program must not be run by a member of the &#8216;kids&#8217; group<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">+upnpd<\/font><\/p>\n<p style=\"margin-left:23%;\"><font color=\"#000000\">#program named upnpd<\/font><\/p>\n<p style=\"margin-left:29%; margin-top: 1em\"><font color=\"#000000\"><b><big>Important<\/big><\/b> <br \/> The ability to specify a program name was removed from Netfilter in kernel version 2.6.14.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><b><big>MARK<\/big><\/b> <big>\u2212 [<b>!<\/b>]<i>value<\/i>[\/<i>mask<\/i>][<b>:C<\/b>]<\/big><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>Defines a test on the existing packet or connection mark. The rule will match only if the test returns true.<\/big><\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><big>If you don&#8217;t want to define a test but need to specify anything in the following columns, place a &#8220;\u2212&#8221; in this field.<\/big><\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><big>!<\/big><\/font><\/p>\n<p style=\"margin-left:23%;\"><font color=\"#000000\"><big>Inverts the test (not equal)<\/big><\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><big><i>value<\/i><\/big><\/font><\/p>\n<p style=\"margin-left:23%;\"><font color=\"#000000\"><big>Value of the packet or connection mark.<\/big><\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><big><i>mask<\/i><\/big><\/font><\/p>\n<p style=\"margin-left:23%;\"><font color=\"#000000\"><big>A mask to be applied to the mark before testing.<\/big><\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><big><b>:C<\/b><\/big><\/font><\/p>\n<p style=\"margin-left:23%;\"><font color=\"#000000\"><big>Designates a connection mark. If omitted, the packet mark&#8217;s value is tested.<\/big><\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big><b>IPSEC \u2212<\/b> <i>option\u2212list<\/i> <b>(Optional \u2212 Added in Shorewall 4.4.13 but broken until 4.5.4.1 )<\/b><\/big><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>The option\u2212list consists of a comma\u2212separated list of options from the following list. Only packets that will be encrypted or have been decrypted via an SA that matches these options will have their source address changed.<\/big><\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><big><b>reqid=<\/b><i>number<\/i><\/big><\/font><\/p>\n<p style=\"margin-left:23%;\"><font color=\"#000000\"><big>where <i>number<\/i> is specified using setkey(8) using the &#8216;unique:<i>number<\/i> option for the SPD level.<\/big><\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><big><b>spi=<\/b><number><\/big><\/font><\/p>\n<p style=\"margin-left:23%;\"><font color=\"#000000\"><big>where <i>number<\/i> is the SPI of the SA used to encrypt\/decrypt packets.<\/big><\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><big><b>proto=ah<\/b>|<b>esp<\/b>|<b>ipcomp<\/b><\/big><\/font><\/p>\n<p style=\"margin-left:23%;\"><font color=\"#000000\"><big>IPSEC Encapsulation Protocol<\/big><\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><big><b>mss=<\/b><i>number<\/i><\/big><\/font><\/p>\n<p style=\"margin-left:23%;\"><font color=\"#000000\"><big>sets the MSS field in TCP packets<\/big><\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><big><b>mode=transport<\/b>|<b>tunnel<\/b><\/big><\/font><\/p>\n<p style=\"margin-left:23%;\"><font color=\"#000000\"><big>IPSEC mode<\/big><\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><big><b>tunnel\u2212src=<\/b><i>address<\/i>[\/<i>mask<\/i>]<\/big><\/font><\/p>\n<p style=\"margin-left:23%;\"><font color=\"#000000\"><big>only available with mode=tunnel<\/big><\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><big><b>tunnel\u2212dst=<\/b><i>address<\/i>[\/<i>mask<\/i>]<\/big><\/font><\/p>\n<p style=\"margin-left:23%;\"><font color=\"#000000\"><big>only available with mode=tunnel<\/big><\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><big><b>strict<\/b><\/big><\/font><\/p>\n<p style=\"margin-left:23%;\"><font color=\"#000000\"><big>Means that packets must match all rules.<\/big><\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><big><b>next<\/b><\/big><\/font><\/p>\n<p style=\"margin-left:23%;\"><font color=\"#000000\"><big>Separates rules; can only be used with strict<\/big><\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><big><b>yes<\/b> or <b>ipsec<\/b><\/big><\/font><\/p>\n<p style=\"margin-left:23%;\"><font color=\"#000000\"><big>When used by itself, causes all traffic that will be encrypted\/encapsulated or has been decrypted\/un\u2212encapsulated to match the rule.<\/big><\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><big><b>no<\/b> or <b>none<\/b><\/big><\/font><\/p>\n<p style=\"margin-left:23%;\"><font color=\"#000000\"><big>When used by itself, causes all traffic that will not be encrypted\/encapsulated or has been decrypted\/un\u2212encapsulated to match the rule.<\/big><\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><big><b>in<\/b><\/big><\/font><\/p>\n<p style=\"margin-left:23%;\"><font color=\"#000000\"><big>May only be used in the FORWARD section and must be the first or the only item the list. Indicates that matching packets have been decrypted in input.<\/big><\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><big><b>out<\/b><\/big><\/font><\/p>\n<p style=\"margin-left:23%;\"><font color=\"#000000\"><big>May only be used in the FORWARD section and must be the first or the only item in the list. Indicates that matching packets will be encrypted on output.<\/big><\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><big>If this column is non\u2212empty and sections are not used, then:<\/big><\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\"><big>\u2022 A chain NAME appearing in the ACTION column must be a chain branched either directly or indirectly from the <b>accipsecin<\/b> or <b>accipsecout<\/b> chain.<\/big><\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\"><big>\u2022 The CHAIN column must contain either <b>accipsecin<\/b> or <b>accipsecout<\/b> or a chain branched either directly or indirectly from those chains.<\/big><\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\"><big>\u2022 These rules will NOT appear in the <b>accounting<\/b> chain.<\/big><\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big>In all of the above columns except <b>ACTION<\/b> and <b>CHAIN<\/b>, the values <b>\u2212<\/b>, <b>any<\/b> and <b>all<\/b> may be used as wildcard&#8217;gs. Omitted trailing columns are also treated as wildcard&#8217;g.<\/big><\/font><\/p>\n<h2>FILES <a name=\"FILES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big>\/etc\/shorewall\/accounting<\/big><\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big>\/etc\/shorewall6\/accounting<\/big><\/font><\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><big><b><font color=\"#0000FF\">shorewall\u2212logging(5)<\/font><\/b><\/big> <font color=\"#000000\">[4]<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b><big><font color=\"#0000FF\">https:\/\/shorewall.org\/configuration_file_basics.htm#Pairs<\/font><\/big><\/b> <font color=\"#000000\">[5]<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big>shorewall(8)<\/big><\/font><\/p>\n<h2>NOTES <a name=\"NOTES\"><\/a> <\/h2>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"12%\"><\/td>\n<td width=\"3%\">\n<p style=\"margin-top: 1em\"><font color=\"#000000\"><big>1.<\/big><\/font><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"15%\">\n<p style=\"margin-top: 1em\"><font color=\"#000000\"><big>rules file<\/big><\/font><\/p>\n<\/td>\n<td width=\"68%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>https:\/\/shorewall.org\/manpages\/shorewall-rules.html<\/big><\/font><\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"12%\"><\/td>\n<td width=\"3%\">\n<p style=\"margin-top: 1em\"><font color=\"#000000\"><big>2.<\/big><\/font><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"21%\">\n<p style=\"margin-top: 1em\"><font color=\"#000000\"><big>xtables-addons<\/big><\/font><\/p>\n<\/td>\n<td width=\"62%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>http:\/\/xtables-addons.sourceforge.net\/<\/big><\/font><\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"12%\"><\/td>\n<td width=\"3%\">\n<p style=\"margin-top: 1em\"><font color=\"#000000\"><big>3.<\/big><\/font><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"66%\">\n<p style=\"margin-top: 1em\"><font color=\"#000000\"><big>https:\/\/shorewall.org\/Accounting.html#perIP<\/big><\/font><\/p>\n<\/td>\n<td width=\"17%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>https:\/\/shorewall.org\/Accounting.html#perIP<\/big><\/font><\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"12%\"><\/td>\n<td width=\"3%\">\n<p style=\"margin-top: 1em\"><font color=\"#000000\"><big>4.<\/big><\/font><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"31%\">\n<p style=\"margin-top: 1em\"><font color=\"#000000\"><big>shorewall-logging(5)<\/big><\/font><\/p>\n<\/td>\n<td width=\"52%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>https:\/\/shorewall.org\/manpages\/shorewall-logging.htm<\/big><\/font><\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"12%\"><\/td>\n<td width=\"3%\">\n<p style=\"margin-top: 1em\"><font color=\"#000000\"><big>5.<\/big><\/font><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"83%\">\n<p style=\"margin-top: 1em\"><font color=\"#000000\"><big>https:\/\/shorewall.org\/configuration_file_basics.htm#Pairs<\/big><\/font><\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>https:\/\/shorewall.org\/configuration_file_basics.htm#Pairs<\/big><\/font><\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  accounting \u2212 Shorewall Accounting file <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[959],"tags":[961,1291,1356],"class_list":["post-4342","post","type-post","status-publish","format-standard","hentry","category-5-formatos-de-ficheros","tag-961","tag-man5","tag-shorewall-accounting"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/4342","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=4342"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/4342\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=4342"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=4342"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=4342"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}