{"id":4622,"date":"2022-12-20T18:09:19","date_gmt":"2022-12-20T21:09:19","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/shorewallexclusion-man5\/"},"modified":"2022-12-20T18:09:19","modified_gmt":"2022-12-20T21:09:19","slug":"shorewallexclusion-man5","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/shorewallexclusion-man5\/","title":{"rendered":"SHOREWALL&minus;EXCLUSION (man5)"},"content":{"rendered":"<h1 align=\"center\">SHOREWALL\u2212EXCLUSION<\/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\">exclusion \u2212 Exclude a set of hosts from a definition in a shorewall configuration 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=\"60%\">\n<p style=\"margin-top: 1em\"><b>!<\/b><i>address\u2212or\u2212range<\/i>[,<i>address\u2212or\u2212range<\/i>]&#8230;<\/p>\n<\/td>\n<td width=\"29%\"> <\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"60%\">\n<p style=\"margin-top: 1em\"><b>!<\/b><i>zone\u2212name<\/i>[,<i>zone\u2212name<\/i>]&#8230;<\/p>\n<\/td>\n<td width=\"29%\"> <\/td>\n<\/tr>\n<\/table>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The first form of exclusion is used when you wish to exclude one or more addresses from a definition. An exclamation point is followed by a comma\u2212separated list of addresses. The addresses may be single host addresses (e.g., 192.168.1.4) or they may be network addresses in CIDR format (e.g., 192.168.1.0\/24). If your kernel and iptables include iprange support, you may also specify ranges of ip addresses of the form <i>lowaddress<\/i>\u2212<i>highaddress<\/i><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">No embedded white\u2212space is allowed.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Exclusion can appear after a list of addresses and\/or address ranges. In that case, the final list of address is formed by taking the first list and then removing the addresses defined in the exclusion.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Beginning in Shorewall 4.4.13, the second form of exclusion is allowed after <b>all<\/b> and <b>any<\/b> in the SOURCE and DEST columns of <b><font color=\"#0000FF\">shorewall\u2212rules<\/font><\/b> <small><font color=\"#000000\">[1]<\/font><\/small> <font color=\"#000000\">(5). It allows you to omit arbitrary zones from the list generated by those key words.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><b><big>Warning<\/big><\/b> <br \/> If you omit a sub\u2212zone and there is an explicit or explicit CONTINUE policy, a connection to\/from that zone can still be matched by the rule generated for a parent zone.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">For example:<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">\/etc\/shorewall\/zones:<\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\">#ZONE TYPE <br \/> z1 ip <br \/> z2:z1 ip <br \/> &#8230;<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">\/etc\/shorewall\/policy:<\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\">#SOURCE DEST POLICY <br \/> z1 net CONTINUE <br \/> z2 net REJECT<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">\/etc\/shorewall\/rules:<\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\">#ACTION SOURCE DEST PROTO DPORT <br \/> ACCEPT all!z2 net tcp 22<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">In this case, SSH connections from <b>z2<\/b> to <b>net<\/b> will be accepted by the generated <b>z1<\/b> to net ACCEPT rule.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">In most contexts, ipset names can be used as an <i>address\u2212or\u2212range<\/i>. Beginning with Shorewall 4.4.14, ipset lists enclosed in +[&#8230;] may also be included (see<\/font> <b><font color=\"#0000FF\">shorewall\u2212ipsets<\/font><\/b> <small><font color=\"#000000\">[2]<\/font><\/small> <font color=\"#000000\">(5)). The semantics of these lists when used in an exclusion are as follows:<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">\u2022 !+[<i>set1<\/i>,<i>set2<\/i>,&#8230;<i>setN<\/i>] produces a packet match if the packet does not match at least one of the sets. In other words, it is like NOT match <i>set1<\/i> OR NOT match <i>set2<\/i> &#8230; OR NOT match <i>setN<\/i>.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">\u2022 +[!<i>set1<\/i>,!<i>set2<\/i>,&#8230;!<i>setN<\/i>] produces a packet match if the packet does not match any of the sets. In other words, it is like NOT match <i>set1<\/i> AND NOT match <i>set2<\/i> &#8230; AND NOT match <i>setN<\/i>.<\/font><\/p>\n<h2>EXAMPLES <a name=\"EXAMPLES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">IPv4 Example 1 \u2212 All IPv4 addresses except 192.168.3.4<\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">!192.168.3.4<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">IPv4 Example 2 \u2212 All IPv4 addresses except the network 192.168.1.0\/24 and the host 10.2.3.4<\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">!192.168.1.0\/24,10.1.3.4<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">IPv4 Example 3 \u2212 All IPv4 addresses except the range 192.168.1.3\u2212192.168.1.12 and the network 10.0.0.0\/8<\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">!192.168.1.3\u2212192.168.1.12,10.0.0.0\/8<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">IPv4 Example 4 \u2212 The network 192.168.1.0\/24 except hosts 192.168.1.3 and 192.168.1.9<\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">192.168.1.0\/24!192.168.1.3,192.168.1.9<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">Example 5 \u2212 All parent zones except loc<\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">any!loc<\/font><\/p>\n<h2>FILES <a name=\"FILES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">\/etc\/shorewall\/hosts<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">\/etc\/shorewall\/masq<\/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\/shorewall\/tcrules<\/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=\"23%\">\n<p style=\"margin-top: 1em\"><font color=\"#000000\">shorewall-rules<\/font><\/p>\n<\/td>\n<td width=\"60%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">https:\/\/shorewall.org\/manpages\/shorewall-rules.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=\"25%\">\n<p style=\"margin-top: 1em\"><font color=\"#000000\">shorewall-ipsets<\/font><\/p>\n<\/td>\n<td width=\"58%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">https:\/\/shorewall.org\/manpages\/shorewall-ipsets.html<\/font><\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  exclusion \u2212 Exclude a set of hosts from a definition in a shorewall configuration 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,1563],"class_list":["post-4622","post","type-post","status-publish","format-standard","hentry","category-5-formatos-de-ficheros","tag-961","tag-man5","tag-shorewall-exclusion"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/4622","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=4622"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/4622\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=4622"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=4622"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=4622"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}