2006-11-25 19:06:11 +01:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
2010-07-19 23:45:05 +02:00
|
|
|
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
|
|
|
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
|
2006-11-25 19:06:11 +01:00
|
|
|
<refentry>
|
|
|
|
<refmeta>
|
|
|
|
<refentrytitle>shorewall-exclusion</refentrytitle>
|
|
|
|
|
|
|
|
<manvolnum>5</manvolnum>
|
2014-01-16 17:32:57 +01:00
|
|
|
|
|
|
|
<refmiscinfo>Configuration Files</refmiscinfo>
|
2006-11-25 19:06:11 +01:00
|
|
|
</refmeta>
|
|
|
|
|
|
|
|
<refnamediv>
|
|
|
|
<refname>exclusion</refname>
|
|
|
|
|
|
|
|
<refpurpose>Exclude a set of hosts from a definition in a shorewall
|
|
|
|
configuration file.</refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
|
|
|
|
<refsynopsisdiv>
|
|
|
|
<cmdsynopsis>
|
2007-01-16 22:22:28 +01:00
|
|
|
<arg choice="plain"
|
|
|
|
rep="repeat"><option>!</option><replaceable>address-or-range</replaceable>[,<replaceable>address-or-range</replaceable>]</arg>
|
2006-11-25 19:06:11 +01:00
|
|
|
</cmdsynopsis>
|
2010-08-19 01:10:58 +02:00
|
|
|
|
|
|
|
<cmdsynopsis>
|
|
|
|
<arg choice="plain"
|
|
|
|
rep="repeat"><option>!</option><replaceable>zone-name</replaceable>[,<replaceable>zone-name</replaceable>]</arg>
|
|
|
|
</cmdsynopsis>
|
2006-11-25 19:06:11 +01:00
|
|
|
</refsynopsisdiv>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
|
|
|
|
2010-08-19 01:10:58 +02:00
|
|
|
<para>The first form of exclusion is used when you wish to exclude one or
|
2013-05-03 18:19:45 +02:00
|
|
|
more addresses from a definition. An exclamation point is followed by a
|
2010-08-19 01:10:58 +02:00
|
|
|
comma-separated 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
|
2006-11-25 19:06:11 +01:00
|
|
|
<emphasis>lowaddress</emphasis>-<emphasis>highaddress</emphasis></para>
|
|
|
|
|
2013-05-03 18:19:45 +02:00
|
|
|
<para>No embedded white-space is allowed.</para>
|
2007-01-17 21:47:28 +01:00
|
|
|
|
|
|
|
<para>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.</para>
|
2010-08-19 01:10:58 +02:00
|
|
|
|
|
|
|
<para>Beginning in Shorewall 4.4.13, the second form of exclusion is
|
|
|
|
allowed after <emphasis role="bold">all</emphasis> and <emphasis
|
2017-06-17 00:01:41 +02:00
|
|
|
role="bold">any</emphasis> in the SOURCE and DEST columns of <ulink
|
|
|
|
url="/manpages/shorewall-rules.html">shorewall-rules</ulink>(5). It allows
|
|
|
|
you to omit arbitrary zones from the list generated by those key
|
|
|
|
words.</para>
|
2010-08-19 01:10:58 +02:00
|
|
|
|
|
|
|
<warning>
|
|
|
|
<para>If you omit a sub-zone 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.</para>
|
|
|
|
|
|
|
|
<para>For example:</para>
|
|
|
|
|
|
|
|
<blockquote>
|
|
|
|
<para>/etc/shorewall/zones:</para>
|
|
|
|
|
|
|
|
<programlisting>#ZONE TYPE
|
|
|
|
z1 ip
|
|
|
|
z2:z1 ip
|
|
|
|
...</programlisting>
|
|
|
|
|
|
|
|
<para>/etc/shorewall/policy:</para>
|
|
|
|
|
|
|
|
<programlisting>#SOURCE DEST POLICY
|
|
|
|
z1 net CONTINUE
|
|
|
|
z2 net REJECT</programlisting>
|
|
|
|
|
|
|
|
<para>/etc/shorewall/rules:</para>
|
|
|
|
|
2015-12-04 23:53:26 +01:00
|
|
|
<programlisting>#ACTION SOURCE DEST PROTO DPORT
|
2010-08-19 01:10:58 +02:00
|
|
|
ACCEPT all!z2 net tcp 22</programlisting>
|
|
|
|
|
|
|
|
<para>In this case, SSH connections from <emphasis
|
|
|
|
role="bold">z2</emphasis> to <emphasis role="bold">net</emphasis> will
|
|
|
|
be accepted by the generated <emphasis role="bold">z1</emphasis> to
|
|
|
|
net ACCEPT rule.</para>
|
|
|
|
</blockquote>
|
|
|
|
</warning>
|
2010-10-05 22:45:50 +02:00
|
|
|
|
|
|
|
<para>In most contexts, ipset names can be used as an
|
|
|
|
<replaceable>address-or-range</replaceable>. Beginning with Shorewall
|
|
|
|
4.4.14, ipset lists enclosed in +[...] may also be included (see <ulink
|
2014-01-16 17:32:57 +01:00
|
|
|
url="/manpages/shorewall-ipsets.html">shorewall-ipsets</ulink> (5)). The
|
|
|
|
semantics of these lists when used in an exclusion are as follows:</para>
|
2010-10-05 22:45:50 +02:00
|
|
|
|
|
|
|
<itemizedlist>
|
|
|
|
<listitem>
|
|
|
|
<para>!+[<replaceable>set1</replaceable>,<replaceable>set2</replaceable>,...<replaceable>setN</replaceable>]
|
|
|
|
produces a packet match if the packet does not match at least one of
|
|
|
|
the sets. In other words, it is like NOT match
|
|
|
|
<replaceable>set1</replaceable> OR NOT match
|
|
|
|
<replaceable>set2</replaceable> ... OR NOT match
|
|
|
|
<replaceable>setN</replaceable>.</para>
|
|
|
|
</listitem>
|
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>+[!<replaceable>set1</replaceable>,!<replaceable>set2</replaceable>,...!<replaceable>setN</replaceable>]
|
|
|
|
produces a packet match if the packet does not match any of the sets.
|
|
|
|
In other words, it is like NOT match <replaceable>set1</replaceable>
|
|
|
|
AND NOT match <replaceable>set2</replaceable> ... AND NOT match
|
|
|
|
<replaceable>setN</replaceable>.</para>
|
|
|
|
</listitem>
|
|
|
|
</itemizedlist>
|
2006-11-25 19:06:11 +01:00
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1>
|
2007-01-17 21:47:28 +01:00
|
|
|
<title>Examples</title>
|
2006-11-25 19:06:11 +01:00
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
2017-06-17 00:01:41 +02:00
|
|
|
<term>IPv4 Example 1 - All IPv4 addresses except 192.168.3.4</term>
|
2006-11-25 19:06:11 +01:00
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>!192.168.3.4</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
2017-06-17 00:01:41 +02:00
|
|
|
<term>IPv4 Example 2 - All IPv4 addresses except the network
|
|
|
|
192.168.1.0/24 and the host 10.2.3.4</term>
|
2006-11-25 19:06:11 +01:00
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>!192.168.1.0/24,10.1.3.4</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
2017-06-17 00:01:41 +02:00
|
|
|
<term>IPv4 Example 3 - All IPv4 addresses except the range
|
2007-01-17 21:47:28 +01:00
|
|
|
192.168.1.3-192.168.1.12 and the network 10.0.0.0/8</term>
|
2006-11-25 19:06:11 +01:00
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>!192.168.1.3-192.168.1.12,10.0.0.0/8</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2007-01-17 21:47:28 +01:00
|
|
|
|
|
|
|
<varlistentry>
|
2017-06-17 00:01:41 +02:00
|
|
|
<term>IPv4 Example 4 - The network 192.168.1.0/24 except hosts
|
|
|
|
192.168.1.3 and 192.168.1.9</term>
|
2007-01-17 21:47:28 +01:00
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>192.168.1.0/24!192.168.1.3,192.168.1.9</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2010-08-19 01:10:58 +02:00
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term>Example 5 - All parent zones except loc</term>
|
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>any!loc</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2006-11-25 19:06:11 +01:00
|
|
|
</variablelist>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>FILES</title>
|
|
|
|
|
|
|
|
<para>/etc/shorewall/hosts</para>
|
|
|
|
|
|
|
|
<para>/etc/shorewall/masq</para>
|
|
|
|
|
|
|
|
<para>/etc/shorewall/rules</para>
|
|
|
|
|
|
|
|
<para>/etc/shorewall/tcrules</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>See ALSO</title>
|
|
|
|
|
2017-06-17 02:11:43 +02:00
|
|
|
<para>shorewall(8)</para>
|
2006-11-25 19:06:11 +01:00
|
|
|
</refsect1>
|
2010-07-19 23:45:05 +02:00
|
|
|
</refentry>
|