{"id":4383,"date":"2022-12-20T17:49:07","date_gmt":"2022-12-20T20:49:07","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/shorewallipsets-man5\/"},"modified":"2022-12-20T17:49:07","modified_gmt":"2022-12-20T20:49:07","slug":"shorewallipsets-man5","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/shorewallipsets-man5\/","title":{"rendered":"SHOREWALL&minus;IPSETS (man5)"},"content":{"rendered":"<h1 align=\"center\">SHOREWALL\u2212IPSETS<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#EXAMPLES\">EXAMPLES<\/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\">ipsets \u2212 Specifying the name if an ipset in Shorewall configuration files<\/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=\"31%\">\n<p style=\"margin-top: 1em\"><b>+<\/b><i>ipsetname<\/i><\/p>\n<\/td>\n<td width=\"58%\"> <\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"31%\">\n<p style=\"margin-top: 1em\"><b>+<\/b><i>ipsetname<\/i><b>[<\/b><i>flag<\/i><b>,&#8230;]<\/b><\/p>\n<\/td>\n<td width=\"58%\"> <\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"31%\">\n<p style=\"margin-top: 1em\"><b>+[ipsetname,&#8230;]<\/b><\/p>\n<\/td>\n<td width=\"58%\"> <\/td>\n<\/tr>\n<\/table>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Note: In the above syntax descriptions, the square brackets (&#8220;[]&#8221;) are to be taken literally rather than as meta\u2212characters.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">In most places where a network address may be entered, an ipset may be substituted. Set names must be prefixed by the character &#8220;+&#8221;, must start with a letter and may be composed of alphanumeric characters, &#8220;\u2212&#8221; and &#8220;_&#8221;.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Whether the set is matched against the packet source or destination is determined by which column the set name appears (SOURCE or DEST). For those set types that specify a tuple, two alternative syntaxes are available:<\/p>\n<p style=\"margin-left:17%;\">[<i>number<\/i>] \u2212 Indicates that &#8216;src&#8217; or <br \/> &#8216;dst&#8217; should be repeated <i>number<\/i> times. <br \/> Example: myset[2]. <br \/> [<i>flag<\/i>,&#8230;] where <i><br \/> flag<\/i> is <b>src<\/b> or <b><br \/> dst<\/b>. Example: myset[src,dst].<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">In a SOURCE or SPORT column, the following pairs are equivalent:<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 +myset[2] and +myset[src,src]<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">In a DEST or DPORT column, the following pairs are equivalent:<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 +myset[2] and +myset[dst,dst]<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Beginning with Shorewall 4.4.14, multiple source or destination matches may be specified by enclosing the set names within +[&#8230;]. The set names need not be prefixed with &#8216;+&#8217;. When such a list of sets is specified, matching packets must match all of the listed sets.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">For information about set lists and exclusion, see <b><font color=\"#0000FF\">shorewall\u2212exclusion<\/font><\/b> <small><font color=\"#000000\">[1]<\/font><\/small> <font color=\"#000000\">(5).<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">Beginning with Shorewall 4.5.16, you can increment one or more nfacct objects each time a packet matches an ipset. You do that by listing the objects separated by commas within parentheses.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">Example:<\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">+myset[src](myobject)<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">In that example, when the source address of a packet matches the <b>myset<\/b> ipset, the <b>myobject<\/b> nfacct counter will be incremented.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">Beginning with Shorewall 4.6.0, an ipset name (and src\/dst list, if any) can be immediately be followed by a list of match options.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><b><big>Important<\/big><\/b> <br \/> These additional match options are not available in<\/font> <b><font color=\"#0000FF\">shorewall\u2212tcfilters(5)<\/font><\/b> <small><font color=\"#000000\">[2]<\/font><\/small> <font color=\"#000000\">.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">Available options are:<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">nomatch<\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">If the set type supports the nomatch flag, then the matching is reversed: a match with an element flagged with nomatch returns true, while a match with a plain element returns false. This option requires the &#8216;Ipset Match nomatch&#8217; capability in your kernel and ip[6]tables.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">no\u2212update\u2212counters<\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">The packet and byte counters of the matching element in the set won&#8217;t be updated. By default, the packet and byte counters are updated. This option and those that follow require the &#8216;Ipset Match counters&#8217; capability in your kernel and ip[6]tables.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">no\u2212update\u2212subcounters<\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">The packet and byte counters of the matching element in the member set of a list type of set won&#8217;t be updated. Default the packet and byte counters are updated.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">packets=<i>value<\/i><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">If the packet is matched an element in the set, match only if the packet counter of the element matches the given <i>value<\/i> also.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">packets<<i>value<\/i><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">If the packet is matched an element in the set, match only if the packet counter of the element is less than the given <i>value<\/i> as well.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">packets><i>value<\/i><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">If the packet is matched an element in the set, match only if the packet counter of the element is greater than the given <i>value<\/i> as well.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">packets!=<i>value<\/i><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">If the packet is matched an element in the set, match only if the packet counter of the element does not match the given <i>value<\/i> also.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">bytes=<i>value<\/i><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">If the packet is matched an element in the set, match only if the byte counter of the element matches the given <i>value<\/i> also.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">bytes<<i>value<\/i><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">If the packet is matched an element in the set, match only if the byte counter of the element is less than the given <i>value<\/i> as well.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">bytes><i>value<\/i><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">If the packet is matched an element in the set, match only if the byte counter of the element is greater than the given <i>value<\/i> as well.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">bytes<><i>value<\/i><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">If the packet is matched an element in the set, match only if the byte counter of the element does not match the given <i>value<\/i> also.<\/font><\/p>\n<h2>EXAMPLES <a name=\"EXAMPLES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">In the examples that follow, myset, myset1 and myset2 are ipsets and myObject is an NFacct object name.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">+myset<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">+myset[src]<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">+myset[2]<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">+[myset1,myset2[dst]]<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">+myset[src](myObject)<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">+myset[src,nomatch,packets>100]<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">+myset[nomatch,no\u2212update\u2212counters](myObject)<\/font><\/p>\n<h2>FILES <a name=\"FILES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">\/etc\/shorewall\/accounting<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">\/etc\/shorewall6\/accounting<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">\/etc\/shorewall\/blrules<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">\/etc\/shorewall6\/blrules<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">\/etc\/shorewall\/hosts \u2212\u2212 <b>Note:<\/b> Multiple matches enclosed in +[&#8230;] may not be used in this file.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">\/etc\/shorewall6\/hosts \u2212\u2212 <b>Note:<\/b> Multiple matches enclosed in +[&#8230;] may not be used in this file.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">\/etc\/shorewall\/maclist \u2212\u2212 <b>Note:<\/b> Multiple matches enclosed in +[&#8230;] may not be used in this file.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">\/etc\/shorewall6\/maclist \u2212\u2212 <b>Note:<\/b> Multiple matches enclosed in +[&#8230;] may not be used in this file.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">\/etc\/shorewall\/rules<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">\/etc\/shorewall6\/rules<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">\/etc\/shorewall\/secmarks<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">\/etc\/shorewall6\/secmarks<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">\/etc\/shorewall\/mangle<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">\/etc\/shorewall6\/mangle<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">\/etc\/shorewall\/snat<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">\/etc\/shorewall6\/snat<\/font><\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">shorewall(8)<\/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\">1.<\/font><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"29%\">\n<p style=\"margin-top: 1em\"><font color=\"#000000\">shorewall-exclusion<\/font><\/p>\n<\/td>\n<td width=\"54%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">https:\/\/shorewall.org\/manpages\/shorewall-exclusion.html<\/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\">2.<\/font><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"34%\">\n<p style=\"margin-top: 1em\"><font color=\"#000000\">shorewall-tcfilters(5)<\/font><\/p>\n<\/td>\n<td width=\"49%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">https:\/\/shorewall.org\/manpages\/shorewall-tcfilters.html<\/font><\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  ipsets \u2212 Specifying the name if an ipset in Shorewall configuration files <\/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,1390],"class_list":["post-4383","post","type-post","status-publish","format-standard","hentry","category-5-formatos-de-ficheros","tag-961","tag-man5","tag-shorewall-ipsets"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/4383","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=4383"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/4383\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=4383"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=4383"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=4383"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}