<?xml version="1.0" encoding="UTF-8"?>
<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/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Temporini Matteo &#187; kernel</title>
	<atom:link href="http://www.temporini.net/category/kernel/feed" rel="self" type="application/rss+xml" />
	<link>http://www.temporini.net</link>
	<description>It&#039;s time to fix!</description>
	<lastBuildDate>Tue, 07 Sep 2010 06:56:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Traffic Shaping: come ti limito la banda con tc e iptables</title>
		<link>http://www.temporini.net/traffic-shaping-come-ti-limito-la-banda-con-tc-e-iptables</link>
		<comments>http://www.temporini.net/traffic-shaping-come-ti-limito-la-banda-con-tc-e-iptables#comments</comments>
		<pubDate>Thu, 05 Feb 2009 22:00:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Matteo]]></category>
		<category><![CDATA[file sharing]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[servizi]]></category>
		<category><![CDATA[comandi linux]]></category>
		<category><![CDATA[configurazione]]></category>
		<category><![CDATA[kilobytes]]></category>
		<category><![CDATA[link bandwidth]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[megabytes]]></category>
		<category><![CDATA[tc]]></category>

		<guid isPermaLink="false">http://www.temporini.net/?p=244</guid>
		<description><![CDATA[<p>Questa sera ho avuto l&#8217;esigenza di fare un po&#8217; di traffic shaping casalingo per un piccolo progetto.</p>
<p>Dovevo limitare la banda globale (quella globale non quella del singolo file scaricato), del server ftp.</p>
<p>Soluzione al problema due comandi linux: tc e iptables.</p>
<p>Lo script che ci permetterà di fare tutto è questo:</p>
<p># Change this to your link bandwidth
# (for [...]]]></description>
			<content:encoded><![CDATA[<p>Questa sera ho avuto l&#8217;esigenza di fare un po&#8217; di <strong>traffic shaping</strong> casalingo per un piccolo progetto.</p>
<p>Dovevo limitare la banda globale (quella globale non quella del singolo file scaricato), del server ftp.</p>
<p>Soluzione al problema due <a href="http://www.temporini.net/tag/comandi-linux" class="st_tag internal_tag" rel="tag" title="Posts tagged with comandi linux">comandi linux</a>: <strong><a href="http://www.temporini.net/tag/tc" class="st_tag internal_tag" rel="tag" title="Posts tagged with tc">tc</a></strong> e <strong><a href="http://www.temporini.net/tag/iptables" class="st_tag internal_tag" rel="tag" title="Posts tagged with iptables">iptables</a></strong>.</p>
<p>Lo script che ci permetterà di fare tutto è questo:</p>
<p><code># Change this to your <a href="http://www.temporini.net/tag/link-bandwidth" class="st_tag internal_tag" rel="tag" title="Posts tagged with link bandwidth">link bandwidth</a><br />
# (for cable modem, DSL links, etc. put the maximal bandwidth you can<br />
# get, not the speed of a local Ethernet link)<br />
REAL_BW='20Mbit'</code></p>
<p><code># Change this to the bandwidth you want to allocate to FTP.<br />
# We're talking about megabits, not <a href="http://www.temporini.net/tag/megabytes" class="st_tag internal_tag" rel="tag" title="Posts tagged with megabytes">megabytes</a>, so 80Kbit is<br />
# 10 <a href="http://www.temporini.net/tag/kilobytes" class="st_tag internal_tag" rel="tag" title="Posts tagged with kilobytes">Kilobytes</a>/s<br />
FTP_BW='600Kbit'</code></p>
<p><code># Change this to your physical network device (or 'ppp0')<br />
NIC='eth0'</code></p>
<p><code># Change this to the ports you assigned for passive FTP<br />
FTP_PORT_LOW="10000"<br />
FTP_PORT_HIGH="20000"</code></p>
<p><code><a href="http://www.temporini.net/tag/tc" class="st_tag internal_tag" rel="tag" title="Posts tagged with tc">tc</a> qdisc add dev "$NIC" root handle 1: cbq \<br />
bandwidth "$REAL_BW" avpkt 1000</code></p>
<p><code><a href="http://www.temporini.net/tag/tc" class="st_tag internal_tag" rel="tag" title="Posts tagged with tc">tc</a> class add dev "$NIC" parent 1: classid 1:1 cbq bandwidth "$REAL_BW" \<br />
rate "$REAL_BW" maxburst 5 avpkt 1000</code></p>
<p><code><a href="http://www.temporini.net/tag/tc" class="st_tag internal_tag" rel="tag" title="Posts tagged with tc">tc</a> class add dev "$NIC" parent 1:1 classid 1:10 cbq \<br />
bandwidth "$REAL_BW" rate "$FTP_BW" maxburst 5 avpkt 1000 bounded</code></p>
<p><code><a href="http://www.temporini.net/tag/tc" class="st_tag internal_tag" rel="tag" title="Posts tagged with tc">tc</a> qdisc add dev "$NIC" parent 1:10 sfq quantum 1514b</code></p>
<p><code><a href="http://www.temporini.net/tag/tc" class="st_tag internal_tag" rel="tag" title="Posts tagged with tc">tc</a> filter add dev "$NIC" parent 1: protocol ip handle 1 fw flowid 1:10</code></p>
<p><code><a href="http://www.temporini.net/tag/iptables" class="st_tag internal_tag" rel="tag" title="Posts tagged with iptables">iptables</a> -t mangle -A OUTPUT -p tcp --sport 20:21 -j MARK --set-mark 1</code></p>
<p><code><a href="http://www.temporini.net/tag/iptables" class="st_tag internal_tag" rel="tag" title="Posts tagged with iptables">iptables</a> -t mangle -A OUTPUT -p tcp \<br />
--sport "$FTP_PORT_LOW":"$FTP_PORT_HIGH" -j MARK --set-mark 1</code></p>
<p>Nel mio caso specifico, ho forzato il mio server ftp (<strong>pureftpd</strong>) ad utilizzare come porte in uscita un range che va dalla porta 10000 alla 20000 (questo lo si fa lanciando pureftpd con il parametro -p 10000:20000 oppure modificando direttamente il file di <a href="http://www.temporini.net/tag/configurazione" class="st_tag internal_tag" rel="tag" title="Posts tagged with configurazione">configurazione</a>),  e su questo range ho effettuato lo shaping di banda, bloccandola di fatto a 600Kbit/s, circa 80KByte/s.</p>
<p>Evito di commentare lo script in quanto è già stato fatto in inglese.</p>
<p>Tratto da: http://download.pureftpd.org/pub/pure-ftpd/doc/FAQ</p>
<p>Saluti</p>
<p><a href="http://www.temporini.net/tag/matteo" class="st_tag internal_tag" rel="tag" title="Posts tagged with Matteo">Matteo</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.temporini.net/traffic-shaping-come-ti-limito-la-banda-con-tc-e-iptables/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Linux non riconosce 8 Gb di ram?</title>
		<link>http://www.temporini.net/linux-non-riconosce-4-gb-di-ram</link>
		<comments>http://www.temporini.net/linux-non-riconosce-4-gb-di-ram#comments</comments>
		<pubDate>Tue, 12 Feb 2008 21:15:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PAE]]></category>
		<category><![CDATA[RAM]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[linux kernel ram pae]]></category>

		<guid isPermaLink="false">http://www.temporini.net/linux-non-riconosce-4-gb-di-ram</guid>
		<description><![CDATA[<p>Se avete un sistema a 32bit o semplicemente perchè siete pigri non avete installato una distribuzione a 64bit, quelo può essere la causa del vostro problema.</p>
<p>Con semplici calcoli matematici, che non vi riporto, è possibile infatti capire che con 32bit è possibile indirizzare al massimo circa 4gb di ram.</p>
<p>Per ovviare a questo ci sono due strade</p>
<p>1- [...]]]></description>
			<content:encoded><![CDATA[<p>Se avete un sistema a <strong>32bit</strong> o semplicemente perchè siete pigri non avete installato una distribuzione a 64bit, quelo può essere la causa del vostro problema.</p>
<p>Con semplici calcoli matematici, che non vi riporto, è possibile infatti capire che con 32bit è possibile indirizzare al massimo circa 4gb di ram.</p>
<p>Per ovviare a questo ci sono due strade</p>
<p>1- installare o ricompilare il vostro kernel con l&#8217;estensione PAE</p>
<p>2- installare una versione a 64bit del vostro sistema <a href="http://www.temporini.net/tag/linux" class="st_tag internal_tag" rel="tag" title="Posts tagged with linux">linux</a>, se ovviamente è possibile.</p>
<p>Mi soffermo sul primo punto.</p>
<p>Nel caso in cui vogliate installare un kernel precompilato come per esempio su <strong>Centos </strong>o <strong>Fedora </strong>vi basta installare la versione del kernel con questa estensione, semplicemente con il comando</p>
<p><code>yum install kernel-PAE</code></p>
<p>In alternativa dovete ricompilarvi il kernel a manina, abilitanto le opzioni</p>
<p><code>Processor type and futers –&gt; High Memory Support</code></p>
<p>e scegliere fra le tre opzioni possibili</p>
<p><code>off<br />
4 GB<br />
64 GB</code></p>
<p>vi bastano 64gb di ram adesso? <img src='http://www.temporini.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.temporini.net/linux-non-riconosce-4-gb-di-ram/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
