<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <font size="3"><font face="Comic Sans MS, cursive">Simpl<font
          size="3">e firewall to one machine:<br>
          <br>
          <br>
          <font size="3">1)</font><br>
        </font></font></font>
    <pre style="font-style:normal;font-weight:normal;color:rgb(0,0,0)"><i><font face="Comic Sans MS, cursive"><font size="3">cd /usr/local/bin</font></font></i></pre>
    <pre style="font-style:normal;font-weight:normal;color:rgb(0,0,0)"><font face="Comic Sans MS, cursive"><font size="3">

2)
</font></font></pre>
    <pre style="font-style:normal;font-weight:normal;color:rgb(0,0,0)"><font face="Comic Sans MS, cursive"><font size="3">sudo nano 
<i>
</i><font face="Courier New"><i>(copy an</i></font><font size="3"><font face="Courier New"><i>d paste</i></font><font size="3"><font face="Courier New"><i>)</i></font>

</font></font></font></font></pre>
    <pre style="font-style:normal;font-weight:normal;color:rgb(0,0,0)"><font style="color:rgb(153,0,0)" face="Courier New, monospace"><font size="4">#!/bin/sh</font></font>
<font style="color:rgb(153,0,0)" face="Courier New, monospace"><font size="4">iptables -A INPUT -i lo -j ACCEPT</font></font>
<font style="color:rgb(153,0,0)" face="Courier New, monospace"><font size="4">iptables -A INPUT -p tcp --syn -j DROP</font></font><font face="Comic Sans MS, cursive"><font size="3">


<font size="3">3)</font>

Control + O</font></font></pre>
    <p style="color:rgb(0,0,0)"><font size="3"><font face="Comic Sans
          MS, cursive"><b>write name > </b></font></font><font
        face="Comic Sans MS, cursive"><font size="3"><span
            style="font-style:normal"><span style="font-weight:normal"></span></span></font></font><i><font
          face="Comic Sans MS, cursive"><font size="3"><span
              style="font-style:normal"><span style="font-weight:normal">firewall.sh</span></span></font></font></i></p>
    <pre style="font-style:normal;font-weight:normal;color:rgb(0,0,0)"><font face="Comic Sans MS, cursive"><font size="3">Enter</font></font>
</pre>
    <p style="color:rgb(0,0,0)">
      <b><font face="Comic Sans MS, cursive"><font size="3"><span
              style="font-style:normal"><span style="font-weight:normal"><b>to
                  close ></b> Control 
                + <font size="3"><b>x</b></font><br>
              </span></span></font></font></b></p>
    <p style="color:rgb(0,0,0)"><b><font face="Comic Sans MS, cursive"><font
            size="3"><span style="font-style:normal"><span
                style="font-weight:normal"></span></span></font></font></b></p>
    <pre style="font-style:normal;font-weight:normal;color:rgb(0,0,0)"><i><font style="color:rgb(0,0,0)" face="Comic Sans MS, cursive"><font size="3">chmod +x firewall.sh</font></font></i>





<big><big>4)</big></big>
</pre>
    <font face="Comic Sans MS, cursive"><font size="3">sudo nano
        /etc/rc.local</font></font>
    <p style="color:rgb(0,0,0)"><b><font face="Comic Sans MS, cursive"><font
            size="3"><span style="font-style:normal"><span
                style="font-weight:normal"><font size="3"><b>before</b></font>
                “exit 0″ <font size="3"><b>write:<br>
                  </b></font></span></span></font></font></b></p>
    <p style="color:rgb(0,0,0)"><b><font face="Comic Sans MS, cursive"><font
            size="3"><span style="font-style:normal"><span
                style="font-weight:normal"></span></span></font></font></b><i><font
          face="Comic Sans MS, cursive"><font size="3">/usr/local/bin/firewall.sh<br>
            <br>
          </font></font></i></p>
    <p style="color:rgb(0,0,0)"><i><font face="Comic Sans MS, cursive"><font
            size="3"><br>
            <font size="3">5)</font><br>
          </font></font></i></p>
    <pre style="font-style:normal;font-weight:normal;color:rgb(0,0,0)"><font face="Comic Sans MS, cursive"><font size="3">Control + O</font></font></pre>
    <pre style="font-style:normal;font-weight:normal;color:rgb(0,0,0)"><font face="Comic Sans MS, cursive"><font size="3">Enter</font></font>
</pre>
    <p style="color:rgb(0,0,0)">
      <b><font face="Comic Sans MS, cursive"><font size="3"><span
              style="font-style:normal"><span style="font-weight:normal"><b>to
                  close ></b> Control 
                + O</span></span></font></font></b></p>
    <p style="color:rgb(0,0,0)">
    </p>
    <p style="color:rgb(0,0,0)"><br>
    </p>
    6)<br>
    <br>
    <i>sudo reboot</i><br>
    <br>
    <br>
    <br>
    7)<br>
    <br>
    to see if it is working:<i><br>
    </i>
    <p><i>sudo lsmod</i></p>
    <br>
    <br>
    <br>
    <br>
    <div class="moz-cite-prefix">Em 07-12-2012 08:59, Tom H escreveu:<br>
    </div>
    <blockquote
cite="mid:CAOdo=Sx0Z3tv4tuhorXogzVCQVTrTzS6D44-umb52ON=VEP1VQ@mail.gmail.com"
      type="cite">
      <pre wrap="">On Thu, Dec 6, 2012 at 6:26 PM, JD <a class="moz-txt-link-rfc2396E" href="mailto:jd1008@gmail.com"><jd1008@gmail.com></a> wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">
On redhat based linuxes, you enable the firewall by
either using the "services" gui or use the command
line chkconfig.
Once enabled, it always starts at boot(assuming you
have set up your firewall rulesfile which is
/etc/sysconfig/iptables).
As I am indeed new to ubuntu, I need way of
"enabling" iptables and thus having it always
start at boot automatically.
</pre>
      </blockquote>
      <pre wrap="">
To stay as close to what you know from RHEL/Fedora, install
"iptables-persistent" (it installs an
"/etc/init.d/iptables-persistent" init script) and set your rules in
"/etc/iptables/rules.v4". You'll then have the familiar "service
iptables-persistent stop|start|restart|relaod|save|flush" commands
available; more or less familiar since there's an added "-persistent".

To use the ifupdown infrastructure, create a "iptables-restore <
/path/to/iptables/rules" script in "/etc/network/if-pre-up.d/" and
they'll be loaded when an interface is brought up. Rather than flush
the rules with a script in "/etc/network/if-post-down.d/", flush them
at the top of the rule-setting script because, if you have two
interfaces, bringing one down would leave the other up with no
iptables rules.

To use the MetworkManager infrastructure, create a script in
"/etc/NetworkManager/dispatcher.d/". I've only done this once as a
test in the distant past and all that I remember is that the script's
very similar to an init script with "case ...".

If you don't mind not using your own current set of rules as is, you
can use ufw (or its gui frontend, gufw), an Ubuntu-developed frontend
to iptables, apf-firewall, arno-iptables-firewall, shorewall, or
(there are probably others) ...

ufw has a command-line interface (the "u" stands for "uncomplicated"
so it's more straightforward than iptables' commands); "ufw enable"
for it to start at boot and "man ufw" to find out how to add local
rules to the default ones. The others have config files to customize
the default rules that they create.

</pre>
    </blockquote>
    <br>
  </body>
</html>