2006-11-16 02:35:48 +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-16 02:35:48 +01:00
|
|
|
<refentry>
|
|
|
|
<refmeta>
|
2012-01-09 16:19:10 +01:00
|
|
|
<refentrytitle>shorewall-rtrules</refentrytitle>
|
2006-11-16 02:35:48 +01:00
|
|
|
|
|
|
|
<manvolnum>5</manvolnum>
|
2014-01-16 17:32:57 +01:00
|
|
|
|
|
|
|
<refmiscinfo>Configuration Files</refmiscinfo>
|
2006-11-16 02:35:48 +01:00
|
|
|
</refmeta>
|
|
|
|
|
|
|
|
<refnamediv>
|
2012-01-09 16:19:10 +01:00
|
|
|
<refname>rtrules</refname>
|
2006-11-16 02:35:48 +01:00
|
|
|
|
|
|
|
<refpurpose>Shorewall Routing Rules file</refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
|
|
|
|
<refsynopsisdiv>
|
|
|
|
<cmdsynopsis>
|
2012-01-09 16:19:10 +01:00
|
|
|
<command>/etc/shorewall/rtrules</command>
|
2006-11-16 02:35:48 +01:00
|
|
|
</cmdsynopsis>
|
|
|
|
</refsynopsisdiv>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
|
|
|
|
2006-11-20 18:52:52 +01:00
|
|
|
<para>Entries in this file cause traffic to be routed to one of the
|
2007-01-14 23:34:51 +01:00
|
|
|
providers listed in <ulink
|
2014-01-12 22:40:03 +01:00
|
|
|
url="/manpages/shorewall-providers.html">shorewall-providers</ulink>(5).</para>
|
2006-11-16 02:35:48 +01:00
|
|
|
|
|
|
|
<para>The columns in the file are as follows.</para>
|
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
2008-07-10 15:33:54 +02:00
|
|
|
<term><emphasis role="bold">SOURCE</emphasis> (Optional) - {<emphasis
|
2012-01-06 21:54:37 +01:00
|
|
|
role="bold">-</emphasis>|[&]<emphasis>interface</emphasis>|<emphasis>address</emphasis>|<emphasis>interface</emphasis><firstterm>:</firstterm><emphasis>address</emphasis>}</term>
|
2006-11-16 02:35:48 +01:00
|
|
|
|
|
|
|
<listitem>
|
2006-11-23 00:48:09 +01:00
|
|
|
<para>An ip <emphasis>address</emphasis> (network or host) that
|
|
|
|
matches the source IP address in a packet. May also be specified as
|
|
|
|
an <emphasis>interface</emphasis> name optionally followed by ":"
|
|
|
|
and an address. If the device <emphasis role="bold">lo</emphasis> is
|
|
|
|
specified, the packet must originate from the firewall
|
|
|
|
itself.</para>
|
2012-01-06 21:54:37 +01:00
|
|
|
|
|
|
|
<para>Beginning with Shorewall 4.5.0, you may specify
|
|
|
|
&<replaceable>interface</replaceable> in this column to indicate
|
|
|
|
that the source is the primary IP address of the named
|
|
|
|
interface.</para>
|
2015-03-18 23:16:25 +01:00
|
|
|
|
|
|
|
<para>Beginning with Shorewall 4.6.8, you may specify a
|
|
|
|
comma-separated list of addresses in this column.</para>
|
2006-11-16 02:35:48 +01:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
2008-07-10 15:33:54 +02:00
|
|
|
<term><emphasis role="bold">DEST</emphasis> (Optional) - {<emphasis
|
2006-11-23 00:48:09 +01:00
|
|
|
role="bold">-</emphasis>|<emphasis>address</emphasis>}</term>
|
2006-11-16 02:35:48 +01:00
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>An ip address (network or host) that matches the destination
|
|
|
|
IP address in a packet.</para>
|
|
|
|
|
|
|
|
<para>If you choose to omit either <emphasis
|
|
|
|
role="bold">SOURCE</emphasis> or <emphasis
|
|
|
|
role="bold">DEST</emphasis>, place "-" in that column. Note that you
|
|
|
|
may not omit both <emphasis role="bold">SOURCE</emphasis> and
|
|
|
|
<emphasis role="bold">DEST</emphasis>.</para>
|
2015-03-18 23:16:25 +01:00
|
|
|
|
|
|
|
<para>Beginning with Shorewall 4.6.8, you may specify a
|
|
|
|
comma-separated list of addresses in this column.</para>
|
2006-11-16 02:35:48 +01:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
2008-07-10 15:33:54 +02:00
|
|
|
<term><emphasis role="bold">PROVIDER</emphasis> -
|
2006-11-23 00:48:09 +01:00
|
|
|
{<emphasis>provider-name</emphasis>|<emphasis>provider-number</emphasis>|<emphasis
|
|
|
|
role="bold">main</emphasis>}</term>
|
2006-11-16 02:35:48 +01:00
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>The provider to route the traffic through. May be expressed
|
|
|
|
either as the provider name or the provider number. May also be
|
|
|
|
<emphasis role="bold">main</emphasis> or 254 for the main routing
|
|
|
|
table. This can be used in combination with VPN tunnels, see example
|
|
|
|
2 below.</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
2006-11-23 00:48:09 +01:00
|
|
|
<term><emphasis role="bold">PRIORITY</emphasis> -
|
2015-10-26 00:45:11 +01:00
|
|
|
<emphasis>priority</emphasis><emphasis
|
|
|
|
role="bold">[!]</emphasis></term>
|
2006-11-16 02:35:48 +01:00
|
|
|
|
|
|
|
<listitem>
|
2006-11-23 00:48:09 +01:00
|
|
|
<para>The rule's numeric <emphasis>priority</emphasis> which
|
2006-11-23 19:13:29 +01:00
|
|
|
determines the order in which the rules are processed. Rules with
|
|
|
|
equal priority are applied in the order in which they appear in the
|
|
|
|
file.</para>
|
2006-11-16 02:35:48 +01:00
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term>1000-1999</term>
|
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>Before Shorewall-generated 'MARK' rules</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term>11000-11999</term>
|
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>After 'MARK' rules but before Shorewall-generated rules
|
|
|
|
for ISP interfaces.</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term>26000-26999</term>
|
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>After ISP interface rules but before 'default'
|
|
|
|
rule.</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
2015-10-26 00:45:11 +01:00
|
|
|
|
|
|
|
<para>Beginning with Shorewall 5.0.2, the priority may be followed
|
|
|
|
optionally by an exclaimation mark ("!"). This causes the rule to
|
|
|
|
remain in place if the interface is disabled.</para>
|
2017-02-10 20:43:04 +01:00
|
|
|
|
|
|
|
<caution>
|
|
|
|
<para>Be careful when using rules of the same PRIORITY as some
|
|
|
|
unexpected behavior can occur when multiple rules have the same
|
|
|
|
SOURCE. For example, in the following rules, the second rule
|
|
|
|
overwrites the first unless the priority in the second is changed
|
|
|
|
to 19001 or higher:</para>
|
|
|
|
|
|
|
|
<programlisting>10.10.0.0/24 192.168.5.6 provider1 19000
|
|
|
|
10.10.0.0/24 - provider2 19000</programlisting>
|
|
|
|
</caution>
|
2006-11-16 02:35:48 +01:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2011-10-23 16:56:53 +02:00
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term><emphasis role="bold">MARK -
|
|
|
|
{-|<replaceable>mark</replaceable>[/<replaceable>mask</replaceable>]}</emphasis></term>
|
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>Optional -- added in Shorewall 4.4.25. For this rule to be
|
|
|
|
applied to a packet, the packet's mark value must match the
|
|
|
|
<replaceable>mark</replaceable> when logically anded with the
|
|
|
|
<replaceable>mask</replaceable>. If a
|
|
|
|
<replaceable>mask</replaceable> is not supplied, Shorewall supplies
|
|
|
|
a suitable provider mask.</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2006-11-16 02:35:48 +01:00
|
|
|
</variablelist>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>Examples</title>
|
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term>Example 1:</term>
|
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>You want all traffic coming in on eth1 to be routed to the
|
|
|
|
ISP1 provider.</para>
|
|
|
|
|
2011-10-23 16:56:53 +02:00
|
|
|
<programlisting> #SOURCE DEST PROVIDER PRIORITY MASK
|
2006-11-16 02:35:48 +01:00
|
|
|
eth1 - ISP1 1000
|
|
|
|
</programlisting>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term>Example 2:</term>
|
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>You use OpenVPN (routed setup /tunX) in combination with
|
|
|
|
multiple providers. In this case you have to set up a rule to ensure
|
|
|
|
that the OpenVPN traffic is routed back through the tunX
|
|
|
|
interface(s) rather than through any of the providers. 10.8.0.0/24
|
2006-11-20 18:52:52 +01:00
|
|
|
is the subnet chosen in your OpenVPN configuration (server 10.8.0.0
|
2006-11-16 02:35:48 +01:00
|
|
|
255.255.255.0).</para>
|
|
|
|
|
2011-10-23 16:56:53 +02:00
|
|
|
<programlisting> #SOURCE DEST PROVIDER PRIORITY MASK
|
2006-11-16 02:35:48 +01:00
|
|
|
- 10.8.0.0/24 main 1000
|
|
|
|
</programlisting>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>FILES</title>
|
|
|
|
|
2012-01-09 16:19:10 +01:00
|
|
|
<para>/etc/shorewall/rtrules</para>
|
2006-11-16 02:35:48 +01:00
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>See ALSO</title>
|
|
|
|
|
2006-11-22 04:51:39 +01:00
|
|
|
<para><ulink
|
2014-01-12 22:40:03 +01:00
|
|
|
url="/MultiISP.html">http://www.shorewall.net/MultiISP.html</ulink></para>
|
2006-11-22 04:51:39 +01:00
|
|
|
|
2011-09-26 19:16:52 +02:00
|
|
|
<para><ulink
|
2014-01-12 22:40:03 +01:00
|
|
|
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
2011-09-26 19:16:52 +02:00
|
|
|
|
2006-11-16 02:35:48 +01:00
|
|
|
<para>shorewall(8), shorewall-accounting(5), shorewall-actions(5),
|
2011-09-26 19:16:52 +02:00
|
|
|
shorewall-blacklist(5), shorewall-hosts(5), shorewall_interfaces(5),
|
|
|
|
shorewall-ipsets(5), shorewall-maclist(5), shorewall-masq(5),
|
|
|
|
shorewall-nat(5), shorewall-netmap(5), shorewall-params(5),
|
|
|
|
shorewall-policy(5), shorewall-providers(5), shorewall-proxyarp(5),
|
|
|
|
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),
|
2011-09-26 19:16:52 +02:00
|
|
|
shorewall-zones(5)</para>
|
2006-11-16 02:35:48 +01:00
|
|
|
</refsect1>
|
2010-07-19 23:45:05 +02:00
|
|
|
</refentry>
|