<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
                 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<!-- For license information see sanewall-manual-info.xml.in -->
<refentry id="cmd-group">

<refmeta>
<refentrytitle>group command: sanewall-group</refentrytitle>
<manvolnum>5</manvolnum>
</refmeta>

<refnamediv>
<refdescriptor>sanewall-group</refdescriptor>
<refname>sanewall-group</refname>
<refpurpose>group commands with common options</refpurpose>
</refnamediv>

<refsynopsisdiv>
  <cmdsynopsis>
    <command>group</command>
    <arg choice="plain">with</arg>
    <arg choice="opt"><replaceable>rule-params</replaceable></arg>
  </cmdsynopsis>
  <cmdsynopsis>
    <command>group</command>
    <arg choice="plain">end</arg>
  </cmdsynopsis>
</refsynopsisdiv>

<refsect1><title>Description</title>
  <para>
    The <command>group</command> command allows you to group together
    multiple <command>client</command> and <command>server</command>
    commands.
  </para>
  <para>
    Grouping commands with common options (see <xref linkend="rule-params"/>)
    allows the option values to be checked only once in the generated
    firewall rather than once per service, making it more efficient.
  </para>
  <para>
    Nested groups may be used.
  </para>
</refsect1>

<refsect1><title>Examples</title>
  <para>
     This:
    <programlisting>
interface any world
    client all accept
    server http accept

    # Provide these services to trusted hosts only
    server "ssh telnet" accept src "192.0.2.1 192.0.2.2"
    </programlisting>
  </para>
  <para>
     can be replaced to produce a more efficient firewall by this:
    <programlisting>
interface any world
    client all accept
    server http accept

    # Provide these services to trusted hosts only
    group with src "192.0.2.1 192.0.2.2"
        server ssh telnet
        server ssh accept
    group end
    </programlisting>
  </para>
</refsect1>

<refsect1><title>See Also</title>
  <simplelist type="vert">
    <member><xref linkend="sanewall"/></member>
    <member><xref linkend="sanewall.conf"/></member>
    <member><xref linkend="def-interface"/></member>
    <member><xref linkend="def-router"/></member>
    <member><xref linkend="rule-params"/></member>
  </simplelist>
</refsect1>

</refentry>
