<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>shorewall &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/shorewall/</link>
	<description>Feed of posts on WordPress.com tagged "shorewall"</description>
	<pubDate>Mon, 28 Dec 2009 19:03:03 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[[转贴] Ubuntu 系统下设置 Shorewall 防火墙]]></title>
<link>http://opaperjam.wordpress.com/2009/12/28/%e8%bd%ac%e8%b4%b4-ubuntu-%e7%b3%bb%e7%bb%9f%e4%b8%8b%e8%ae%be%e7%bd%ae-shorewall-%e9%98%b2%e7%81%ab%e5%a2%99/</link>
<pubDate>Mon, 28 Dec 2009 00:31:22 +0000</pubDate>
<dc:creator>opaperjam</dc:creator>
<guid>http://opaperjam.wordpress.com/2009/12/28/%e8%bd%ac%e8%b4%b4-ubuntu-%e7%b3%bb%e7%bb%9f%e4%b8%8b%e8%ae%be%e7%bd%ae-shorewall-%e9%98%b2%e7%81%ab%e5%a2%99/</guid>
<description><![CDATA[转贴自：http://netsecurity.51cto.com/art/200907/134273.htm 服务器采用Ubuntu作为操作系统，两块网卡，一块接外网（eth0），一块接内网（eth1]]></description>
<content:encoded><![CDATA[转贴自：http://netsecurity.51cto.com/art/200907/134273.htm 服务器采用Ubuntu作为操作系统，两块网卡，一块接外网（eth0），一块接内网（eth1]]></content:encoded>
</item>
<item>
<title><![CDATA[Shorewall for Dummies]]></title>
<link>http://bonoboslr.wordpress.com/2009/12/05/shorewall-for-dummies/</link>
<pubDate>Sat, 05 Dec 2009 08:45:39 +0000</pubDate>
<dc:creator>bonoboslr</dc:creator>
<guid>http://bonoboslr.wordpress.com/2009/12/05/shorewall-for-dummies/</guid>
<description><![CDATA[If IPtables is too daunting for you, then shorewall is probably the easiest way to setup and maintai]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>If IPtables is too daunting for you, then shorewall is probably the easiest way to setup and maintain an iptables based firewall on Linux. Let me go through the basics.</p>
<h2>Interfaces &#38; Zones</h2>
<p>Shorewall builds some intelligence into your firewall thinking. Networks can be considered as &#8216;zones&#8217; &#8211; i.e. your internet interface (ppp0) could be your &#8216;web&#8217; zone and your internal network could be considered as your &#8216;int&#8217; zone. I do not know why shorewall only allows 3 letter zone names&#8230; but that is not relevant here.</p>
<p>So &#8211;  what I am doing is setting up a basic internet sharing firewall. It has 2 zones (web &#38; int) for WWW and internal network. first thing, setup up your interfaces file:</p>
<pre># vi /etc/shorewall/interfaces
#ZONE   INTERFACE       BROADCAST       OPTIONS
web     ppp+            -               dhcp,upnp
int     eth0</pre>
<p>Here are my 2 zones &#8211; my dialup interface (ppp) and my internal network (eth0). The &#8216;+&#8217; in ppp+ simply means it is a wildcard (ppp0,ppp1&#8230;etc). I have specified dhcp in my options to indicate that this interface gets it&#8217;s ipaddress dynamically. See man shorewall-interfaces for more information on interfaces.</p>
<p>For this example &#8211; /etc/shorewall/zones is very basic. Unless you are doing IPSEC tunnelling or any other fancy stuff, you can input the following:</p>
<pre># vi /etc/shorewall/zones
#ZONE   TYPE            OPTIONS         IN                      OUT
#                                       OPTIONS                 OPTIONS
fw      firewall
web     -
int     -</pre>
<p>You see that there are three zones in the zones file. The third one is a zone for the firewall itself.</p>
<h2>Policies</h2>
<p>This is where Shorewall makes some sense over other firewalls. Instead of having millions of rules from one zone to another, you can simply specifiy a policy for communication between entire zones. You need not have a separate rules in addition like some firewalls do &#8211; Juniper. Here I have setup two policies that allow the Firewall to get to the other zones:</p>
<pre># vi /etc/shorewall/policy
#SOURCE DEST POLICY LOG LIMIT CONNECTLIMIT
$FW     web     ACCEPT
$FW     int     ACCEPT</pre>
<p>I then want to ensure that the internal zone (int) can get out to the internet (web) and I want to be able to administrate the firewall from my internal zone from any of my internal machines. You may not want the second policy, but I am just putting it in as an example.</p>
<pre>int     web    ACCEPT
int     $FW    ACCEPT</pre>
<p>I then want to implement a default drop policy for internet traffic (web) to the firewall or my internal network and it&#8217;s a good idea to have a reject ALL ALL rule at the end.</p>
<pre>web     all     ACCEPT
all     all     ACCEPT</pre>
<p>So now you have default policies based on your zones. You do not need to manage individual rules for inter-zone traffic.</p>
<h2>Masquarade / NAT</h2>
<p>Ok this is the part that makes your internet connection sharing work. Effectively what you want to do is have all your internal machines route through you firewall. To do this, you must NAT your internal traffic to your internet interface on your firewall. Shorewall makes this so simple. One line:</p>
<pre># vi /etc/shorewall/masq
eth0     192.168.2.0/24     detect</pre>
<p>Done. Restart the service &#8211; /etc/init.d/shorewall restart. You now have internet sharing for your internal network users through your linux firewall.</p>
<p>The last thing that you may want to do is to have traffic from the web reach a particular machine in the network. For example, you may have a web server on your internal network that want to be accessible from the internet &#8211; this simple rule will allow traffic to be forwarded from the firewall to the correct machine on the internal network:</p>
<pre># vi /etc/shorewall/rules
DNAT     web     int:192.168.2.100     tcp     80,443</pre>
<p>The rule implements allows traffic from the internet (web) to the internal network machine &#8211; 192.168.2.100 on tcp ports 80 and 443.</p>
<p>That is really just a basic introduction to shorewall. To see the syntax of any of the shorewall the man pages are accessible as follows:</p>
<pre># man shorewall-rules</pre>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Linux Proxy Server Dengan Squid dan ShoreWall]]></title>
<link>http://esal.wordpress.com/2009/10/13/linux-proxy-server-dengan-squid-shorewall/</link>
<pubDate>Tue, 13 Oct 2009 00:40:47 +0000</pubDate>
<dc:creator>esal</dc:creator>
<guid>http://esal.wordpress.com/2009/10/13/linux-proxy-server-dengan-squid-shorewall/</guid>
<description><![CDATA[Linux Proxy Server Dengan Squid dan ShoreWall by Anton Picano Sanjay Lisensi Dokumen: Copyright © 20]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p style="text-align:center;"><strong>Linux Proxy Server Dengan Squid dan ShoreWall</strong></p>
<p style="text-align:center;">
<p style="text-align:center;">by Anton Picano Sanjay</p>
<p style="text-align:justify;"><strong>Lisensi Dokumen: </strong></p>
<p style="text-align:justify;">Copyright © 2005 IlmuKomputer.Com Seluruh dokumen di IlmuKomputer.Com dapat digunakan, dimodifikasi dan disebarkan secara bebas untuk tujuan bukan komersial (nonprofit), dengan syarat tidak menghapus atau merubah atribut penulis dan pernyataan copyright yang disertakan dalam setiap dokumen. Tidak diperbolehkan melakukan penulisan ulang, kecuali mendapatkan ijin terlebih dahulu dari IlmuKomputer.Com.</p>
<p style="text-align:justify;"><strong>S Q U I D </strong></p>
<p style="text-align:justify;">Proxy server mempunyai kemampuan untuk menghemat bandwidth, meningkatkan keamanan dan mempercepat proses surfing web. Squid merupakan software proxy yang banyak dipakai dan dapat diperoleh secara gratis. Squid juga dapat digunakan untuk mengendalikan pemakaian bandwidth berdasarkan ekstensi file-file tertentu, menyaring situs-situs yang boleh diakses.</p>
<p style="text-align:justify;">File-file yang dibutuhkan :</p>
<ul>
<li>Squid (yang dipakain pada tulisan ini adalah versi squid-2.5.STABLE6.tar.gz), bisa didownload dari http://www.squid-cache.org</li>
<li>malloc.tar.gz, bisa didownload dari http://www.gnu.org/order/ftp.html</li>
</ul>
<p style="text-align:center;"><span style="color:#0000ff;"><a href="http://www.ziddu.com/download/6743461/LinuxProxyServerDenganSquidShoreWall.pdf.html"><img src="http://bse.depdiknas.go.id/images_gif/download.gif" border="0" alt="" width="91" height="31" /></a></span></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[vpnc and shorewall]]></title>
<link>http://ourcraft.wordpress.com/2009/10/10/vpnc-and-shorewall/</link>
<pubDate>Sat, 10 Oct 2009 11:31:05 +0000</pubDate>
<dc:creator>danielmeyer</dc:creator>
<guid>http://ourcraft.wordpress.com/2009/10/10/vpnc-and-shorewall/</guid>
<description><![CDATA[I wanted to configure my home Linux box with vpnc.  I had done this before, but I&#8217;ve lost trac]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I wanted to configure my home Linux box with vpnc.  I had done this before, but I&#8217;ve lost track of the documentation I made at the time.</p>
<p>First, I ran pcf2vpnc on the .pcf configuration file &#8212; what an easy way to get the .conf file needed by vpnc!</p>
<p>Then I tried running vpnc.  From the messages it gave, it looked like I was successfully connected&#8230; but I couldn&#8217;t ping any servers&#8230; hmm.</p>
<h3>Diagnosing</h3>
<p>After a few minutes, it began to dawn on me that I had experienced a very similar issue before, and that time it wasn&#8217;t the vpnc configuration.  It was the firewall that was rejecting all traffic from the vpn.</p>
<p>I stopped shorewall and sure enough, I was able to get into the network and ping things.</p>
<h3>Solving</h3>
<p>I:</p>
<ol>
<li>Added this line to /etc/shorewall/zones:
<pre>vpnc  ipv4
</pre>
</li>
<li>Added this line to /etc/shorewall/interfaces:
<pre>vpnc  tun0  detect
</pre>
</li>
<li>Added this line to /etc/shorewall/tunnels, replacing xx.xx.xx.xx with the IP address of my  router:
<pre>generic:udp:500    net  xx.xx.xx.xx
</pre>
</li>
<li>Finally, I believe I added this fw vpnc ACCEPT line to /etc/shorewall/policy:
<pre>fw      vpnc    ACCEPT
net     all     DROP    info
all     all     REJECT  info</pre>
<p> (I believe this line needs to be above the more general net-all-DROP and all-all-REJECT lines, as shown.)</li>
</ol>
<p>I then restarted shorewall and I was off and running.</p>
<p>Basically I guess we&#8217;re telling shorewall to allow all traffic from the firewall to the vpn interface, where by default it would deny such traffic otherwise.  I need to get a deeper understanding of what&#8217;s going on here, though.</p>
<p>Thanks to <a href="http://garycourt.com/blog/post/vpnc-with-shorewall-on-openwrt/">Gary Court</a> and <a href="http://lists.shorewall.net/pipermail/shorewall-users/2005-June/018814.html">Tobias Weisserth</a>, whose posts were helpful!</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Configurare Shorewall]]></title>
<link>http://mstracna.wordpress.com/2009/08/31/configurare-shorewall/</link>
<pubDate>Mon, 31 Aug 2009 07:16:16 +0000</pubDate>
<dc:creator>Marius Strâcnă</dc:creator>
<guid>http://mstracna.wordpress.com/2009/08/31/configurare-shorewall/</guid>
<description><![CDATA[In următoarea procedură aveți descrisă configurarea minimală a unui FIREWALL/ROUTER cu ajutorul apli]]></description>
<content:encoded><![CDATA[In următoarea procedură aveți descrisă configurarea minimală a unui FIREWALL/ROUTER cu ajutorul apli]]></content:encoded>
</item>
<item>
<title><![CDATA[Sheesh]]></title>
<link>http://marxworld.wordpress.com/2009/06/09/sheesh/</link>
<pubDate>Tue, 09 Jun 2009 21:42:56 +0000</pubDate>
<dc:creator>marxworld</dc:creator>
<guid>http://marxworld.wordpress.com/2009/06/09/sheesh/</guid>
<description><![CDATA[What a day to say the least. from a installation of a firewall going ok to a failed vpn setup, shore]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>What a day to say the least. from a installation of a firewall going ok to a failed vpn setup, shorewall setup, email that worked, didnt work and then worked and then leaving us not sure if it worked, its been one hell of a day&#8230;</p>
<p><!--more--></p>
<p>The afternoon ended with emails being sent and received from one internal account to external and then a reply back. That worked one site and not the other thus leaving me wondering if the vpn is working properly and in turn a sleepless nights.</p>
<p>Saying that the guy from watchguard firewall, which btw we went to because no one in sonicwall ever replies to an email. So if you are reading this sonic wall thats 5 units you lost out on with another 10 on the way.  Anyways watchguard guy was spot on and got things going. Odd thing is that I can ping the router but remote access to it is  no no.  With that being the least of the worries I just want to know the office email works</p>
<p>Site 2 , internal mail to external mail and then a reply from external mail worked<br />
Yet site 1, the main fucking important office can send and not receive.</p>
<p>Who the fuck would use shorewall as a firewall when its got a limited support area and the documentation on a wiki isnt the best.  Still it does work to a point I suppose but you cant beat a product with that pick up and call someone for help ability.</p>
<p>So its another sleepness night not nowing if something is going to work or not. Yes I can roll back to the old hardware and prey a bit that it works leaving me in a situation of having hardware on a site that theres no control over.</p>
<p>On top of all this, pressures from work leading to a massive amount of friction arent helping.</p>
<p>For example, we have a banner on a site that points to a product.  This banner is on over 9000 pages.  THe product was disabled and therefore clicking the banner brings up a this product is out of stock link.  This was the case for over a week. ok the guys are busy so I emailed them to let them know&#8230;</p>
<p>No reply<br />
So I email the people who I put the banner up for to email them to say it was down.<br />
They got a reply straight away.  Interesting to say the least dont you think.</p>
<p>Coupled with that its the 1 year anniversary since I split with Kari. Thats not put me in a good mood. Along with her adding me to msn with a fake msn that I know isnt her most logged into one.  One year and the addage of be carefullof what you wih for comes true.  If you wish you were dead its not often smply as that, dead can be dead on the inside, emotionally, little or no desire.</p>
<p>Ack its bed time , theres a direct relationship between being tired and thinking things id rather not,a fter barely eating all day its time to sign off.</p>
<p>Take it easy all</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Konfigurasi Mandriva Linux Warnet]]></title>
<link>http://bayuart.wordpress.com/2009/06/09/konfigurasi-mandriva-linux-warnet/</link>
<pubDate>Tue, 09 Jun 2009 04:38:16 +0000</pubDate>
<dc:creator>bayuart</dc:creator>
<guid>http://bayuart.wordpress.com/2009/06/09/konfigurasi-mandriva-linux-warnet/</guid>
<description><![CDATA[Terusan dari tulisan : http://bayuart.wordpress.com/2009/06/05/mandriva-2009-1-spring-in-action-d-pa]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Terusan dari tulisan :</p>
<p><a href="http://bayuart.wordpress.com/2009/06/05/mandriva-2009-1-spring-in-action-d-part-deux/">http://bayuart.wordpress.com/2009/06/05/mandriva-2009-1-spring-in-action-d-part-deux/</a><br />
<a href="http://bayu.blitar.org/2009/06/02/warung-internet-1/">http://bayu.blitar.org/2009/06/02/warung-internet-1/</a><br />
<a href="http://bayu.blitar.org/2009/06/05/mandriva-20091-spring-in-action-d/">http://bayu.blitar.org/2009/06/05/mandriva-20091-spring-in-action-d/</a></p>
<p>Sekarang kita mo menginjak ke konfigurasi dari mandriva linux yang sebelomnya telah terinstall sebagai gateway server warnet / pc router. Dari tulisan sebelumnya mandriva linux yang digunakan adalah versi mandriva linux 2009.1 spring free edition dual iso serta menggunakan aplikasi server gateway seperti :</p>
<ul>
<li><a href="http://www.shorewall.net/">shorewall</a> untuk firewall</li>
<li><a href="http://www.squid-cache.org/">squid</a> untuk layanan proxy</li>
<li><a href="https://www.isc.org/software/dhcp">dhcp-server</a> untuk layanan ip dinamis </li>
<li><a href="http://www.isc.org/products/BIND/">bind</a> untul layanan dns / cache lokal</li>
</ul>
<p><span style="font-weight:bold;">Shorewall</span><br />
Shorewall yang merupakan kependekan dari Shoreline Firewal, merupakan firewall yang berbasiskan kepada iptables yang dipermudah dalam penggunaanya, apabila anda telah terbiasa menggunakan iptables maka anda mungkin tidak akan membutuhkan tools semacam ini, shorewall dapat di installasi pada kebanyakan sistem Linux, disini saya menggunakan mandriva linux 2009.1 spring untuk dijadikan sebagai Gateway+Router dan juga transparent proxy, untuk mendapatkan versi terbarunya anda dapat mengunjungi web resmi <a href="http://www.shorewall.net/">Shorewall</a>.</p>
<p>The Shoreline Firewall, more commonly known as      “<span class="quote">Shorewall</span>”, is high-level tool for configuring Netfilter. You describe your firewall/gateway requirements using entries in a set of configuration files. Shorewall reads those configuration files and with the help of the iptables, iptables-restore, ip and tc utilities, Shorewall configures Netfilter and the Linux networking subsystem to match your requirements. Shorewall can be used on a dedicated firewall system, a multi-function gateway/router/server or on a standalone GNU/Linux system. Shorewall does not use Netfilter&#8217;s ipchains compatibility mode and can thus take advantage of Netfilter&#8217;s connection state tracking capabilities&#8230; from <a href="http://www.shorewall.net/Introduction.html">Shorewall</a>.</p>
<p><a href="http://bayuart.blogspot.com/2009/06/konfigurasi-mandriva-linux-warnet.html">Selengkapnya</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Instalasi Shorewall pada RHEL5]]></title>
<link>http://endyk.wordpress.com/2009/05/19/instalasi-shorewall/</link>
<pubDate>Mon, 18 May 2009 16:25:56 +0000</pubDate>
<dc:creator>endyk</dc:creator>
<guid>http://endyk.wordpress.com/2009/05/19/instalasi-shorewall/</guid>
<description><![CDATA[Ceritanya nih di kampus pake server RHEL5.3, trus mau pasang pengaman buat server, sekaligus mau rou]]></description>
<content:encoded><![CDATA[Ceritanya nih di kampus pake server RHEL5.3, trus mau pasang pengaman buat server, sekaligus mau rou]]></content:encoded>
</item>
<item>
<title><![CDATA[Port forwarding for internal webservers in case of a non-transparent proxy]]></title>
<link>http://lalithsuresh.wordpress.com/2009/04/30/port-forwarding-for-internal-webservers-in-case-of-a-non-transparent-proxy/</link>
<pubDate>Thu, 30 Apr 2009 10:18:11 +0000</pubDate>
<dc:creator>lalithsuresh</dc:creator>
<guid>http://lalithsuresh.wordpress.com/2009/04/30/port-forwarding-for-internal-webservers-in-case-of-a-non-transparent-proxy/</guid>
<description><![CDATA[Assume that you&#8217;re running a two interface firewall setup using Shorewall for your institute L]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Assume that you&#8217;re running a two interface firewall setup using Shorewall for your institute LAN. Suppose you have an internal webserver that you want to be made visible externally as well. To achieve this, you&#8217;d normally do a port forward using DNAT. Although this method gets a FAIL when it comes to security, it&#8217;s usually the easiest thing to do. The suggested alternative would obviously be to get an extra NIC and setup a DMZ but anyways I&#8217;ll be talking about a two interface setup here. Now this port forwarding thing works fine but what happens when a host in the internal network tries to access this website through the URL? The request will go out of the network, come back in and the response would follow the reverse route and this will take ridiculously long! There are two workarounds for this. The recommended method would be to configure your internal DNS to respond with the internal IP when a DNS query for the webserver&#8217;s URL is received. The other method would be to have your gateway masquerade as the internal webserver, which is nothing short of a quick hack and note that this is also rather poor when it comes to security. As per the shorewall website, for a transparent proxy, you&#8217;ll need to add the following rules.</p>
<p>Example IP addresses:</p>
<p>Gateway&#8217;s external interface (eth0): <span style="color:#000080;">210.45.21.55</span></p>
<p>Gateway&#8217;s internal interface (eth1) : <span style="color:#000080;">192.168.1.1</span></p>
<p>Internal Webserver: <span style="color:#000080;">192.168.1.10</span></p>
<p>So here come the rules:</p>
<p><strong>In/etc/shorewall/rules:</strong></p>
<p><span style="color:#000080;">REDIRECT        loc     3128    tcp     www     -       !210.45.21.55</span></p>
<p><span style="color:#000080;">DNAT              loc     loc:192.168.1.10      tcp     www     -       210.45.21.55</span></p>
<p><strong>In/etc/shorewall/masq:</strong></p>
<p><span style="color:#000080;">eth1:192.168.1.10        eth1           192.168.1.1      tcp     www</span></p>
<p>In <strong>/etc/shorewall/interfaces</strong>, make sure you have the &#8216;routeback&#8217; option enabled for eth1.</p>
<p>Now here&#8217;s the part that you won&#8217;t find in the shoerwall documentation. In case you&#8217;re migrating to a non-transparent proxy, add the following rule after the above mentioned DNAT.</p>
<p><span style="color:#000080;">DNAT    $FW     loc:192.168.1.10:80      tcp     80      -       210.45.21.55</span></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Generate ShoreWall blacklist from Spamhaus and DShield]]></title>
<link>http://mudy.wordpress.com/2009/02/21/shorewall-blacklist-spamhaus-dshield/</link>
<pubDate>Sat, 21 Feb 2009 06:14:13 +0000</pubDate>
<dc:creator>mudy</dc:creator>
<guid>http://mudy.wordpress.com/2009/02/21/shorewall-blacklist-spamhaus-dshield/</guid>
<description><![CDATA[I wrote a bash script to automatically generate Shorewall blacklist from Spamhaus drop list and dshi]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I wrote a bash script to automatically generate <a href="http://www.shorewall.net/">Shorewall </a>blacklist from <a href="http://www.spamhaus.org/drop/index.lasso">Spamhaus drop list</a> and <a href="http://feeds.dshield.org/block.txt">dshield.org&#8217;s block list</a> .</p>
<p>Do not run this script automatically if ssh is the only mean you connect to your server, because you can accidentally blacklist yourself. And you may not run it more often then once per hour due to spamhaus limitation.</p>
<pre>#!/bin/sh

echo "#ADDRESS/SUBNET         PROTOCOL        PORT" &#62; /tmp/blacklist
wget  -q -O - http://feeds.dshield.org/block.txt &#124; awk --posix '/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.0\t/ { print $1 "/24";}' &#62;&#62; /tmp/blacklist
wget -q -O - http://www.spamhaus.org/drop/drop.lasso &#124; awk --posix '/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\// { print $1;}' &#62;&#62; /tmp/blacklist
echo "#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE" &#62;&#62; /tmp/blacklist
mv /tmp/blacklist /etc/shorewall/blacklist

shorewall refresh &#38;&#62;/dev/null
</pre>
<p>I also use <a href="http://www.fail2ban.org/wiki/index.php/Main_Page">fail2ban </a>to generate dynamic shorewall ban list.</p>
<p>UPDATE: And don&#8217;t forget enable blacklist option in /etc/shorewall/shorewall.conf</p>
<pre>BLACKLIST_DISPOSITION=DROP</pre>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Install Proxy Server dengan Ubuntu Server]]></title>
<link>http://fsdoei.wordpress.com/2009/02/10/install-proxy-server-dengan-ubuntu-server/</link>
<pubDate>Tue, 10 Feb 2009 03:03:02 +0000</pubDate>
<dc:creator>fsdoei</dc:creator>
<guid>http://fsdoei.wordpress.com/2009/02/10/install-proxy-server-dengan-ubuntu-server/</guid>
<description><![CDATA[Berikut ini kita akan men-setup sebuah proxy dengan konfigurasi sebagai berikut: Nama Host: proxy.ib]]></description>
<content:encoded><![CDATA[Berikut ini kita akan men-setup sebuah proxy dengan konfigurasi sebagai berikut: Nama Host: proxy.ib]]></content:encoded>
</item>
<item>
<title><![CDATA[Install Shorewall di Ubuntu server 8.04]]></title>
<link>http://ccasp.wordpress.com/2009/01/18/install-shorewall-di-ubuntu-server-804/</link>
<pubDate>Sun, 18 Jan 2009 11:03:55 +0000</pubDate>
<dc:creator>chott</dc:creator>
<guid>http://ccasp.wordpress.com/2009/01/18/install-shorewall-di-ubuntu-server-804/</guid>
<description><![CDATA[Shorewall&#8230; salah satu alternatif firewall yang cukup mudah dibanding dengan iptables. Mudah di]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Shorewall&#8230; salah satu alternatif firewall yang cukup mudah dibanding dengan iptables. Mudah di gunakan tapi bikin nggak paham bahasanya &#8230;hehe&#8230;tapi akan saya coba jelaskan konfigurasinya <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> . Di sini, saya install Shorewall di web server</p>
<p>install Shorewall dari apt:</p>
<p>jangan lupa jadi root</p>
<table style="font-family:Courier;font-size:9pt;color:#0a5019;" border="0" width="35%" bgcolor="#ecd9d9">
<tbody>
<tr>
<td width="100%">
<pre> root@chic# apt-get install -y shorewall</pre>
</td>
</tr>
</tbody>
</table>
<p>Shorewall sudah terinstall, tinggal konfigurasi, sebelum konfigurasinya selesai, shorewall tidak bisa di aktifkan.<br />
Konfigurasi yang di perlukan antara lain:</p>
<li>policy ,yaitu peraturan secara general. Di sini defaultnya drop semua dan buka yang diperlukan.</li>
<li>rules, nah&#8230; untuk membuka yang diperlukan, atur di sini. Lebih aman dari &#8220;buka semua drop yang diperlukan kan^^&#8221;</li>
<li>sedangkan konfigurasi lainnya mengenai pengaturan mekanisme jaringan ataupun sistemnya antara lain di default shorewall dan shorewall.conf</li>
<p>Mulai konfigurasi&#8230;<!--more--></p>
<p>Untuk konfigurasi tinggal gunakan editor, misalnya medit atau nano atau pico untuk mempermudah daripada pake vi :-p&#8230; jadi misalya ketikkan<br />
&#8220;mcedit /etc/default/shorewall&#8221;<br />
untuk edit konfigurasi di /etc/default/shorewall</p>
<p>konfigurasi di<strong> /etc/default/shorewall </strong><br />
cukup ganti :</p>
<table style="font-family:Courier;font-size:9pt;color:#0a5019;" border="0" width="15%" bgcolor="#ecd9d9">
<tbody>
<tr>
<td width="100%">
<pre>startup = 0</pre>
</td>
</tr>
</tbody>
</table>
<p>jadi</p>
<table style="font-family:Courier;font-size:9pt;color:#0a5019;" border="0" width="15%" bgcolor="#ecd9d9">
<tbody>
<tr>
<td width="100%">
<pre>startup = 1</pre>
</td>
</tr>
</tbody>
</table>
<p>agar setiap mesin nyala, shorewall juga ikut aktif.</p>
<p><strong>konfigurasi /etc/shorewall/shorewall.conf</strong><br />
Di konfigurasi ini, isi saja yang diperlukan, yang sebagian sudah terisi biasanya tidak perlu di ubah.</p>
<p>Lengkapnya&#8230;</p>
<table style="font-family:Courier;font-size:9pt;color:#0a5019;" border="0" width="53%" bgcolor="#ecd9d9">
<tbody>
<tr>
<td width="100%">bla&#8230; bla..</p>
<pre>###############################################################################
#		       S T A R T U P   E N A B L E D
###############################################################################
#agar aktif saat startup

STARTUP_ENABLED=YES

###############################################################################
#		              V E R B O S I T Y
###############################################################################
#menampilkan proses

VERBOSITY=1

###############################################################################
#                              C O M P I L E R
#      (setting this to 'perl' requires installation of Shorewall-perl)
###############################################################################
#karena tidak ada yang perlu di compile, kosongkan saja

SHOREWALL_COMPILER=

###############################################################################
#			       L O G G I N G
###############################################################################
#bagian ini, tidak ada yang diubah, periksa dulu tapinyaaa

LOGFILE=/var/log/messages

LOGFORMAT="Shorewall:%s:%s:"

LOGTAGONLY=No

LOGRATE=

LOGBURST=

LOGALLNEW=

BLACKLIST_LOGLEVEL=

MACLIST_LOG_LEVEL=info

TCP_FLAGS_LOG_LEVEL=info

RFC1918_LOG_LEVEL=info

SMURF_LOG_LEVEL=info

LOG_MARTIANS=No

###############################################################################
#	L O C A T I O N	  O F	F I L E S   A N D   D I R E C T O R I E S
###############################################################################
#pada bagian ini, yang sebelah kanan setelah "=" berisi letak direktori file
#sebelah kiri yang sudah terisi tidak perlu di ubah, yang belum dan kalo akan
#digunakan cari dulu filenya, kemudian copy paste letak direktorinya.

#IPTABLES kosongkan, karena kita sudah jadikan shorewall sebagai firewall

IPTABLES=

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin

SHOREWALL_SHELL=/bin/sh

SUBSYSLOCK=/var/lock/subsys/shorewall

MODULESDIR=/lib/modules/2.6.24-19-server/kernel/net/netfilter

CONFIG_PATH=/etc/shorewall:/usr/share/shorewall

RESTOREFILE=

IPSECFILE=zones

LOCKFILE=

###############################################################################
#		D E F A U L T   A C T I O N S / M A C R O S
###############################################################################
#tak perlu ada yang diubah

DROP_DEFAULT="Drop"
REJECT_DEFAULT="Reject"
ACCEPT_DEFAULT="none"
QUEUE_DEFAULT="none"

###############################################################################
#                        R S H / R C P  C O M M A N D S
###############################################################################
#ini juga... biarkan

RSH_COMMAND='ssh ${root}@${system} ${command}'
RCP_COMMAND='scp ${files} ${root}@${system}:${destination}'

###############################################################################
#			F I R E W A L L	  O P T I O N S
###############################################################################
# konfigurasi yang biasanya digunakan...

IP_FORWARDING=On

ADD_IP_ALIASES=Yes

ADD_SNAT_ALIASES=No

RETAIN_ALIASES=No

TC_ENABLED=Internal

TC_EXPERT=No

CLEAR_TC=Yes

MARK_IN_FORWARD_CHAIN=No

CLAMPMSS=No

ROUTE_FILTER=No

DETECT_DNAT_IPADDRS=No

MUTEX_TIMEOUT=60

ADMINISABSENTMINDED=Yes

BLACKLISTNEWONLY=Yes

DELAYBLACKLISTLOAD=No

MODULE_SUFFIX=

DISABLE_IPV6=Yes

BRIDGING=No

DYNAMIC_ZONES=No

PKTTYPE=Yes

RFC1918_STRICT=No

MACLIST_TABLE=filter

MACLIST_TTL=

SAVE_IPSETS=No

MAPOLDACTIONS=No

FASTACCEPT=No

IMPLICIT_CONTINUE=Yes

HIGH_ROUTE_MARKS=No

USE_ACTIONS=Yes

OPTIMIZE=1

EXPORTPARAMS=No

###############################################################################
#			P A C K E T   D I S P O S I T I O N
###############################################################################
#yang ini juga nggak perlu ada yang diubah

BLACKLIST_DISPOSITION=DROP

MACLIST_DISPOSITION=REJECT

TCP_FLAGS_DISPOSITION=DROP

#LAST LINE -- DO NOT REMOVE</pre>
</td>
</tr>
</tbody>
</table>
<p><strong>konfigurasi /etc/shorewall/policy</strong><br />
Bagian ini bersifat umum, berlaku unruk keseluruhan.</p>
<table style="font-family:Courier;font-size:9pt;color:#0a5019;" border="0" width="45%" bgcolor="#ecd9d9">
<tbody>
<tr>
<td width="100%">bla.. bla..</p>
<pre>#pada baris pertama berarti dari firewall atau dari net yang berarti dari
#server kita menuju keluar atau ke net di ACCEPT semua... masa di larang!?

#pada baris kedua yang masuk dari net ke firewall kita di DROP semua

#pada baris ketiga saya tambahkan agar jika dari jaringan masuk ke server kita
#DROP dulu semuanya
###############################################################################
#SOURCE		DEST		POLICY		LOG LEVEL	LIMIT:BURST
$FW		net		ACCEPT
net		$FW		DROP		info
net		all		DROP		info
# The FOLLOWING POLICY MUST BE LAST
all		all		REJECT		info
#LAST LINE -- ADD YOUR ENTRIES ABOVE THIS LINE -- DO NOT REMOVE</pre>
</td>
</tr>
</tbody>
</table>
<p><strong>konfigurasi /etc/shorewall/rules</strong><br />
Bagian ini merupakan pengecualian dari kongigurasi policy</p>
<table style="font-family:Courier;font-size:9pt;color:#0a5019;" border="0" width="50%" bgcolor="#ecd9d9">
<tbody>
<tr>
<td width="100%">bla.. bla&#8230;</p>
<pre>#######################################################################################
#ACTION	   SOURCE    DEST          PROTO     DEST	SOURCE
ORIGINAL   RATE	    USER/  MARK
#					     PORT       PORT(S)
DEST	   LIMIT     GROUP

# Reject Ping from the "bad" net zone.. and prevent your log from being flooded..

Ping/ACCEPT	net		$FW

# Permit all ICMP traffic FROM the firewall TO the net zone

#pada baris pertama berarti membolehkan semua dari server keluar atau ke net melalui icmp
#biar bisa ssh,treceroute,...etc kemana-manaaa

#pada baris kedua berarti kita membolehkan user dari net melakukan koneksi melalui tcp
#tepatnya port 22 ya... biar server kita bisa di kendalikan dengan ssh dari komp lain,
#setujui saja 

#pada baris ketiga berarti memperbolehkan server kita diakses lewat browser, yaitu port 80
#karena kebetulan firewall saya pasang di webserver^^

ACCEPT		$FW		net		icmp
ACCEPT		net		$FW		tcp       22
ACCEPT          all             $FW             tcp       80

#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE</pre>
</td>
</tr>
</tbody>
</table>
<p>konfigurasi <strong>/etc/shorewall/interfaces</strong></p>
<table style="font-family:Courier;font-size:9pt;color:#0a5019;" border="0" width="45%" bgcolor="#ecd9d9">
<tbody>
<tr>
<td width="100%">bla..bla..</p>
<pre>#hmmm... yang ini nggak perlu ada yang diubah
###############################################################################
#ZONE	INTERFACE	BROADCAST	OPTIONS
net     eth0            detect          dhcp,tcpflags,logmartians,nosmurfs
#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE</pre>
</td>
</tr>
</tbody>
</table>
<p>Beuh.. beres juga, tinggal aktifkan Shorewallnya</p>
<table style="font-family:Courier;font-size:9pt;color:#0a5019;" border="0" width="25%" bgcolor="#ecd9d9">
<tbody>
<tr>
<td width="100%">
<pre>root@chic# /etc/init.d/shorewall start</pre>
</td>
</tr>
</tbody>
</table>
<p>Semoga berguna&#8230; trim&#8217;s <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Centro Servizi]]></title>
<link>http://dema.tv/2009/01/13/centro-servizi/</link>
<pubDate>Tue, 13 Jan 2009 18:08:11 +0000</pubDate>
<dc:creator>antonde</dc:creator>
<guid>http://dema.tv/2009/01/13/centro-servizi/</guid>
<description><![CDATA[Per la serie post di utilità prima di tutto per la mia sempre più fallace memoria , e poi forse anch]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Per la serie post di utilità prima di tutto per la mia sempre più fallace memoria , e poi forse anche per qualcuno in cerca di una soluzione di routing per un setup simile.</p>
<p>Problema : <strong>Predisporre la connettività per un centro servizi da 10 uffici<br />
</strong></p>
<p>Soluzione : un server Linux , uno switch managed layer 2 da 16 porte, 11 switch unmanaged da 6 porte , due router adsl alice business .</p>
<p>L&#8217;articolo è un pippone tecnico parecchio lungo , quindi se proprio ti interessa puoi continuare la lettura <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><!--more--></p>
<p>Graficamente possiamo riassumere come segue :</p>
<p>Cliccare per ingrandire:</p>
<p><a href="http://itfonblog.wordpress.com/files/2008/12/salamone.png"><img class="alignnone size-full wp-image-582" title="salamone" src="http://itfonblog.wordpress.com/files/2008/12/salamone.png" alt="salamone" width="463" height="250" /></a></p>
<p>Per poter garantire l&#8217;isolamento di ogni ufficio abbiamo la necessità di assegnare ad ogni nodo un network da instradare poi all&#8217;interno del nostro router.</p>
<p>Prendiamo per prima cosa in esame come operare a livello server linux e switch managed layer 2.</p>
<p>Per un compito del genere non era possibile inserire nel server firewall tante schede di rete per quante reti c&#8217;era bisogno , per un evidente motivo di spazio e slot PCI disponibili. La tecnologia VLAN ci è venuta incontro per accompiere a questo scopo.</p>
<p>Grazie a VLAN una singola interfaccia fisica ethernet puo&#8217; avere fino a 4096 interfacce virtuali con il loro indirizzo IP univoco e separate in network diversi eventualmente routabili tramite il nostro server linux.</p>
<p>Per implementare VLAN in Ubuntu i pacchetti necessari sono disponibili con il semplice comando</p>
<pre class="brush: css;">aptitude install vlan</pre>
<p>Come secondo passo occorre definire gli indirizzi ip da assegnare ad ogni VLAN. Io avevo bisogno di 10 indirizzi di rete ed ho scelto blocchi in classe B editando il file /etc/network/interface come segue</p>
<pre class="brush: css;">

auto lo
iface lo inet loopback

#eth0 è il primo gateway WAN
auto eth0
iface eth0 inet static
address 192.168.50.2
netmask 255.255.255.0
broadcast 192.168.50.255

gateway 192.168.50.1

#eth1 è il secondo gateway WAN
auto eth1
iface eth1 inet static
address 192.168.51.2
netmask 255.255.255.0
broadcast 192.168.51.255

#eth2 è l'interfaccia che ospiterà le nostre VLAN

auto eth2
iface eth2 inet static
address 172.16.0.1
netmask 255.255.255.0
broadcast 172.16.0.255

#qui comincia la definizione delle VLAN

auto vlan2
auto vlan3
auto vlan4
auto vlan5
auto vlan6
auto vlan7
auto vlan8
auto vlan9
auto vlan10
auto vlan11

#VLAN2
iface vlan2 inet static
address 172.16.1.1
netmask 255.255.255.0
broadcast 172.16.1.255
vlan_raw_device eth2

#VLAN3
iface vlan3 inet static
address 172.16.2.1
netmask 255.255.255.0
broadcast 172.16.2.255
vlan_raw_device eth2

#VLAN4
iface vlan4 inet static
address 172.16.3.1
netmask 255.255.255.0
broadcast 172.16.3.255
vlan_raw_device eth2

#VLAN5
iface vlan5 inet static
address 172.16.4.1
netmask 255.255.255.0
broadcast 172.16.4.255
vlan_raw_device eth2

#VLAN6
iface vlan6 inet static
address 172.16.5.1
netmask 255.255.255.0
broadcast 172.16.5.255
vlan_raw_device eth2

#VLAN7
iface vlan7 inet static
address 172.16.6.1
netmask 255.255.255.0
broadcast 172.16.6.255
vlan_raw_device eth2

#VLAN8
iface vlan8 inet static
address 172.16.7.1
netmask 255.255.255.0
broadcast 172.16.7.255
vlan_raw_device eth2

#VLAN9
iface vlan9 inet static
address 172.16.8.1
netmask 255.255.255.0
broadcast 172.16.8.255
vlan_raw_device eth2

#VLAN10
iface vlan10 inet static
address 172.16.9.1
netmask 255.255.255.0
broadcast 172.16.9.255
vlan_raw_device eth2

#VLAN11
iface vlan11 inet static
address 172.16.10.1
netmask 255.255.255.0
broadcast 172.16.10.255
vlan_raw_device eth2 </pre>
<p>Non rimane a questo punto altro che far ripartire la rete con /etc/init.d/networking restart.<br />
Se tutto è andato per il verso giusto , dovremmo avere una configurazione di rete con ben 10 interfacce virtuali vlanX e tre interfacce fisiche ethX ognuna appartenente alla sua rete ed isolata dalle altre.</p>
<p>Per distribuire queste reti appena create abbiamo bisogno di uno switch managed Layer 2 e N-switch unmanaged per quante reti necessitiamo.</p>
<p>Nel particolare esempio di sopra io ho troncato sullo switch le porte dalla 1 alla 10 marcandole UNTAGGED nei parametri &#8220;ports to vlan&#8221; , mode=general , admit-all e con PVID della VLAN di appartenenza . Sull&#8217;ultima porta dello switch , fisicamente collegata alla eth2 , ho settato mode=general , admit-all e PVID 1 ; la marcatura &#8220;ports to VLAN&#8221; impostata su TAGGED .</p>
<p>Questo passaggio è un po&#8217; criptico , me ne rendo conto , e per questo inserisco alcuni screenshot relativi allo switch Linksys SRW2016. E&#8217; ovvio che lo stesso setup puo&#8217; essere fatto con un qualsiasi altro Layer2 managed .</p>
<p><img class="alignnone size-full wp-image-631" title="schermata1" src="http://itfonblog.wordpress.com/files/2009/01/schermata1.jpg" alt="schermata1" width="502" height="294" /></p>
<p><img class="alignnone size-full wp-image-632" title="schermata2" src="http://itfonblog.wordpress.com/files/2009/01/schermata2.jpg" alt="schermata2" width="492" height="168" /></p>
<p><img class="alignnone size-full wp-image-633" title="schermata3" src="http://itfonblog.wordpress.com/files/2009/01/schermata3.jpg" alt="schermata3" width="274" height="272" /></p>
<p>Ora abbiamo bisogno di un po&#8217; di sano dhcp e delle buone regole di iptables.</p>
<p>Cominciamo con il dhcp. La scelta è ricaduta su dhcp3-server che nella nostra ubuntu server e lontana giusto un</p>
<pre class="brush: css;">aptitude install dhcp3-server</pre>
<p>Il file di configurazione usato è il seguente</p>
<pre class="brush: css;">ddns-update-style none;
default-lease-time 86400;
max-lease-time 86400;

subnet 172.16.1.0 netmask 255.255.255.0 {
range 172.16.1.100 172.16.1.150;
option routers 172.16.1.1;
option domain-name-servers 172.16.1.1;
interface vlan2;
}

subnet 172.16.2.0 netmask 255.255.255.0 {
range 172.16.2.100 172.16.2.150;
option routers 172.16.2.1;
option domain-name-servers 172.16.2.1;
interface vlan3;
}

subnet 172.16.3.0 netmask 255.255.255.0 {
range 172.16.3.100 172.16.3.150;
option routers 172.16.3.1;
option domain-name-servers 172.16.3.1;
interface vlan4;
}

subnet 172.16.4.0 netmask 255.255.255.0 {
range 172.16.4.100 172.16.4.150;
option routers 172.16.4.1;
option domain-name-servers 172.16.4.1;
interface vlan5;
}

subnet 172.16.5.0 netmask 255.255.255.0 {
range 172.16.5.100 172.16.5.150;
option routers 172.16.5.1;
option domain-name-servers 172.16.5.1;
interface vlan6;
}

subnet 172.16.6.0 netmask 255.255.255.0 {
range 172.16.6.100 172.16.6.150;
option routers 172.16.6.1;
option domain-name-servers 172.16.6.1;
interface vlan7;
}
subnet 172.16.7.0 netmask 255.255.255.0 {
range 172.16.7.100 172.16.7.150;
option routers 172.16.7.1;
option domain-name-servers 172.16.7.1;
interface vlan8;
}

subnet 172.16.8.0 netmask 255.255.255.0 {
range 172.16.8.100 172.16.8.150;
option routers 172.16.8.1;
option domain-name-servers 172.16.8.1;
interface vlan9;
}

subnet 172.16.9.0 netmask 255.255.255.0 {
range 172.16.9.100 172.16.9.150;
option routers 172.16.9.1;
option domain-name-servers 172.16.9.1;
interface vlan10;
}

subnet 172.16.10.0 netmask 255.255.255.0 {
range 172.16.10.100 172.16.10.150;
option routers 172.16.10.1;
option domain-name-servers 172.16.10.1;
interface vlan11;
}
</pre>
<p>A questo punto , dopo aver dato un <em>/etc/init.d/dhcp3-server restart</em> potete cominciare a divertirvi a giocare al telefonista anni 30 , inserendo e disinserendo lo spinotto di rete nelle varie porte dello switch e vedere il vostro computer cambiare ogni volta indirizzo IP . Io mi sono entusiasmato , ma si sa sono un inguaribile nerd.</p>
<p>Passiamo alle regole di iptables. Come per ogni altro lavoro , io mi affido all&#8217;ottimo frontend offerto da shorewall . Vediamo di seguito come procedere per garantire :</p>
<ol>
<li>Connettività internet con due adsl e tramite transparent proxy</li>
<li>Isolamento delle vlan tra di loro e verso il proxy</li>
</ol>
<p>Come detto sopra il nostro link verso internet è fornito da due adsl , di telecom nello specifico , quindi dopo aver cambiato gli indirizzi ip dei due router in 192.168.50.1 e 192.168.51.1 cominciamo ad editare il primo file di configurazione di shorewall: <em>providers</em>.</p>
<pre class="brush: css;">

alice1    1       1       main            eth0            192.168.50.1  track,balance
alice2    2      2       main            eth1            192.168.51.1  track,balance
</pre>
<p>Con questo semplice script abbiamo detto di inserire nella tabella di routing un round <span style="text-decoration:line-through;">robbing</span> robin verso la WAN.</p>
<p>Ora definiamo le zone del nostro firewall editando il file zones</p>
<pre class="brush: css;">

fw      firewall
net     ipv4
loc     ipv4
vlan2   ipv4
vlan3   ipv4
vlan4   ipv4
vlan5   ipv4
vlan6   ipv4
vlan7   ipv4
vlan8   ipv4
vlan9   ipv4
vln10   ipv4
vln11   ipv4
</pre>
<p>Da notare che a shorewall non piacciono le zone definite con più di 5 caratteri , quindi VLAN11 diventa VLN11 <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Il prossimo file è <em>interfaces</em></p>
<pre class="brush: css;">

net     eth0    detect
net     eth1    detect
loc     eth2    detect  dhcp
vlan2   vlan2   detect  dhcp
vlan3   vlan3   detect  dhcp
vlan4   vlan4   detect  dhcp
vlan5   vlan5   detect  dhcp
vlan6   vlan6   detect  dhcp
vlan7   vlan7   detect  dhcp
vlan8   vlan8   detect  dhcp
vlan9   vlan9   detect  dhcp
vln10   vlan10  detect  dhcp
vln11   vlan11  detect  dhcp</pre>
<p>Eth0 e eth1 sono le nostre interfacce wan , eth2 è la nostra interfaccia locale a cui sono attestate tutte le vlan</p>
<p>Ora un po di sano masquerading tramite l&#8217;editing del file <em>masq</em></p>
<pre class="brush: css;">

eth0   192.168.51.2    192.168.50.2
eth1   192.168.50.2   192.168.51.2
eth0  eth2  192.168.50.2
eth1  eth2  192.168.51.2
eth2    vlan2
eth0    vlan2  192.168.50.2
eth1   vlan2    192.168.51.2
eth0    vlan3  192.168.50.2
eth1    vlan3   192.168.51.2
eth0    vlan4  192.168.50.2
eth1    vlan4   192.168.51.2
eth0    vlan5  192.168.50.2
eth1    vlan5   192.168.51.2
eth0    vlan6  192.168.50.2
eth1    vlan6   192.168.51.2
eth0    vlan7  192.168.50.2
eth1    vlan7   192.168.51.2
eth0    vlan8  192.168.50.2
eth1   vlan8    192.168.51.2
eth0    vlan9  192.168.50.2
eth1   vlan9    192.168.51.2
eth0    vlan10  192.168.50.2
eth1   vlan10   192.168.51.2
eth0    vlan11  192.168.50.2
eth1   vlan11    192.168.51.2</pre>
<p>Già a questo punto le regole di masquerading permetterebbero il corretto funzionamento delle reti verso internet. Ma noi vogliamo un isolamento tra le reti a livello lan e soprattutto un filtraggio tramite proxy trasparente con controllo dei contenuti tramite dansguardian.</p>
<p>Mettiamo ora mano al file policy</p>
<pre class="brush: css;">

net     net     DROP
vlan2   loc     ACCEPT
loc     vlan2   ACCEPT
$FW     loc     ACCEPT
vlan2   $FW     ACCEPT
$FW     vlan2   ACCEPT
loc     $FW     ACCEPT
loc     net     ACCEPT
$FW     net     ACCEPT
all     all     REJECT  info
</pre>
<p>Come possiamo vedere da queste regole solo la vlan2 ha accesso sia alla zona net ed al firewall , in quanto vlan2 verrà assegnata agli amministratori del centro uffici. La regola all all REJECT , posta come ultima della catena , impedisce qualsiasi connessione non indicata sopra.</p>
<p>Il prossimo file da editare è <em>rules</em></p>
<pre class="brush: css;">

ACCEPT  net     fw      tcp     1022
ACCEPT  loc     vlan2   tcp     135,139
ACCEPT  loc     vlan2   icmp    8
ACCEPT  vlan2   fw      tcp     1:65500
ACCEPT  vlan2   fw      udp     1:65500
ACCEPT  vlan2   net     tcp     1:65500
ACCEPT  vlan2   net     udp     1:65500
ACCEPT  vlan3   fw      tcp     8080
ACCEPT  vlan3   fw      udp     53
ACCEPT  vlan3   net     tcp     443
ACCEPT  vlan4   fw      tcp     8080
ACCEPT  vlan4   fw      udp     53
ACCEPT  vlan4   net     tcp     443
ACCEPT  vlan5   fw      tcp     8080
ACCEPT  vlan5   fw      udp     53
ACCEPT  vlan5   net     tcp     443
ACCEPT  vlan6   fw      tcp     8080
ACCEPT  vlan6   fw      udp     53
ACCEPT  vlan6   net     tcp     443
ACCEPT  vlan7   fw      tcp     8080
ACCEPT  vlan7   fw      udp     53
ACCEPT  vlan7   net     tcp     443
ACCEPT  vlan8   fw      tcp     8080
ACCEPT  vlan8   fw      udp     53
ACCEPT  vlan8   net     tcp     443
ACCEPT  vlan9   fw      tcp     8080
ACCEPT  vlan9   fw      udp     53
ACCEPT  vlan9   net     tcp     443
ACCEPT  vln10   fw      tcp     8080
ACCEPT  vln10   fw      udp     53
ACCEPT  vln10   net     tcp     443
ACCEPT  vln11   fw      tcp     8080
ACCEPT  vln11   fw      udp     53
ACCEPT  vln11   net     tcp     443
REDIRECT  vlan3    8080     tcp      www
REDIRECT  vlan4    8080     tcp      www
REDIRECT  vlan5    8080     tcp      www
REDIRECT  vlan6    8080     tcp      www
REDIRECT  vlan7    8080     tcp      www
REDIRECT  vlan8    8080     tcp      www
REDIRECT  vlan9    8080     tcp      www
REDIRECT  vln10   8080      tcp      www
REDIRECT  vln11   8080     tcp       www
ACCEPT    $FW        net      tcp      www
</pre>
<p>Vlan2 pieno accesso a internet e al firewall tutte le altre hanno accesso solo alla porta 8080 tcp del firewall , alla porta 53 udp sempre del firewall e alla porta 443 verso internet. Sulla porta 8080 TCP nel firewall rimane in ascolto Dansguardian che provvede poi a rigirare le richieste a squid sulla porta 3128 . Non mi dilungherò sul setup di questi due programmi .  La porta 53 UDP è aperta per le risoluzioni dei nomi e la 443 TCP per le connessioni in ssl , che non possono essere gestite da un transparent proxy.</p>
<p>Abbiamo finito . Con un <em>shorewall restart</em> ricostruimo la nostra catena di iptables e tutto dovrebbe funzionare.</p>
<p>Questa è una configurazione statica che però male si addice ad un centro uffici , dove le stanze vengono affittate per soli due giorni e quindi scaduti i termini la connessione verso internet  deve cadere.</p>
<p>Io ho pensato e realizzato un accrocchio per segare le rotte delle vlan degli uffici in affitto , tramite un&#8217;estensione del programma gestionale che gira sulla rete dell&#8217;amministrazione.</p>
<p>Con una aggiunta al suo programma di contabilità , Mirko ha approntato uno schedulatore che a seconda delle prenotazioni invia in ssh al server i seguenti comandi :</p>
<pre class="brush: css;">

ip ro del 172.16.2.0/24</pre>
<p>Quando deve tirare giù la vlan e</p>
<pre class="brush: css;">

ip ro add 172.16.2.0/24 dev vlan3 </pre>
<p>Se dobbiamo riattivare la vlan .</p>
<p>Attualmente il centro servizi è gia in produzione con questo setup . Prossime implementazioni saranno una rete wireless con captive portal e un sistema di stampe centralizzate con credito prepagato a scalare.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Shorewall firewall on UBUNTU LTS 8.04 server doesn't start on boot]]></title>
<link>http://primalcortex.wordpress.com/2009/01/07/shorewall-firewall-on-ubuntu-lts-804-server-doesnt-start-on-boot/</link>
<pubDate>Wed, 07 Jan 2009 16:00:50 +0000</pubDate>
<dc:creator>primalcortex</dc:creator>
<guid>http://primalcortex.wordpress.com/2009/01/07/shorewall-firewall-on-ubuntu-lts-804-server-doesnt-start-on-boot/</guid>
<description><![CDATA[I have in one of my machines a pretty annoying situation related to the fact if the UBUNTU based fir]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><blockquote><p>I have in one of my machines a pretty annoying situation related to the fact if the UBUNTU based firewall reboot&#8217;s, the firewall doesn&#8217;t start automatically&#8230;</p>
<p>This is pretty annoying because it means that after a power failure, there is a need for manual intervention to restore exterior access trough the firewall to internal servers.</p>
<p>The solution?</p>
<p>Well I&#8217;ve made a bash script, named resetfw.sh that checks the server uptime and if it falls bellow a threshold of 10 minutes, it restarts the firewall:</p>
<p><strong>DAYS=`uptime &#124; cut -d &#8216; &#8216;  -f   4`<br />
HOURS=`uptime &#124; cut -d &#8216; &#8216;  -f   6`<br />
HOUR=`echo $HOURS &#124; cut -d &#8216;:&#8217; -f   1`<br />
MIN_NP=`echo $HOURS &#124; cut -d &#8216;:&#8217; -f   2`<br />
MIN=`echo $MIN_NP &#124; cut -c 1-2`</strong></p>
<p><strong>if [ $DAYS = "0" ]; then</strong></p>
<p><strong>if [ $HOUR = "0" ]; then</strong></p>
<p><strong>if [ $MIN -lt "10" ]; then</strong></p>
<p><strong>/etc/init.d/shorewall stop<br />
/etc/init.d/shorewall start<br />
/etc/init.d/shorewall stop<br />
/etc/init.d/shorewall restart</strong></p>
<p><strong>logger &#8220;Firewall reset due to reboot: Uptime on action: $DAYS days, $HOUR:$MIN&#8221;<br />
fi<br />
fi</strong></p>
<p><strong>fi</strong></p></blockquote>
<p>Then all we have to due is to run this script periodically through the crontab:</p>
<p><strong>*/5 * * * * /root/resetfw.sh</strong></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Menggabungkan Beberapa ISP dalam Satu Jaringan]]></title>
<link>http://masbanu.wordpress.com/2008/11/18/menggabungkan-beberapa-isp-dalam-satu-jaringan/</link>
<pubDate>Mon, 17 Nov 2008 18:50:03 +0000</pubDate>
<dc:creator>masbanu</dc:creator>
<guid>http://masbanu.wordpress.com/2008/11/18/menggabungkan-beberapa-isp-dalam-satu-jaringan/</guid>
<description><![CDATA[Bila Anda punya 2 jalur internet, misalkan yang satu speedy satunya FO dari astinet, maka Anda dapat]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Bila Anda punya 2 jalur internet, misalkan yang satu speedy satunya FO dari astinet, maka Anda dapat menggabungkannya sehingga jadi user dapat memilih saluran mana yg mau dikoneksikan ke internet. Caranya adalah menggunakan Load Balancing di Linux dengan Shorewall atau kalau anda pakai Mikrotik bisa dilakukan dengan mudah. Cara kerjanya umpama adalah ada ISP1 dan ISP2, ISP1 sebagai ISP primer sehingga nantu kalau ISP1 sudah Overload maka akan secar otomatis di Pindah jalur internetnya ke ISP 2<br />
begitu terus menerus.</p>
<p>referensi<br />
Shorewall.net<br />
Mikrotik.co.id</p>
<p>&#8212;&#8212;&#8212;&#8212;</p>
<p>sumber: agungsulistyo.wordpress.com</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Server Warnet pake Mandriva]]></title>
<link>http://bayuart.wordpress.com/2008/10/06/server-warnet-pake-mandriva/</link>
<pubDate>Mon, 06 Oct 2008 04:50:37 +0000</pubDate>
<dc:creator>bayuart</dc:creator>
<guid>http://bayuart.wordpress.com/2008/10/06/server-warnet-pake-mandriva/</guid>
<description><![CDATA[langsung aja, meskipun ini topik lama, yang penting tetep bisa kepake. kenapa ko di bilang lama ? ya]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>langsung aja, meskipun ini topik lama, yang penting tetep bisa kepake. kenapa ko di bilang lama ? ya karena tulisan-tulisan sebelome emang udah di buat. ya disini juga si. nanti daftare tak liate lagi, kebanyakan pake istilah linux internet connection sharing. ini cuman iseng aja. back to easy with mandriva linux <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>ok untuk masalah instal dari awal or dari live cd mandriva semuane boleh dilakukan. asal ya jangan instal windows aja. windows xp jangan, apalagi windows vista. jadi jangan pake windows lah. la wong ini tulisan buat yang pake linux kok, khususnya mandriva linux :p</p>
<p>setelah tahapan instalasi dari live cd or installer cd selesai boleh pake mode GUI (grafik) or text. langsung aja edit file /etc/inittab (sori pake cara console).</p>
<p>kalo dari GUI jalankan kan / masuk ke mode teks. masuk ke root pake su trus langsung edit</p>
<p>vim /etc/inittab</p>
<p>cari baris yang isinya kaya ini</p>
<p>id:5:initdefault:</p>
<p>init 5 seperti keterangan diatasnya adalah mode default ke GUI. jadi disini rencana buat server warnet yang text mode aja. so ganti nilai 5 dengan 3, jadi seperti ini</p>
<p>id:3:initdefault:</p>
<p>kemudian simpan dengan menekan tombol ESC (2x) trus tekan tombol &#8220;:&#8221; (titik dua, dengan cara tekan tombol shift dan titik dua), trus ketik &#8220;wq&#8221; tanpa tanda petik.</p>
<p><!--more--></p>
<p>ok selesai buat bikin tu mandriva pas pertama booting langsung masuk mode text. itu cara manual. kalo kepengen pake cara otomatis begini: masuk ke root, kemudian jalankan perintah mcc (mandriva control center)</p>
<p>[root@localhost box]# mcc</p>
<p>di menu tu pake tombol tab buat mindah ke bagian, dan tanda panah kursor buat naik turinin pilihan.</p>
<p>di menu MCC, kemudian tekan tab, trus pilih menu Display, kalo menu Display udah kesorot pake kursor, trus tekan tab lagi pilih OK.</p>
<p>sekarang udah masuk ke menu Display, langsung aja pilih menu Option, trus tekan enter. di menu Option ada pilihan Graphical interface at startup, tuh dipilih bawahnya. dan tanda centangnya di ilangin aja pake tombol space. abis tu ya pilik OK lah. trus Quit.</p>
<p>hasilnya sama aja dengan mengedit file /etc/inittab secara manual. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>bersambung dulu ya&#8230; udah laper nie. mo sarapan dulu&#8230;</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Shorewall : Transparent Proxy]]></title>
<link>http://bayuart.wordpress.com/2008/10/04/shorewall-transparent-proxy/</link>
<pubDate>Sat, 04 Oct 2008 06:42:15 +0000</pubDate>
<dc:creator>bayuart</dc:creator>
<guid>http://bayuart.wordpress.com/2008/10/04/shorewall-transparent-proxy/</guid>
<description><![CDATA[Bawaan Mandriva Spring 2008.1 pake shorewall versi 4.0.9, dan hasil dari proses menu wizard Internet]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Bawaan Mandriva Spring 2008.1 pake shorewall versi 4.0.9, dan hasil dari proses menu wizard Internet Connection Sharing nya Mandriva Control Center or mcc kaya ini :</p>
<p>cat /etc/shorewall/rules.drakx</p>
<p>ACCEPT+ fw      net     tcp     http    -       -       -       squid<br />
REDIRECT        fw      3128    tcp     http    -<br />
REDIRECT        loc     3128    tcp     http    -</p>
<p>untuk step by step nya ICS dari MCC bisa di cek di sini</p>
<p><a title="ICS internet connection Sharing" href="http://picasaweb.google.com/bayuart/MandrivaInternetConnectionSharing" target="_blank">http://picasaweb.google.com/bayuart/MandrivaInternetConnectionSharing</a></p>
<p>meskipun pake PCLinuxOS mode grafik, mode teks nya gak jauh beda. so pelajari aja.</p>
<p>dan hasil squid.conf nya bisa di cek disini :</p>
<p><a title="squid.conf" href="http://bayu.blitar.org/2008/09/30/contoh-squidconf/" target="_blank">http://bayu.blitar.org/2008/09/30/contoh-squidconf/</a></p>
<p>untuk DNS dan dhcp silahkan liat  langsung disistem nya <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Brincando de servidor]]></title>
<link>http://oreia.wordpress.com/2008/06/03/brincando-de-servidor/</link>
<pubDate>Tue, 03 Jun 2008 18:11:52 +0000</pubDate>
<dc:creator>OreiA</dc:creator>
<guid>http://oreia.wordpress.com/2008/06/03/brincando-de-servidor/</guid>
<description><![CDATA[Ééééé.. nesse sábado passado dei inicio a mais uma de minhas &#8220;proezas&#8221;. Um server Debian]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Ééééé.. nesse sábado passado dei inicio a mais uma de minhas &#8220;proezas&#8221;. Um server Debian 4.0 Etch.. =D</p>
<p>A idéia é rodar um server Web com aplicativo em <a href="http://www.python.org" target="_blank">Python</a> (usando <a href="http://www.djangoproject.com/" target="_blank">Django</a>) e <a href="http://www.mysql.com" target="_blank">MySQL</a> no qual será minha futura forma de renda.. =D</p>
<p>O server já está no ar, com <a href="http://www.openssh.org" target="_blank">SSH</a>, <a href="http://www.openvpn.org/" target="_blank">OpenVPN</a>, <a href="http://www.shorewall.net" target="_blank">Shorewall</a>, <a href="http://us6.samba.org/samba/" target="_blank">Samba</a>, <a href="http://www.python.org" target="_blank">Python</a>, <a href="http://www.djangoproject.com" target="_blank">Django</a>, <a href="http://www.mysql.com" target="_blank">MySQL</a>, <a href="http://httpd.apache.org/" target="_blank">Apache2</a> e <a href="http://www.no-ip.com" target="_blank">No-IP.</a></p>
<p>Por enquanto não irei divulgar o endereço nem a idéia do aplicativo, mas assim que estiver tomando forma aqui será o primeiro lugar.. =D</p>
<p>abraços!</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Shorewall: accepting SSH access from certain IP-addresses only]]></title>
<link>http://oei.yungchin.nl/2008/05/07/shorewall-accepting-ssh-access-from-certain-ip-addresses-only/</link>
<pubDate>Wed, 07 May 2008 08:37:29 +0000</pubDate>
<dc:creator>yungchin</dc:creator>
<guid>http://oei.yungchin.nl/2008/05/07/shorewall-accepting-ssh-access-from-certain-ip-addresses-only/</guid>
<description><![CDATA[OK, I&#8217;m not entirely sure how useful this is, but since I know that I only want to give SSH ac]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>OK, I&#8217;m not entirely sure how useful this is, but since I know that I only want to give SSH access to my home box from one external box (with a fixed IP address), I might as well configure it to accept only connections from that machine.</p>
<p>It is my machine at work, which I trust to be parasite-free. I would never SSH in from just a random box &#8211; what use is a secure shell if you don&#8217;t trust the end-point you&#8217;re using? So anyway, I thought I&#8217;d make some nice <a title="Shoreline Firewall" href="http://www.shorewall.net/">shorewall</a> rules. Accepting SSH connections only from one address and dropping requests from any other addresses doesn&#8217;t necessarily make things more secure, but at the very least it saves some log output.</p>
<p>Given the setup of the home network, it turned out that I in fact needed two rules (it took a few minutes before I got my head around that). The box that runs shorewall also acts as a wireless access point, using IP masquerading (set up through /etc/shorewall/masq) to share the wired connection. I already had these policies set up in /etc/shorewall/policy:</p>
<pre style="padding-left:30px;">#SOURCE         DEST            POLICY          LOG LEVEL
net             $FW             DROP            info
net             loc             DROP            info
net             all             DROP            info</pre>
<p>which I think is pretty much standard (note: I&#8217;m leaving out empty columns at the end). Now, I needed a rule in /etc/shorewall/rules to make an exception from these default policies:</p>
<pre style="padding-left:30px;">#ACTION         SOURCE                DEST                  PROTO   DEST
#                                                                   PORT
ACCEPT          net:XXX.XXX.XXX.XXX   $FW                   tcp     ssh
</pre>
<p>where XXX is the IP address of the machine at work. Now, that (somewhat to my surprise) didn&#8217;t quite work. I could now see my home machine from the work machine (i.e. the SSH request was rejected rather than dropped), but I wasn&#8217;t allowed in. The reason is of course that when you use IP masquerading, the system needs to know where to route incoming connections to. So a second rule in /etc/shorewall/rules was needed:</p>
<pre style="padding-left:30px;">DNAT            net:XXX.XXX.XXX.XXX   loc:YYY.YYY.YYY.YYY   tcp     ssh</pre>
<p>&#8230;and that fixed it. Maybe I could have even more fun if I selected the incoming connections by MAC-address (through /etc/shorewall/maclist), but that&#8217;s for another day. The coolest thing: to get this going I didn&#8217;t need to refer to any documentation other than the examples at the top of the configuration files. Now <em>that</em> is good documentation.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Mandriva Spring 2008 : Loadbalance pake 2 Speedy]]></title>
<link>http://bayuart.wordpress.com/2008/05/01/mandriva-spring-2008-loadbalance-pake-2-speedy/</link>
<pubDate>Wed, 30 Apr 2008 23:50:45 +0000</pubDate>
<dc:creator>bayuart</dc:creator>
<guid>http://bayuart.wordpress.com/2008/05/01/mandriva-spring-2008-loadbalance-pake-2-speedy/</guid>
<description><![CDATA[speedol1 : IP Modem 192.168.1.254 netmask 255.255.255.0 (masih standar pabrik, pake modem billion) s]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><strong>speedol1 :</strong></p>
<blockquote><p>IP Modem 192.168.1.254 netmask 255.255.255.0 (masih standar pabrik, pake modem billion)</p></blockquote>
<p><strong>speedol2 :</strong></p>
<blockquote><p>IP Modem 192.168.3.254 netmask 255.255.255.0 (bawaan pabrik udah di ganti)</p></blockquote>
<p><strong>Mandriva Spring 2008 pake 3 NIC / Ethernet card, di Pentium-IV HDD 40GB RAM 1Gb</strong></p>
<blockquote><p>eth0 : 192.168.1.253 netmask 255.255.255.0</p>
<p>eth1: 192.168.3.253 netmask 255.255.255.0</p>
<p>eth2: 192.168.2.1 netmask 255.255.255.224</p></blockquote>
<p><a title="bayu blitar" href="http://bayu.blitar.org/index.php/shorewall-load-balancing/" target="_blank">selengkapnya &#8230;</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[]]></title>
<link>http://mapopa.wordpress.com/2008/02/13/984/</link>
<pubDate>Wed, 13 Feb 2008 15:39:00 +0000</pubDate>
<dc:creator>miaurs</dc:creator>
<guid>http://mapopa.wordpress.com/2008/02/13/984/</guid>
<description><![CDATA[postfix+dovecot howto for an small mail server (router too) our aging rh9 mail server started to sho]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>postfix+dovecot howto for an small mail server (router too)</p>
<p>our aging rh9 mail server started to show it&#8217;s caps age and started to fail (p3@350Mhz with 256M ram and 2G hdd)<br />on each day (hw errors) so we are switching to an more modern ubuntu gutsy on an<br />p4@1.6Ghz (712M ram) and 40G WD drive</p>
<p>Old config was sendmail+pop3+shorewall<br />The new config is postfix+dovecot+shorewall<br />Here is the guides i followed<br /><a href="https://help.ubuntu.com/community/Postfix">https://help.ubuntu.com/community/Postfix</a><br /><a href="https://help.ubuntu.com/community/Dovecot">https://help.ubuntu.com/community/Dovecot</a><br /><a href="http://www.shorewall.net/two-interface.htm">http://www.shorewall.net/two-interface.htm</a></p>
<p>ps: some of the hw errors we had in the logs</p>
<pre>WARNING:  Kernel Errors Present  hda: task_no_data_intr: error=0x04 { DriveStat...:  2Time(s)  hda: task_no_data_intr: status=0x51 { DriveReady SeekComplete Error }...:  2Time(s)</pre>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[shorewall and ulogd]]></title>
<link>http://madjack.wordpress.com/2006/08/28/shorewall-and-ulogd/</link>
<pubDate>Sun, 27 Aug 2006 18:34:53 +0000</pubDate>
<dc:creator>madjack</dc:creator>
<guid>http://madjack.wordpress.com/2006/08/28/shorewall-and-ulogd/</guid>
<description><![CDATA[(last update : Aug 31, 2006 7.30pm GMT +8) Actually, this post is not totally all about shorewall, i]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><i>(last update : Aug 31, 2006 7.30pm GMT +8)</i></p>
<p><i></i><br />
Actually, this post is not totally all about shorewall, it applied to other iptables-based firewall as well. If you build your own iptables script, then this article might help too. By default, most of the iptables logs will be logged into /var/log/messages file by syslogd. The downside of this is that it will messed up with other daemon&#8217;s and systemlogs files as well. For example, if im to find some logs files other than iptables logs, i`ll need to search through the entire big log file(if you did not limit the number of logs per minute, that will make your life even more terrible <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ) and this wastes time. Checkout the below screenshot for an example:-</p>
<p><a href="http://www.flickr.com/photos/74153085@N00/226271821/" title="Photo Sharing"><img src="http://static.flickr.com/74/226271821_93c592a785_o.gif" alt="complication" height="180" width="240" /></a><i></i></p>
<p><i>A messy /var/log/messages file with iptables logfiles and other systems log.</i></p>
<p><i></i><br />
To make things much more simpler, Shorewall is able to support ulogd.Ulogd, as described at <a href="http://www.netfilter.org/projects/ulogd/index.html">Netfilter</a> website, is a userspace logging daemon for netfilter/iptables related logging.  This includes per-packet logging of security violations, per-packet logging for accounting purpose as well as per-flow logging. To make life more easier and simpler, all iptables logs will be directed to user-specified logfile without interfering syslogd at all. So, here&#8217;s my little basic notes about setting up ulogd with <a href="http://www.shorewall.net/">Shorewall</a> firewall kit.</p>
<p><i>Note that this tutorial is conducted on <a href="http://www.slackware.com/">Slackware</a> 10.2 linux with stock kernel, iptables version 1.3.3, Shorewall v3.2.2 and ulogd 1.2.4.</i></p>
<p>1) Your linux distro kernel should includes ulog target support by default unless you are using old distro though. So, there is no need to recompile your kernel. Simply obtain the latest ulogd from <a href="http://www.netfilter.org/news.html#2006-01-25">Netfilter</a> website. The latest version is 1.2.4<br />
2) As usual, compile it as root :-</p>
<p><b>./configure</b> <b>&#38;&#38; make &#38;&#38; make install</b></p>
<p>If you did not change anything during ./configure, ulogd binary should go to /usr/local/sbin/ and the config file will located at /usr/local/etc/ulogd.conf. By the way, there&#8217;s a support for MYSQL. If this is the case, you need to initiate ./configure &#8211;with-mysql</p>
<p>3) Configure ulogd.conf. There is nothing much to change actually. Maybe you might like to see other output of iptables log instead of old-style syslog output. Look under the &#8220;output plugins&#8221; section to change your favourite output format.<br />
4) Next step, change the Shorewall&#8217;s target log into ULOG inside your /etc/shorewall folder. For me, i will have a look inside the &#8220;policy&#8221; and &#8220;rules&#8221; files and change the existings &#8220;:info&#8221; to &#8220;:ULOG&#8221;. For example :-</p>
<p><i>#ACTION SOURCE          DEST            PROTO   DEST    SOURCE          ORIGINAL</i></p>
<p><i>DROP:<b>ULOG</b>  loc             inet            tcp     80,21,6667:7000<br />
The ULOG must be in all CAPITAL LETTERS.</i></p>
<p>5) Finally, run the ulogd command as root at /usr/local/sbin/ulogd -d. It would be more convenient if you could figure a way out to automatically run it during your linux box startup. For slackware, create and edit the /etc/rc.d/rc.ulogd and simply enter the following lines :-</p>
<p><i>#!/bin/sh<br />
# Start/stop/restart ulogd.</i></p>
<p><i># Start ulogd:<br />
ulogd_start() {<br />
if [ -x /usr/local/sbin/ulogd ]; then<br />
echo &#8220;Starting ulogd daemon:  /usr/local/sbin/ulogd -d&#8221;<br />
/usr/local/sbin/ulogd -d<br />
fi<br />
}</i></p>
<p><i># Stop ulogd:<br />
ulogd_stop() {<br />
killall ulogd<br />
}</i></p>
<p><i># Restart ulogd:<br />
ulogd_restart() {<br />
ulogd_stop<br />
sleep 1<br />
ulogd_start<br />
}</i></p>
<p><i>case &#8220;$1&#8243; in<br />
&#8217;start&#8217;)<br />
ulogd_start<br />
;;<br />
&#8217;stop&#8217;)<br />
ulogd_stop<br />
;;<br />
&#8216;restart&#8217;)<br />
ulogd_restart<br />
;;<br />
*)</i></p>
<p>and also, edit the /etc/rc.rd/rc.M file(add the entry which is in bold fonts) :-<br />
<i># Start the system logger.<br />
if [ -x /etc/rc.d/rc.syslog -a -x /usr/sbin/syslogd -a -d /var/log ]; then<br />
. /etc/rc.d/rc.syslog start<br />
fi</p>
<p><b># Start the ulogd logger.<br />
if [ -x /etc/rc.d/rc.ulogd ]; then<br />
. /etc/rc.d/rc.ulogd start<br />
fi</b></i></p>
<p>So..there you go, the ulogd daemon shall be started automatically before shorewall is loaded and all the shorewall logs(except shorewall initialization logs, which still will be logged at /var/log/messages) should go to the ulogd&#8217;s file which is mentioned at ulogd.conf.  As a side note, you might want to include it into your logrotate by editing /etc/logrotate.d/syslog :-</p>
<p><i>/var/log/shorewall.log  {<br />
compress<br />
daily<br />
rotate 4<br />
create<br />
postrotate<br />
/etc/rc.d/rc.ulogd restart 2&#62;/dev/null<br />
endscript<br />
}<br />
</i></p>
<p>If you have any question,feel free to comment me then..</p>
</div>]]></content:encoded>
</item>

</channel>
</rss>
