2010-09-21 00:34:04 +02:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
|
|
|
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
|
|
|
|
<refentry>
|
|
|
|
<refmeta>
|
|
|
|
<refentrytitle>shorewall-ipsets</refentrytitle>
|
|
|
|
|
|
|
|
<manvolnum>5</manvolnum>
|
2014-01-16 17:32:57 +01:00
|
|
|
|
|
|
|
<refmiscinfo>Configuration Files</refmiscinfo>
|
2010-09-21 00:34:04 +02:00
|
|
|
</refmeta>
|
|
|
|
|
|
|
|
<refnamediv>
|
|
|
|
<refname>ipsets</refname>
|
|
|
|
|
|
|
|
<refpurpose>Specifying the name if an ipset in Shorewall configuration
|
|
|
|
files</refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
|
|
|
|
<refsynopsisdiv>
|
|
|
|
<cmdsynopsis>
|
|
|
|
<command>+<replaceable>ipsetname</replaceable></command>
|
|
|
|
</cmdsynopsis>
|
|
|
|
|
|
|
|
<cmdsynopsis>
|
|
|
|
<command>+<replaceable>ipsetname</replaceable>[<replaceable>flag</replaceable>,...]</command>
|
|
|
|
</cmdsynopsis>
|
|
|
|
|
|
|
|
<cmdsynopsis>
|
|
|
|
<command>+[ipsetname,...]</command>
|
|
|
|
</cmdsynopsis>
|
|
|
|
</refsynopsisdiv>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
|
|
|
|
|
|
|
<para>Note: In the above syntax descriptions, the square brackets ("[]")
|
|
|
|
are to be taken literally rather than as meta-characters.</para>
|
|
|
|
|
|
|
|
<para>In most places where a network address may be entered, an ipset may
|
|
|
|
be substituted. Set names must be prefixed by the character "+", must
|
|
|
|
start with a letter and may be composed of alphanumeric characters, "-"
|
|
|
|
and "_".</para>
|
|
|
|
|
|
|
|
<para>Whether the set is matched against the packet source or destination
|
|
|
|
is determined by which column the set name appears (SOURCE or DEST). For
|
2013-05-03 18:19:45 +02:00
|
|
|
those set types that specify a tuple, two alternative syntaxes are
|
2010-09-21 00:34:04 +02:00
|
|
|
available:</para>
|
|
|
|
|
|
|
|
<simplelist>
|
|
|
|
<member>[<replaceable>number</replaceable>] - Indicates that 'src' or
|
2014-01-02 23:43:55 +01:00
|
|
|
'dst' should be repeated <replaceable>number</replaceable> times.
|
|
|
|
Example: myset[2].</member>
|
2010-09-21 00:34:04 +02:00
|
|
|
|
|
|
|
<member>[<replaceable>flag</replaceable>,...] where
|
|
|
|
<replaceable>flag</replaceable> is <option>src</option> or
|
|
|
|
<option>dst</option>. Example: myset[src,dst].</member>
|
|
|
|
</simplelist>
|
|
|
|
|
2014-01-03 18:23:14 +01:00
|
|
|
<para>In a SOURCE or SOURCE PORT(S) column, the following pairs are
|
|
|
|
equivalent:</para>
|
2010-09-21 00:34:04 +02:00
|
|
|
|
|
|
|
<itemizedlist>
|
|
|
|
<listitem>
|
|
|
|
<para>+myset[2] and +myset[src,src]</para>
|
|
|
|
</listitem>
|
|
|
|
</itemizedlist>
|
|
|
|
|
2014-01-03 18:23:14 +01:00
|
|
|
<para>In a DEST or DEST PORT(S) column, the following pairs are
|
|
|
|
equivalent:</para>
|
2010-09-21 00:34:04 +02:00
|
|
|
|
|
|
|
<itemizedlist>
|
|
|
|
<listitem>
|
|
|
|
<para>+myset[2] and +myset[dst,dst]</para>
|
|
|
|
</listitem>
|
|
|
|
</itemizedlist>
|
|
|
|
|
|
|
|
<para>Beginning with Shorewall 4.4.14, multiple source or destination
|
|
|
|
matches may be specified by enclosing the set names within +[...]. The set
|
2011-07-26 22:15:10 +02:00
|
|
|
names need not be prefixed with '+'. When such a list of sets is
|
|
|
|
specified, matching packets must match all of the listed sets.</para>
|
|
|
|
|
|
|
|
<para>For information about set lists and exclusion, see <ulink
|
2014-01-16 17:32:57 +01:00
|
|
|
url="/manpages/shorewall-exclusion.html">shorewall-exclusion</ulink>
|
|
|
|
(5).</para>
|
2013-04-19 19:44:57 +02:00
|
|
|
|
|
|
|
<para>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.</para>
|
|
|
|
|
|
|
|
<para>Example:</para>
|
|
|
|
|
|
|
|
<simplelist>
|
|
|
|
<member>+myset[src](myobject)</member>
|
|
|
|
</simplelist>
|
|
|
|
|
|
|
|
<para>In that example, when the source address of a packet matches the
|
|
|
|
<emphasis role="bold">myset</emphasis> ipset, the <emphasis
|
|
|
|
role="bold">myobject</emphasis> nfacct counter will be incremented.</para>
|
2014-01-02 23:43:55 +01:00
|
|
|
|
|
|
|
<para>Beginning with Shorewall 4.6.0, an ipset name (and src/dst list, if
|
2014-02-04 21:16:35 +01:00
|
|
|
any) can be immediately be followed by a list of match options.</para>
|
|
|
|
|
|
|
|
<important>
|
|
|
|
<para>These additional match options are not available in <ulink
|
|
|
|
url="shorewall-tcfilters.html">shorewall-tcfilters(5)</ulink>.</para>
|
|
|
|
</important>
|
|
|
|
|
|
|
|
<para>Available options are:</para>
|
2014-01-02 23:43:55 +01:00
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term>nomatch</term>
|
|
|
|
|
|
|
|
<listitem>
|
2014-01-03 18:23:14 +01:00
|
|
|
<para>If the set type supports the nomatch flag, then the matching
|
2014-01-02 23:43:55 +01:00
|
|
|
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 'Ipset Match nomatch' capability in your kernel and
|
|
|
|
ip[6]tables.</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term>no-update-counters</term>
|
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>The packet and byte counters of the matching element in the
|
|
|
|
set won't be updated. By default, the packet and byte counters are
|
|
|
|
updated. This option and those that follow require the 'Ipset Match
|
|
|
|
counters' capability in your kernel and ip[6]tables.</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term>no-update-subcounters</term>
|
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>The packet and byte counters of the matching element in the
|
|
|
|
member set of a list type of set won't be updated. Default the
|
|
|
|
packet and byte counters are updated.</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term>packets=<replaceable>value</replaceable></term>
|
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>If the packet is matched an element in the set, match only if
|
|
|
|
the packet counter of the element matches the given
|
2014-01-03 18:23:14 +01:00
|
|
|
<replaceable>value</replaceable> also.</para>
|
2014-01-02 23:43:55 +01:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term>packets<<replaceable>value</replaceable></term>
|
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>If the packet is matched an element in the set, match only if
|
|
|
|
the packet counter of the element is less than the given
|
|
|
|
<replaceable>value</replaceable> as well.</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term>packets><replaceable>value</replaceable></term>
|
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>If the packet is matched an element in the set, match only if
|
|
|
|
the packet counter of the element is greater than the given
|
|
|
|
<replaceable>value</replaceable> as well.</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term>packets!=<replaceable>value</replaceable></term>
|
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>If the packet is matched an element in the set, match only if
|
|
|
|
the packet counter of the element does not match the given
|
2014-01-03 18:23:14 +01:00
|
|
|
<replaceable>value</replaceable> also.</para>
|
2014-01-02 23:43:55 +01:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term>bytes=<replaceable>value</replaceable></term>
|
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>If the packet is matched an element in the set, match only if
|
|
|
|
the byte counter of the element matches the given
|
2014-01-03 18:23:14 +01:00
|
|
|
<replaceable>value</replaceable> also.</para>
|
2014-01-02 23:43:55 +01:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term>bytes<<replaceable>value</replaceable></term>
|
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>If the packet is matched an element in the set, match only if
|
|
|
|
the byte counter of the element is less than the given
|
|
|
|
<replaceable>value</replaceable> as well.</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term>bytes><replaceable>value</replaceable></term>
|
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>If the packet is matched an element in the set, match only if
|
|
|
|
the byte counter of the element is greater than the given
|
|
|
|
<replaceable>value</replaceable> as well.</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
2014-01-03 18:23:14 +01:00
|
|
|
<term>bytes<><replaceable>value</replaceable></term>
|
2014-01-02 23:43:55 +01:00
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>If the packet is matched an element in the set, match only if
|
|
|
|
the byte counter of the element does not match the given
|
2014-01-03 18:23:14 +01:00
|
|
|
<replaceable>value</replaceable> also.</para>
|
2014-01-02 23:43:55 +01:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
2010-09-21 00:34:04 +02:00
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>Examples</title>
|
|
|
|
|
2014-01-02 23:43:55 +01:00
|
|
|
<para>In the examples that follow, <firstterm>myset</firstterm>,
|
|
|
|
<firstterm>myset1</firstterm> and <firstterm>myset2</firstterm> are ipsets
|
|
|
|
and <firstterm>myObject</firstterm> is an NFacct object name.</para>
|
|
|
|
|
2010-09-21 00:34:04 +02:00
|
|
|
<para>+myset</para>
|
|
|
|
|
|
|
|
<para>+myset[src]</para>
|
|
|
|
|
|
|
|
<para>+myset[2]</para>
|
|
|
|
|
|
|
|
<para>+[myset1,myset2[dst]]</para>
|
2014-01-02 23:43:55 +01:00
|
|
|
|
|
|
|
<para>+myset[src](myObject)</para>
|
|
|
|
|
|
|
|
<para>+myset[src,nomatch,packets>100]</para>
|
|
|
|
|
|
|
|
<para>+myset[nomatch,no-update-counters](myObject)</para>
|
2010-09-21 00:34:04 +02:00
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>FILES</title>
|
|
|
|
|
|
|
|
<para>/etc/shorewall/accounting</para>
|
|
|
|
|
2014-01-03 18:23:14 +01:00
|
|
|
<para>/etc/shorewall/blrules</para>
|
2010-09-21 00:34:04 +02:00
|
|
|
|
2010-09-25 00:44:44 +02:00
|
|
|
<para>/etc/shorewall/hosts -- <emphasis role="bold">Note:</emphasis>
|
|
|
|
Multiple matches enclosed in +[...] may not be used in this file.</para>
|
2010-09-21 00:34:04 +02:00
|
|
|
|
2010-09-26 01:07:56 +02:00
|
|
|
<para>/etc/shorewall/maclist -- <emphasis role="bold">Note:</emphasis>
|
|
|
|
Multiple matches enclosed in +[...] may not be used in this file.</para>
|
|
|
|
|
2010-09-21 00:34:04 +02:00
|
|
|
<para>/etc/shorewall/masq</para>
|
|
|
|
|
|
|
|
<para>/etc/shorewall/rules</para>
|
|
|
|
|
|
|
|
<para>/etc/shorewall/secmarks</para>
|
|
|
|
|
2014-01-02 23:43:55 +01:00
|
|
|
<para>/etc/shorewall/mangle</para>
|
2010-09-21 00:34:04 +02:00
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>See ALSO</title>
|
|
|
|
|
|
|
|
<para>shorewall(8), shorewall-accounting(5), shorewall-actions(5),
|
2010-09-21 00:37:42 +02:00
|
|
|
shorewall-blacklist(5), shorewall-hosts(5), shorewall_interfaces(5),
|
2010-09-21 00:34:04 +02:00
|
|
|
shorewall-maclist(5), shorewall-masq(5), shorewall-nat(5),
|
|
|
|
shorewall-netmap(5), shorewall-params(5), shorewall-policy(5),
|
2012-01-09 16:19:10 +01:00
|
|
|
shorewall-providers(5), shorewall-proxyarp(5), shorewall-rtrules(5),
|
2010-09-21 00:34:04 +02:00
|
|
|
shorewall-routestopped(5), shorewall-rules(5), shorewall.conf(5),
|
|
|
|
shorewall-secmarks(5), shorewall-tcclasses(5), shorewall-tcdevices(5),
|
2013-12-29 00:35:08 +01:00
|
|
|
shorewall-mangle(5), shorewall-tos(5), shorewall-tunnels(5),
|
2010-09-21 00:34:04 +02:00
|
|
|
shorewall-zones(5)</para>
|
|
|
|
</refsect1>
|
|
|
|
</refentry>
|