Sophie

Sophie

distrib > Mandriva > mes5 > x86_64 > by-pkgid > 45723c51178a73df679c2a8284d8eeff > files > 186

shorewall-doc-4.0.15-0.2mdvmes5.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Standalone Firewall</title><link rel="stylesheet" href="html.css" type="text/css" /><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /></head><body><div class="article" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="standalone"></a>Standalone Firewall</h2></div><div><div class="authorgroup"><div class="author"><h3 class="author"><span class="firstname">Tom</span> <span class="surname">Eastep</span></h3></div></div></div><div><p class="copyright">Copyright © 2002-2007 Thomas M. Eastep</p></div><div><div class="legalnotice"><a id="id289810"></a><p>Permission is granted to copy, distribute and/or modify this
      document under the terms of the GNU Free Documentation License, Version
      1.2 or any later version published by the Free Software Foundation; with
      no Invariant Sections, with no Front-Cover, and with no Back-Cover
      Texts. A copy of the license is included in the section entitled
      “<span class="quote"><a class="ulink" href="GnuCopyright.htm" target="_self">GNU Free Documentation
      License</a></span>”.</p></div></div><div><p class="pubdate">2008/12/15</p></div></div><hr /></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#Introduction">Introduction</a></span></dt><dd><dl><dt><span class="section"><a href="#System">System Requirements</a></span></dt><dt><span class="section"><a href="#Before">Before you start</a></span></dt><dt><span class="section"><a href="#Conventions">Conventions</a></span></dt></dl></dd><dt><span class="section"><a href="#PPTP">PPTP/ADSL</a></span></dt><dt><span class="section"><a href="#Concepts">Shorewall Concepts</a></span></dt><dt><span class="section"><a href="#External">External Interface</a></span></dt><dt><span class="section"><a href="#Addresses">IP Addresses</a></span></dt><dt><span class="section"><a href="#Logging">Logging</a></span></dt><dt><span class="section"><a href="#Open">Enabling other Connections</a></span></dt><dt><span class="section"><a href="#Starting">Starting and Stopping Your Firewall</a></span></dt><dt><span class="section"><a href="#Problems">If it Doesn't Work</a></span></dt><dt><span class="section"><a href="#Other">Additional Recommended Reading</a></span></dt></dl></div><div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Caution</h3><p><span class="bold"><strong>This article applies to Shorewall 4.0 and
    later. If you are running a version of Shorewall earlier than Shorewall
    4.0.0 then please see the documentation for that
    release.</strong></span></p></div><div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Caution</h3><p><span class="bold"><strong>Do not attempt to install Shorewall on a
    remote system. You are virtually assured to lock yourself out of that
    system.</strong></span></p></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Introduction"></a>Introduction</h2></div></div></div><p>Setting up Shorewall on a standalone Linux system is very easy if
    you understand the basics and follow the documentation.</p><p>This guide doesn't attempt to acquaint you with all of the features
    of Shorewall. It rather focuses on what is required to configure Shorewall
    in one of its most common configurations:</p><div class="itemizedlist"><ul type="disc"><li><p>Linux system</p></li><li><p>Single external <acronym class="acronym">IP</acronym> address</p></li><li><p>Connection through Cable Modem, <acronym class="acronym">DSL</acronym>,
        <acronym class="acronym">ISDN</acronym>, Frame Relay, dial-up... or connected to a
        <acronym class="acronym">LAN</acronym> and you simply wish to protect your Linux
        system from other systems on that <acronym class="acronym">LAN</acronym>.</p></li></ul></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="System"></a>System Requirements</h3></div></div></div><p>Shorewall requires that you have the
      <span class="command"><strong>iproute</strong></span>/<span class="command"><strong>iproute2</strong></span> package installed
      (on<span class="trademark"> RedHat</span>™, the package is called
      <span class="command"><strong>iproute</strong></span>). You can tell if this package is installed
      by the presence of an <span class="command"><strong>ip</strong></span> program on your firewall
      system. As root, you can use the <span class="command"><strong>which</strong></span> command to
      check for this program:</p><pre class="programlisting">[root@gateway root]# <span class="command"><strong>which ip</strong></span>
/sbin/ip
[root@gateway root]#</pre></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="Before"></a>Before you start</h3></div></div></div><p>I recommend that you read through the guide first to familiarize
      yourself with what's involved then go back through it again making your
      configuration changes.</p><div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Caution</h3><p>If you edit your configuration files on a
        <span class="trademark">Windows</span>™ system, you must save them as
        <span class="trademark">Unix</span>™ files if your editor supports that option
        or you must run them through <span class="command"><strong>dos2unix</strong></span> before trying
        to use them. Similarly, if you copy a configuration file from your
        <span class="trademark">Windows</span>™ hard drive to a floppy disk, you must
        run <span class="command"><strong>dos2unix</strong></span> against the copy before using it with
        Shorewall. </p><div class="itemizedlist"><ul type="disc"><li><p><a class="ulink" href="http://www.simtel.net/pub/pd/51438.html" target="_self"><span class="trademark">Windows</span>™
              Version of <span class="command"><strong>dos2unix</strong></span></a></p></li><li><p><a class="ulink" href="http://www.megaloman.com/%7Ehany/software/hd2u/" target="_self">Linux
              Version of <span class="command"><strong>dos2unix</strong></span></a></p></li></ul></div></div></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="Conventions"></a>Conventions</h3></div></div></div><p>Points at which configuration changes are recommended are flagged
      with <img src="images/BD21298_.gif" />.</p></div></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="PPTP"></a>PPTP/ADSL</h2></div></div></div><p><img src="images/BD21298_.gif" /></p><p>If you have an <acronym class="acronym">ADSL</acronym> Modem and you use
    <acronym class="acronym">PPTP</acronym> to communicate with a server in that modem, you
    must make the changes recommended <a class="ulink" href="PPTP.htm#PPTP_ADSL" target="_self">here</a> in addition to those detailed below.
    <acronym class="acronym">ADSL</acronym> with <acronym class="acronym">PPTP</acronym> is most commonly
    found in Europe, notably in Austria.</p></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Concepts"></a>Shorewall Concepts</h2></div></div></div><p><img src="images/BD21298_.gif" /></p><p>The configuration files for Shorewall are contained in the directory
    <code class="filename">/etc/shorewall</code> -- for simple
    setups, you only need to deal with a few of these as described in this
    guide. After you have <a class="ulink" href="Install.htm" target="_self">installed
    Shorewall</a>, you can find the Samples as follows:</p><div class="orderedlist"><ol type="1"><li><p>If you installed using an <acronym class="acronym">RPM</acronym>, the samples
        will be in the <code class="filename">Samples/one-interface</code> subdirectory of the
        Shorewall documentation directory. If you don't know where the
        Shorewall documentation directory is, you can find the samples using
        this command:</p><pre class="programlisting">~# rpm -ql shorewall-common | fgrep one-interface
/usr/share/doc/packages/shorewall/Samples/one-interface
/usr/share/doc/packages/shorewall/Samples/one-interface/interfaces
/usr/share/doc/packages/shorewall/Samples/one-interface/policy
/usr/share/doc/packages/shorewall/Samples/one-interface/rules
/usr/share/doc/packages/shorewall/Samples/one-interface/zones
~#</pre></li><li><p>If you installed using the tarball, the samples are in the
        <code class="filename">Samples/one-interface</code> directory
        in the tarball.</p></li><li><p>If you installed using a Shorewall 3.x .deb, the samples are in
        <code class="filename">/usr/share/doc/shorewall/examples/one-interface</code>.
        You must install the shorewall-doc package.</p></li><li><p>If you installed using a Shorewall 4.x .deb, the samples are in
        <code class="filename">/usr/share/doc/shorewall-common/examples/one-interface</code>..
        You do not need the shorewall-doc package to have access to the
        samples.</p></li></ol></div><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><span class="bold"><strong>Note to Debian Users</strong></span></p><p>If you install using the .deb, you will find that your <code class="filename">/etc/shorewall</code> directory is empty. This is
      intentional. The released configuration file skeletons may be found on
      your system in the directory <code class="filename">/usr/share/doc/shorewall-common/default-config</code>.
      Simply copy the files you need from that directory to <code class="filename">/etc/shorewall</code> and modify the
      copies.</p></div><p>If you are installing Shorewall version 3.4.0 or later then as each
    file is introduced, I suggest that you look at the actual file on your
    system and that you look at the <a class="ulink" href="configuration_file_basics.htm#Manpages" target="_self">man page</a> for that
    file. For example, to look at the man page for the
    <code class="filename">/etc/shorewall/zones</code> file, type <span class="command"><strong>man
    shorewall-zones</strong></span> at a shell prompt.</p><p>If you are installing a Shorewall version earlier than 3.4.0, then
    as each file is introduced, I suggest that you look through the actual
    file on your system -- each file contains detailed configuration
    instructions and default entries.</p><p>Shorewall views the network where it is running as being composed of
    a set of <span class="emphasis"><em>zones</em></span>. In the one-interface sample
    configuration, only two zones are defined:</p><pre class="programlisting">#ZONE   TYPE    OPTIONS                 IN                      OUT
#                                       OPTIONS                 OPTIONS
fw      firewall
net     ipv4</pre><p>Shorewall zones are defined in <a class="ulink" href="manpages/shorewall-zones.html" target="_self"><code class="filename">/etc/shorewall/zones</code></a>.</p><p>Note that Shorewall recognizes the firewall system as its own zone.
    When the <code class="filename">/etc/shorewall/zones</code> file is processed, the
    name of the firewall zone (“<span class="quote">fw</span>” in the above example) is
    stored in the shell variable <em class="firstterm">$FW</em> which may be used
    to refer to the firewall zone throughout the Shorewall
    configuration.</p><p>Rules about what traffic to allow and what traffic to deny are
    expressed in terms of zones.</p><div class="itemizedlist"><ul type="disc"><li><p>You express your default policy for connections from one zone to
        another zone in the <a class="ulink" href="manpages/shorewall-policy.html" target="_self"><code class="filename">/etc/shorewall/policy</code></a>
        file.</p></li><li><p>You define exceptions to those default policies in the <a class="ulink" href="manpages/shorewall-rules.html" target="_self"><code class="filename">/etc/shorewall/rules</code></a>
        file.</p></li></ul></div><p>For each connection request entering the firewall, the request is
    first checked against the
    <code class="filename"><code class="filename">/etc/shorewall/rules</code></code> file. If no
    rule in that file matches the connection request then the first policy in
    <code class="filename">/etc/shorewall/policy</code> that matches the request is
    applied. If there is a <a class="ulink" href="shorewall_extension_scripts.htm" target="_self">common
    action</a> defined for the policy in
    <code class="filename">/etc/shorewall/actions</code> or
    <code class="filename">/usr/share/shorewall/actions.std</code> then that action is
    performed before the policy is applied. The purpose of the common action is
    two-fold:</p><div class="itemizedlist"><ul type="disc"><li><p>It silently drops or rejects harmless common traffic that would
        otherwise clutter up your log — Broadcasts for example.</p></li><li><p>If ensures that traffic critical to correct operation is allowed
        through the firewall — ICMP <span class="emphasis"><em>fragmentation-needed</em></span>
        for example.</p></li></ul></div><p>The <code class="filename">/etc/shorewall/policy</code> file included with
    the one-interface sample has the following policies:</p><pre class="programlisting">#SOURCE ZONE   DESTINATION ZONE   POLICY   LOG LEVEL   LIMIT:BURST
$FW            net                ACCEPT
net            all                DROP     info
all            all                REJECT   info</pre><p>The above policy will:</p><div class="orderedlist"><ol type="1"><li><p>allow all connection requests from the firewall to the
        Internet</p></li><li><p>drop (ignore) all connection requests from the Internet to your
        firewall</p></li><li><p>reject all other connection requests (Shorewall requires this
        catchall policy).</p></li></ol></div><p>The word <em class="firstterm">info</em> in the LOG LEVEL column for the
    last two policies indicates that packets dropped or rejected under those
    policies should be <a class="ulink" href="shorewall_logging.html" target="_self">logged at that
    level</a>.</p><p>At this point, edit your <code class="filename">/etc/shorewall/policy</code>
    and make any changes that you wish.</p></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="External"></a>External Interface</h2></div></div></div><p>The firewall has a single network interface. Where Internet
    connectivity is through a cable or <acronym class="acronym">DSL</acronym>
    “<span class="quote">Modem</span>”, the <span class="emphasis"><em>External Interface</em></span> will be
    the Ethernet adapter (<code class="filename">eth0</code>) that
    is connected to that “<span class="quote">Modem</span>” <span class="underline">unless</span> you connect via
    <span class="emphasis"><em>Point-to-Point Protocol over Ethernet</em></span>
    (<acronym class="acronym">PPPoE</acronym>) or <span class="emphasis"><em>Point-to-Point Tunneling
    Protocol</em></span> (<acronym class="acronym">PPTP</acronym>) in which case the External
    Interface will be a <acronym class="acronym">PPP</acronym> interface (e.g., <code class="filename">ppp0</code>). If you connect via a regular modem,
    your External Interface will also be <code class="filename">ppp0</code>. If you connect using
    <acronym class="acronym">ISDN</acronym>, your external interface will be <code class="filename">ippp0</code>.</p><div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Caution</h3><p>Be sure you know which interface is your external interface. Many
      hours have been spent floundering by users who have configured the wrong
      interface. If you are unsure, then as root type <span class="command"><strong>ip route
      ls</strong></span> at the command line. The device listed in the last
      (default) route should be your external interface.</p><p>Example:</p><pre class="programlisting">root@lists:~# ip route ls
192.168.2.2 dev tun0  proto kernel  scope link  src 192.168.2.1 
10.13.10.0/24 dev tun1  scope link 
192.168.2.0/24 via 192.168.2.2 dev tun0 
206.124.146.0/24 dev eth0  proto kernel  scope link  src 206.124.146.176 
10.10.10.0/24 dev tun1  scope link 
default via 206.124.146.254 dev <span class="bold"><strong>eth0</strong></span> 
root@lists:~# </pre><p>In that example, <code class="filename">eth0</code> is
      the external interface.</p></div><p><img src="images/BD21298_.gif" /></p><p>The Shorewall one-interface sample configuration assumes that the
    external interface is <code class="filename">eth0</code>. If
    your configuration is different, you will have to modify the sample
    <code class="filename">/etc/shorewall/interfaces</code> file accordingly. While you
    are there, you may wish to review the list of options that are specified
    for the interface. Some hints:</p><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Tip</h3><p>If your external interface is <code class="filename">ppp0</code> or <code class="filename">ippp0</code>, you can replace the
      “<span class="quote">detect</span>” in the second column with “<span class="quote">-</span>” (minus
      the quotes).</p></div><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Tip</h3><p>If your external interface is <code class="filename">ppp0</code> or <code class="filename">ippp0</code> or if you have a static IP address,
      you can remove “<span class="quote">dhcp</span>” from the option list.</p></div></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Addresses"></a>IP Addresses</h2></div></div></div><p>Before going further, we should say a few words about
    <span class="emphasis"><em>Internet Protocol</em></span> (<acronym class="acronym">IP</acronym>) addresses.
    Normally, your <span class="emphasis"><em>Internet Service Provider</em></span>
    (<acronym class="acronym">ISP</acronym>) will assign you a single <acronym class="acronym">IP</acronym>
    address. That address can be assigned statically, by the <span class="emphasis"><em>Dynamic
    Host Configuration Protocol</em></span> (<acronym class="acronym">DHCP</acronym>), through
    the establishment of your dial-up connection, or during establishment of
    your other type of <acronym class="acronym">PPP</acronym> (<acronym class="acronym">PPPoA</acronym>,
    <acronym class="acronym">PPPoE</acronym>, etc.) connection.</p><p><span class="bold"><strong>RFC-1918</strong></span> reserves several
    <span class="emphasis"><em>Private</em></span> <acronym class="acronym">IP</acronym> address ranges for use
    in private networks:</p><pre class="programlisting">10.0.0.0    - 10.255.255.255
172.16.0.0  - 172.31.255.255
192.168.0.0 - 192.168.255.255</pre><p>These addresses are sometimes referred to as
    <span class="emphasis"><em>non-routable</em></span> because the Internet backbone routers
    will not forward a packet whose destination address is reserved by
    <span class="bold"><strong>RFC-1918</strong></span>. In some cases though,
    <acronym class="acronym">ISP</acronym>s are assigning these addresses then using
    <span class="emphasis"><em>Network Address Translation</em></span> <span class="emphasis"><em>-
    </em></span><acronym class="acronym">NAT</acronym>) to rewrite packet headers when
    forwarding to/from the Internet.</p><p><img src="images/BD21298_.gif" /></p><p>Before starting Shorewall, <span class="bold"><strong>you should look at
    the IP address of your external interface and if it is in one of the above
    ranges, you should remove the “<span class="quote">norfc1918</span>” option from the
    entry in <code class="filename">/etc/shorewall/interfaces</code>.</strong></span></p><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Tip</h3><p>To determine the IP address of your external interface, as root
        type <span class="command"><strong>ip addr ls dev &lt;interface&gt;</strong></span> at the
        command line where &lt;<span class="emphasis"><em>interface</em></span>&gt; is your
        external interface. The line beginning with <span class="emphasis"><em>inet</em></span>
        identifies your IP address.</p><p>Example:</p><pre class="programlisting">root@lists:~# ip addr ls dev eth0
2: eth0: &lt;BROADCAST,MULTICAST,UP,10000&gt; mtu 1500 qdisc htb qlen 1000
    link/ether 00:02:e3:08:48:4c brd ff:ff:ff:ff:ff:ff
    inet <span class="bold"><strong>206.124.146.176</strong></span>/24 brd 206.124.146.255 scope global eth0
    inet6 fe80::202:e3ff:fe08:484c/64 scope link 
       valid_lft forever preferred_lft forever
root@lists:~# </pre><p>In this example, the IP address of the external interface is
        206.124.146.176</p></div></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Logging"></a>Logging</h2></div></div></div><p>Shorewall does not maintain a log itself but rather relies on your
    <a class="ulink" href="shorewall_logging.html" target="_self">system's logging
    configuration</a>. The following <a class="ulink" href="manpages/shorewall.html" target="_self">commands</a> rely on knowing where
    Netfilter messages are logged:</p><div class="itemizedlist"><ul type="disc"><li><p><span class="command"><strong>shorewall show log</strong></span> (Displays the last 20
        Netfilter log messages)</p></li><li><p><span class="command"><strong>shorewall logwatch</strong></span> (Polls the log at a
        settable interval</p></li><li><p><span class="command"><strong>shorewall dump</strong></span> (Produces an extensive report
        for inclusion in Shorewall problem reports)</p></li></ul></div><p>It is important that these commands work properly because when you
    encounter connection problems when Shorewall is running, the first thing
    that you should do is to look at the Netfilter log; with the help of
    <a class="ulink" href="FAQ.htm#faq17" target="_self">Shorewall FAQ 17</a>, you can usually
    resolve the problem quickly.</p><p>Most commonly, Netfilter messages are logged to
    <code class="filename">/var/log/messages</code>. Recent
    <span class="trademark">SuSE/OpenSuSE</span>™ releases come preconfigured with
    syslog-ng and log Netfilter messages to
    <code class="filename">/var/log/firewall</code>.</p><p><img src="images/BD21298_.gif" /></p><p>If you are running a distribution that logs Netfilter messages to a
    log other than <code class="filename">/var/log/messages</code>, then modify the
    LOGFILE setting in <code class="filename">/etc/shorewall/shorewall.conf</code> to
    specify the name of your log.</p><div class="important" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Important</h3><p>The LOGFILE setting does not control where the Netfilter log is
      maintained -- it simply tells the /sbin/<code class="filename">shorewall</code>
      utility where to find the log.</p></div></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Open"></a>Enabling other Connections</h2></div></div></div><p>Shorewall includes a collection of macros that can be used to
    quickly allow or deny services. You can find a list of the macros included
    in your version of Shorewall using the command <span class="command"><strong>ls
    <code class="filename">/usr/share/shorewall/macro.*</code></strong></span>.</p><p>If you wish to enable connections from the Internet to your firewall
    and you find an appropriate macro in
    <code class="filename">/etc/shorewall/macro.*</code>, the general format of a rule
    in <code class="filename">/etc/shorewall/rules</code> is:</p><pre class="programlisting">#ACTION         SOURCE    DESTINATION     PROTO       DEST PORT(S)
&lt;<span class="emphasis"><em>macro</em></span>&gt;/ACCEPT  net       $FW</pre><div class="important" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Important</h3><p>Be sure to add your rules after the line that reads <span class="bold"><strong>SECTION NEW.</strong></span></p></div><div class="example"><a id="Example1"></a><p class="title"><b>Example 1. You want to run a Web Server and a IMAP Server on your firewall
      system:</b></p><div class="example-contents"><pre class="programlisting">#ACTION     SOURCE    DESTINATION     PROTO       DEST PORT(S)
Web/ACCEPT  net       $FW
IMAP/ACCEPT net       $FW</pre></div></div><br class="example-break" /><p>You may also choose to code your rules directly without using the
    pre-defined macros. This will be necessary in the event that there is not
    a pre-defined macro that meets your requirements. In that case the general
    format of a rule in <code class="filename">/etc/shorewall/rules</code> is:</p><pre class="programlisting">#ACTION   SOURCE    DESTINATION     PROTO       DEST PORT(S)
ACCEPT    net       $FW             <span class="emphasis"><em>&lt;protocol&gt;</em></span>  <span class="emphasis"><em>&lt;port&gt;</em></span></pre><div class="example"><a id="Example2"></a><p class="title"><b>Example 2. You want to run a Web Server and a IMAP Server on your firewall
      system:</b></p><div class="example-contents"><pre class="programlisting">#ACTION   SOURCE    DESTINATION     PROTO       DEST PORT(S)
ACCEPT    net       $FW             tcp          80
ACCEPT    net       $FW             tcp          143</pre></div></div><br class="example-break" /><p>If you don't know what port and protocol a particular application
    uses, see <a class="ulink" href="ports.htm" target="_self">here</a>.</p><div class="important" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Important</h3><p>I don't recommend enabling telnet to/from the Internet because it
      uses clear text (even for login!). If you want shell access to your
      firewall from the Internet, use <acronym class="acronym">SSH</acronym>:</p><pre class="programlisting">#ACTION     SOURCE    DESTINATION     PROTO       DEST PORT(S)
SSH/ACCEPT  net       $FW           </pre></div><p><img src="images/BD21298_.gif" /></p><p>At this point, edit <code class="filename">/etc/shorewall/rules</code> to add
    other connections as desired.</p></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Starting"></a>Starting and Stopping Your Firewall</h2></div></div></div><p><img src="images/BD21298_.gif" /></p><p>The <a class="ulink" href="Install.htm" target="_self">installation procedure</a>
    configures your system to start Shorewall at system boot but startup is
    disabled so that your system won't try to start Shorewall before
    configuration is complete. Once you have completed configuration of your
    firewall, you must edit /etc/shorewall/shorewall.conf and set
    STARTUP_ENABLED=Yes.</p><div class="important" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Important</h3><p>Users of the .deb package must edit
      <code class="filename">/etc/default/shorewall</code> and set
      <code class="varname">STARTUP=1.</code></p></div><div class="important" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Important</h3><p>You must enable startup by editing
      <code class="filename">/etc/shorewall/shorewall.conf</code> and setting
      <code class="varname">STARTUP_ENABLED=Yes.</code></p></div><p>The firewall is started using the “<span class="quote"><span class="command"><strong>shorewall
    start</strong></span></span>” command and stopped using
    “<span class="quote"><span class="command"><strong>shorewall stop</strong></span></span>”. When the firewall is
    stopped, routing is enabled on those hosts that have an entry in
    <code class="filename"><a class="ulink" href="manpages/shorewall-routestopped.html" target="_self">/etc/shorewall/routestopped</a></code>.
    A running firewall may be restarted using the “<span class="quote"><span class="command"><strong>shorewall
    restart</strong></span></span>” command. If you want to totally remove any trace
    of Shorewall from your Netfilter configuration, use
    “<span class="quote"><span class="command"><strong>shorewall clear</strong></span></span>”.</p><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>If you are connected to your firewall from the Internet, do not
      issue a “<span class="quote"><span class="command"><strong>shorewall stop</strong></span></span>” command unless
      you have added an entry for the IP address that you are connected from
      to <a class="ulink" href="manpages/shorewall-routestopped.html" target="_self"><code class="filename">/etc/shorewall/routestopped</code></a>.
      Also, I don't recommend using “<span class="quote"><span class="command"><strong>shorewall
      restart</strong></span></span>”; it is better to create an <span class="emphasis"><em><a class="ulink" href="configuration_file_basics.htm#Configs" target="_self">alternate
      configuration</a></em></span> and test it using the <a class="ulink" href="starting_and_stopping_shorewall.htm" target="_self">“<span class="quote"><span class="command"><strong>shorewall
      try</strong></span></span>”</a> command.</p></div></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Problems"></a>If it Doesn't Work</h2></div></div></div><div class="itemizedlist"><ul type="disc"><li><p>Re-check each of the items flagged with a red arrow
        above.</p></li><li><p>Check your <a class="ulink" href="shorewall_logging.html" target="_self">log</a>.</p></li><li><p>Check the <a class="ulink" href="troubleshoot.htm" target="_self">Troubleshooting
        Guide</a>.</p></li><li><p>Check the <a class="ulink" href="FAQ.htm" target="_self">FAQ</a>.</p></li></ul></div></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Other"></a>Additional Recommended Reading</h2></div></div></div><p>I highly recommend that you review the <a class="ulink" href="configuration_file_basics.htm" target="_self">Common Configuration File Features
    page</a> -- it contains helpful tips about Shorewall features than
    make administering your firewall easier.</p></div></div></body></html>