<?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>Vive-libre.com &#187; COMO</title>
	<atom:link href="http://vive-libre.com/blog/tag/como/feed/" rel="self" type="application/rss+xml" />
	<link>http://vive-libre.com/blog</link>
	<description>Un espacio, para la libertad.</description>
	<lastBuildDate>Thu, 24 Dec 2009 18:25:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Configuracion de Ubuntu Server 8.10: DHCP + Squid + Iptables</title>
		<link>http://vive-libre.com/blog/2009/03/03/configuracion-de-ubuntu-server-810-dhcp-squid-iptables/</link>
		<comments>http://vive-libre.com/blog/2009/03/03/configuracion-de-ubuntu-server-810-dhcp-squid-iptables/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 06:00:11 +0000</pubDate>
		<dc:creator>yovany</dc:creator>
				<category><![CDATA[LINUX]]></category>
		<category><![CDATA[COMO]]></category>
		<category><![CDATA[COMPARTIR]]></category>
		<category><![CDATA[INTERNET]]></category>
		<category><![CDATA[IPTABLES]]></category>
		<category><![CDATA[PROXY]]></category>
		<category><![CDATA[SEGURIDAD]]></category>
		<category><![CDATA[SERVER]]></category>
		<category><![CDATA[SQUID]]></category>
		<category><![CDATA[UBUNTU]]></category>

		<guid isPermaLink="false">http://vive-libre.com/blog/2009/03/03/configuracion-de-ubuntu-server-810-dhcp-squid-iptables/</guid>
		<description><![CDATA[Despues de instalar un servidor con Ubuntu Server en este caso 8.10, lo que normalmente necesitamos es proveer de servicio de internet y con ello establecer ciertas reglas para controlar el acceso a siertas paginas, para mantener fluido el trafico de nuestra red, el primer paso seria configurar el servidorDHCP, para asignar las ip automaticamente.
Para [...]]]></description>
			<content:encoded><![CDATA[<p>Despues de instalar un servidor con Ubuntu Server en este caso 8.10, lo que normalmente necesitamos es proveer de servicio de internet y con ello establecer ciertas reglas para controlar el acceso a siertas paginas, para mantener fluido el trafico de nuestra red, el primer paso seria configurar el servidorDHCP, para asignar las ip automaticamente.</p>
<p>Para este caso en particular tomaremos de referencia la siguinete informacion</p>
<p><img src="http://vive-libre.com/blog/etc/red.JPG" alt="" width="488" height="324" align="absmiddle" /></p>
<p>Direccion de red interna: <strong>192.168.2.0/24</strong></p>
<p>Interface con salida a internet: <strong>eth0</strong></p>
<p>Interface conectada a la red interna: <strong>eth1</strong></p>
<p>Ip de eth1: <strong>192.168.2.1</strong></p>
<p>Ip de eth0: <strong>192.168.1.100 </strong></p>
<p>En este caso salimos a internet por medio de un modem 2wire de Telmex, aun que esto no importa demaciado, solo es para referencia.</p>
<p>Lo primero que debemos da hacer es configurar las ip estaticas, como estamos usando una version de servidor asumimos que no tenemos interface grafica asi que nuestro editor de archivos sera VI , pero pueden usar el que mas les acomode.</p>
<p>En vi hay dos modos de trabajo edicion y comandos, para edita un archivo hay que precionar la tecla [insert] para salir del modo de edicion y pasar a comandos precionamos la tecla [esc]  si queremos guardar el archivo entramos a modo de comandos y tecleamos :w si queremos salir es :q si queremos guardar y salir :wq para forzar cualquier accion agregamos el ! forzar el guardar :w! o forzar la salida :q!</p>
<div class="igBar"><span id="lcode-54"><a href="#" onclick="javascript:showPlainTxt('code-54'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-54">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sudo apt-get install vim </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<div class="igBar"><span id="lcode-55"><a href="#" onclick="javascript:showPlainTxt('code-55'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-55">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sudo vi /etc/network/interfaces </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Ahi pondremos esto</p>
<div class="igBar"><span id="lcode-56"><a href="#" onclick="javascript:showPlainTxt('code-56'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-56">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># This file describes the network interfaces available on your system</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># and how to activate them. <span style="">For</span> more information, see interfaces<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;color:#800000;">5</span><span style="color:#006600; font-weight:bold;">&#41;</span>.</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># The loopback network interface</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">auto lo</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iface lo inet loopback</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># The primary network interface</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">auto eth0</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iface eth0 inet static</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">address <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">1</span>.<span style="color:#800000;color:#800000;">100</span></div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">netmask <span style="color:#800000;color:#800000;">255</span>.<span style="color:#800000;color:#800000;">255</span>.<span style="color:#800000;color:#800000;">255</span>.<span style="color:#800000;color:#800000;">0</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">network <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">1</span>.<span style="color:#800000;color:#800000;">0</span></div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">broadcast <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">1</span>.<span style="color:#800000;color:#800000;">255</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">gateway <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">1</span>.<span style="color:#800000;color:#800000;">254</span></div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">dns-nameservers <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">1</span>.<span style="color:#800000;color:#800000;">254</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">auto eth1</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iface eth1 inet static</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">address <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">1</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">netmask <span style="color:#800000;color:#800000;">255</span>.<span style="color:#800000;color:#800000;">255</span>.<span style="color:#800000;color:#800000;">255</span>.<span style="color:#800000;color:#800000;">0</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Que significa esto?</p>
<p>Esto nos inidica cual es la interface de loopback nada interesante</p>
<div class="igBar"><span id="lcode-57"><a href="#" onclick="javascript:showPlainTxt('code-57'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-57">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># This file describes the network interfaces available on your system</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># and how to activate them. <span style="">For</span> more information, see interfaces<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;color:#800000;">5</span><span style="color:#006600; font-weight:bold;">&#41;</span>.</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># The loopback network interface</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">auto lo</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iface lo inet loopback </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Se define la configuracion para eth0 que es la tarjeta que nos conectara a internet</p>
<div class="igBar"><span id="lcode-58"><a href="#" onclick="javascript:showPlainTxt('code-58'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-58">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># The primary network interface</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">auto eth0 </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Aqui indicamos que la direccion es de tipo estatico</p>
<div class="igBar"><span id="lcode-59"><a href="#" onclick="javascript:showPlainTxt('code-59'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-59">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iface eth0 inet static </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>La variable addres  es una ip del rango que nos asigna el modem para salir a internet</p>
<div class="igBar"><span id="lcode-60"><a href="#" onclick="javascript:showPlainTxt('code-60'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-60">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">address <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">1</span>.<span style="color:#800000;color:#800000;">100</span></div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">netmask <span style="color:#800000;color:#800000;">255</span>.<span style="color:#800000;color:#800000;">255</span>.<span style="color:#800000;color:#800000;">255</span>.<span style="color:#800000;color:#800000;">0</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>La red por defecto</p>
<div class="igBar"><span id="lcode-61"><a href="#" onclick="javascript:showPlainTxt('code-61'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-61">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">network <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">1</span>.<span style="color:#800000;color:#800000;">0</span></div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">broadcast <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">1</span>.<span style="color:#800000;color:#800000;">255</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Es la puerta de enlace que nos da salida a internet</p>
<div class="igBar"><span id="lcode-62"><a href="#" onclick="javascript:showPlainTxt('code-62'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-62">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">gateway <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">1</span>.<span style="color:#800000;color:#800000;">254</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Y los DNS en este caso usamos el mismo modem para que nos resuelva hacia internet, esto datos cambian segun la configuracion de la red que les da salida a internet</p>
<div class="igBar"><span id="lcode-63"><a href="#" onclick="javascript:showPlainTxt('code-63'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-63">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">dns-nameservers <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">1</span>.<span style="color:#800000;color:#800000;">254</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Esta es la configuracion de la tarjeta de red a la que se conectara la red interna, solo hay que indicar la direccion IP y mascara, ya que nos conectaremos a internet por la otra tarjeta de red.</p>
<div class="igBar"><span id="lcode-64"><a href="#" onclick="javascript:showPlainTxt('code-64'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-64">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">auto eth1</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iface eth1 inet static</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">address <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">1</span></div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">netmask <span style="color:#800000;color:#800000;">255</span>.<span style="color:#800000;color:#800000;">255</span>.<span style="color:#800000;color:#800000;">255</span>.<span style="color:#800000;color:#800000;">0</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Para que cargue la nueva configuracion reiniciaremos los servicio de red</p>
<div class="igBar"><span id="lcode-65"><a href="#" onclick="javascript:showPlainTxt('code-65'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-65">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sudo /etc/init.<span style="">d</span>/networking restart </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Si todo esta bien configurado veremos algo como esto</p>
<div class="igBar"><span id="lcode-66"><a href="#" onclick="javascript:showPlainTxt('code-66'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-66">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">* Reconfiguring network interfaces...</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">* if-up.<span style="">d</span>/mountnfs<span style="color:#006600; font-weight:bold;">&#91;</span>eth0<span style="color:#006600; font-weight:bold;">&#93;</span>: waiting for interface eth1 before doing NFS mounts</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span> OK <span style="color:#006600; font-weight:bold;">&#93;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>El siguiente paso es configurar el DHCP, para asignar las direcciones ip de forma automatica, para esto usaremos dhcp3-server</p>
<div class="igBar"><span id="lcode-67"><a href="#" onclick="javascript:showPlainTxt('code-67'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-67">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sudo apt-get install dhcp3-server </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Primero hay que indicar en que interface de red es donde va a escuchar para eso editamos el siguiente archivo</p>
<div class="igBar"><span id="lcode-68"><a href="#" onclick="javascript:showPlainTxt('code-68'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-68">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sudo vi /etc/default/dhcp3-server </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>En nuestro caso la tarjeta que va a proveer el servicio es la eth1 que va a la red interna</p>
<div class="igBar"><span id="lcode-69"><a href="#" onclick="javascript:showPlainTxt('code-69'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-69">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># Defaults for dhcp initscript</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># sourced by /etc/init.<span style="">d</span>/dhcp</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># installed at /etc/default/dhcp3-server by the maintainer scripts</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># This is a POSIX shell fragment</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># On what interfaces should the DHCP server <span style="color:#006600; font-weight:bold;">&#40;</span>dhcpd<span style="color:#006600; font-weight:bold;">&#41;</span> serve DHCP requests?</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#       Separate multiple interfaces with spaces, e.<span style="">g</span>. <span style="color:#CC0000;">"eth0 eth1"</span>.</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="">INTERFACES</span>=<span style="color:#CC0000;">"eth1"</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Ahora hay que configurar el dhcp, en el siguiente archivo.</p>
<div class="igBar"><span id="lcode-70"><a href="#" onclick="javascript:showPlainTxt('code-70'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-70">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sudo vi /etc/dhcp3/dhcpd.<span style="">conf</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Tendremos un muy extenso archivo de configuracion de lo cual solo nos servira lo siguiente, lo demas lo podemos eliminar</p>
<div class="igBar"><span id="lcode-71"><a href="#" onclick="javascript:showPlainTxt('code-71'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-71">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">ddns-update-style interim;</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">authoritative;</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">subnet <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">0</span> netmask <span style="color:#800000;color:#800000;">255</span>.<span style="color:#800000;color:#800000;">255</span>.<span style="color:#800000;color:#800000;">255</span>.<span style="color:#800000;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">range <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">100</span> <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">200</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">option domain-name-servers <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">1</span>.<span style="color:#800000;color:#800000;">254</span>;</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">option routers <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">1</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">option broadcast-address <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">255</span>;</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">default-lease-time <span style="color:#800000;color:#800000;">36000</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">max-lease-time <span style="color:#800000;color:#800000;">180000</span>;</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Empezamos por definir sobre que red se va atrabajar y la mascara</p>
<div class="igBar"><span id="lcode-72"><a href="#" onclick="javascript:showPlainTxt('code-72'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-72">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">ddns-update-style interim;</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">authoritative;</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">subnet <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">0</span> netmask <span style="color:#800000;color:#800000;">255</span>.<span style="color:#800000;color:#800000;">255</span>.<span style="color:#800000;color:#800000;">255</span>.<span style="color:#800000;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#123;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Indicamos el rando de direcciones que deseamos que asigne en este caso asiganras desdela ip 192.168.2.100 hasta la ip 192.168.2.200</p>
<div class="igBar"><span id="lcode-73"><a href="#" onclick="javascript:showPlainTxt('code-73'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-73">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">range <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">100</span> <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">200</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Indicamos los DNS</p>
<div class="igBar"><span id="lcode-74"><a href="#" onclick="javascript:showPlainTxt('code-74'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-74">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">option domain-name-servers <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">1</span>.<span style="color:#800000;color:#800000;">254</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>La puerta de enlace, en este caso el servidor ubuntu, ya que todas las maquinas de la red se conectaran a nosotros para proveerlos de internet.</p>
<div class="igBar"><span id="lcode-75"><a href="#" onclick="javascript:showPlainTxt('code-75'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-75">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">option routers <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">1</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Estos son los valores que en dado caso se tendrian que modificar segun su configuracion de red. Solo quedaria reiniciar el servicio de DHCP</p>
<div class="igBar"><span id="lcode-76"><a href="#" onclick="javascript:showPlainTxt('code-76'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-76">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sudo /etc/init.<span style="">d</span>/dhcp3-server restart </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Si todo esta bien obtendremos esto</p>
<div class="igBar"><span id="lcode-77"><a href="#" onclick="javascript:showPlainTxt('code-77'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-77">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">* Stopping DHCP server dhcpd3                                           <span style="color:#006600; font-weight:bold;">&#91;</span> OK <span style="color:#006600; font-weight:bold;">&#93;</span></div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">* Starting DHCP server dhcpd3                                            <span style="color:#006600; font-weight:bold;">&#91;</span> OK <span style="color:#006600; font-weight:bold;">&#93;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Ahora instalaremos el proxy, en este caso Squid</p>
<div class="igBar"><span id="lcode-78"><a href="#" onclick="javascript:showPlainTxt('code-78'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-78">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sudo apt-get install squid </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Es muy importante para poder compartir el internet tener activado al <strong>Froward</strong>, para esto crearemos un archivo que se ejecutara al inicio del arranque donde tambien se cargaran las iptables, ya que estas configuraciones, se pierden cada vez que se apaga el equipo, este archivo se llamara iptables.cf, o como gusten llamarle</p>
<div class="igBar"><span id="lcode-79"><a href="#" onclick="javascript:showPlainTxt('code-79'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-79">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sudo vi /etc/init.<span style="">d</span>/iptables.<span style="">cf</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Y pondremos lo siguiente</p>
<div class="igBar"><span id="lcode-80"><a href="#" onclick="javascript:showPlainTxt('code-80'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-80">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iptables -F</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iptables -X</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iptables -Z</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iptables -t nat -F</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iptables -P INPUT ACCEPT</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iptables -P OUTPUT ACCEPT</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iptables -P FORWARD ACCEPT</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iptables -t nat -P PREROUTING ACCEPT</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iptables -t nat -P POSTROUTING ACCEPT</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iptables -t nat -A POSTROUTING -s <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">0</span>/<span style="color:#800000;color:#800000;">24</span> -o eth0 -j MASQUERADE</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iptables -t nat -A PREROUTING -s <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">0</span>/<span style="color:#800000;color:#800000;">24</span> -d ! <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">0</span>/<span style="color:#800000;color:#800000;">24</span> -p tcp --dport <span style="color:#800000;color:#800000;">80</span> -j REDIRECT --to-port <span style="color:#800000;color:#800000;">3128</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iptables -A INPUT -s <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">0</span>/<span style="color:#800000;color:#800000;">24</span> -i eth1 -j ACCEPT</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iptables -A FORWARD -s <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">0</span>/<span style="color:#800000;color:#800000;">24</span> -i eth1 -p tcp --dport <span style="color:#800000;color:#800000;">993</span> -j ACCEPT</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iptables -A FORWARD -s <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">0</span>/<span style="color:#800000;color:#800000;">24</span> -i eth1 -p tcp --dport <span style="color:#800000;color:#800000;">110</span> -j ACCEPT</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iptables -A FORWARD -s <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">0</span>/<span style="color:#800000;color:#800000;">24</span> -i eth1 -p tcp --dport <span style="color:#800000;color:#800000;">465</span> -j ACCEPT</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iptables -A FORWARD -s <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">0</span>/<span style="color:#800000;color:#800000;">24</span> -i eth1 -p tcp --dport <span style="color:#800000;color:#800000;">25</span> -j ACCEPT</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iptables -A FORWARD -s <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">0</span>/<span style="color:#800000;color:#800000;">24</span> -i eth1 -p tcp --dport <span style="color:#800000;color:#800000;">80</span> -j ACCEPT</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iptables -A FORWARD -s <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">0</span>/<span style="color:#800000;color:#800000;">24</span> -i eth1 -p tcp --dport <span style="color:#800000;color:#800000;">443</span> -j ACCEPT</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iptables -A FORWARD -s <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">0</span>/<span style="color:#800000;color:#800000;">24</span> -i eth1 -p tcp --dport <span style="color:#800000;color:#800000;">53</span> -j ACCEPT</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iptables -A FORWARD -s <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">0</span>/<span style="color:#800000;color:#800000;">24</span> -i eth1 -p udp --dport <span style="color:#800000;color:#800000;">53</span> -j ACCEPT</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">echo <span style="color:#800000;color:#800000;">1</span>&amp;gt; /proc/sys/net/ipv4/ip_forward </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Que es esto?</p>
<p>Las iptables nos ayudaran a decidir que dejar pasar por la red y por donde dejarlo pasar, en este caso, solo configuraremos las iptables para que nos redireccionen todo el del puerto 80 hacia el puerto 3128 que es el puerto del squid, para que no tengamos que configurar el proxy en todas las maquinas <img src='http://vive-libre.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> , y ya que compartimos el internet enmascaramos todo lo que venga de la red interna y que saldra por la interface eth0, permitiremos tambien el forward para el dhcp y tambien para el correo, para no tener problemas con los clientes de correo.</p>
<p>Borramos las reglas que se esten ejecuntando</p>
<div class="igBar"><span id="lcode-81"><a href="#" onclick="javascript:showPlainTxt('code-81'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-81">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iptables -X</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iptables -Z</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iptables -t nat -F </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Aceptamos coneciones saliente, entrantes, el forward, prerouting y postrouting</p>
<div class="igBar"><span id="lcode-82"><a href="#" onclick="javascript:showPlainTxt('code-82'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-82">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iptables -P INPUT ACCEPT</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iptables -P OUTPUT ACCEPT</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iptables -P FORWARD ACCEPT</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iptables -t nat -P PREROUTING ACCEPT</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iptables -t nat -P POSTROUTING ACCEPT </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Esta es una configuracion muy basica asi que por el momento no nos preocuparemos por el tema de la seguridad (eso es otro HowTo)</p>
<p>Habilitamos el enmascaramiento, para que la red interna pueda salir a internet por la conexion del server</p>
<div class="igBar"><span id="lcode-83"><a href="#" onclick="javascript:showPlainTxt('code-83'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-83">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iptables -t nat -A POSTROUTING -s <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">0</span>/<span style="color:#800000;color:#800000;">24</span> -o eth0 -j MASQUERADE </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Activamos el redireccionamiento para el proxy tranparente, tambien indicamos que lo redireccionaremos siempre y cuando el destino no sea una direccion dentro de la misma red, digase servidores web locales todo lo demas al proxy</p>
<div class="igBar"><span id="lcode-84"><a href="#" onclick="javascript:showPlainTxt('code-84'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-84">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iptables -t nat -A PREROUTING -s <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">0</span>/<span style="color:#800000;color:#800000;">24</span> -d ! <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">0</span>/<span style="color:#800000;color:#800000;">24</span> -p tcp --dport <span style="color:#800000;color:#800000;">80</span> -j REDIRECT --to-port <span style="color:#800000;color:#800000;">3128</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Habilitamos el forward para los puertos especificos de correo y dhcp,  pop,  imap, simap, smtp, ssmtp y dhcp</p>
<div class="igBar"><span id="lcode-85"><a href="#" onclick="javascript:showPlainTxt('code-85'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-85">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iptables -A FORWARD -s <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">0</span>/<span style="color:#800000;color:#800000;">24</span> -i eth1 -p tcp --dport <span style="color:#800000;color:#800000;">993</span> -j ACCEPT</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iptables -A FORWARD -s <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">0</span>/<span style="color:#800000;color:#800000;">24</span> -i eth1 -p tcp --dport <span style="color:#800000;color:#800000;">110</span> -j ACCEPT</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iptables -A FORWARD -s <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">0</span>/<span style="color:#800000;color:#800000;">24</span> -i eth1 -p tcp --dport <span style="color:#800000;color:#800000;">465</span> -j ACCEPT</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iptables -A FORWARD -s <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">0</span>/<span style="color:#800000;color:#800000;">24</span> -i eth1 -p tcp --dport <span style="color:#800000;color:#800000;">25</span> -j ACCEPT</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iptables -A FORWARD -s <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">0</span>/<span style="color:#800000;color:#800000;">24</span> -i eth1 -p tcp --dport <span style="color:#800000;color:#800000;">80</span> -j ACCEPT</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iptables -A FORWARD -s <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">0</span>/<span style="color:#800000;color:#800000;">24</span> -i eth1 -p tcp --dport <span style="color:#800000;color:#800000;">443</span> -j ACCEPT</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iptables -A FORWARD -s <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">0</span>/<span style="color:#800000;color:#800000;">24</span> -i eth1 -p tcp --dport <span style="color:#800000;color:#800000;">53</span> -j ACCEPT</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">iptables -A FORWARD -s <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">0</span>/<span style="color:#800000;color:#800000;">24</span> -i eth1 -p udp --dport <span style="color:#800000;color:#800000;">53</span> -j ACCEPT </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Y por ultimo habilitamos el forward</p>
<div class="igBar"><span id="lcode-86"><a href="#" onclick="javascript:showPlainTxt('code-86'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-86">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">echo <span style="color:#800000;color:#800000;">1</span>&amp;gt; /proc/sys/net/ipv4/ip_forward </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Con esto es mas que suficiente, ahora hay que darle permisos de ejecucion</p>
<div class="igBar"><span id="lcode-87"><a href="#" onclick="javascript:showPlainTxt('code-87'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-87">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sudo chmod a+x /etc/init.<span style="">d</span>/iptables.<span style="">cf</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Ahora para que se ejecute al arranque instalaremos un pequeño programa que nos ayuda a configurar los archivos que se ejecutan al iniciar el sistema</p>
<div class="igBar"><span id="lcode-88"><a href="#" onclick="javascript:showPlainTxt('code-88'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-88">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sudo apt-get install rcconf </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>y lo ejecutaremos con</p>
<div class="igBar"><span id="lcode-89"><a href="#" onclick="javascript:showPlainTxt('code-89'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-89">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sudo rcconf </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><img src="http://vive-libre.com/blog/etc/rcconf.JPG" alt="" /></p>
<p>Veran esta pantalla solo hay que marcar el iptables.cf y todo listo si nececitan correr un archivo al arranque solo concedanle permisos y de la misma forma  : D.</p>
<p>Ahora hay que configurar el Squid, para eso editaremos el siguiente archivo.</p>
<div class="igBar"><span id="lcode-90"><a href="#" onclick="javascript:showPlainTxt('code-90'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-90">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sudo vi /etc/squid/squid.<span style="">conf</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>De igualmanera, podemos borrar todo y dejar solo lo siguiente</p>
<div class="igBar"><span id="lcode-91"><a href="#" onclick="javascript:showPlainTxt('code-91'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-91">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">http_port <span style="color:#800000;color:#800000;">3128</span> transparent</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cache_mem <span style="color:#800000;color:#800000;">16</span> MB</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cache_dir ufs /var/spool/squid <span style="color:#800000;color:#800000;">700</span> <span style="color:#800000;color:#800000;">16</span> <span style="color:#800000;color:#800000;">256</span></div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">ie_refresh on</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">offline_mode on</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">acl all src <span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">0</span>/<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">0</span></div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">acl red_local src <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">0</span>/<span style="color:#800000;color:#800000;">24</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">acl plus src <span style="color:#CC0000;">"/etc/squid/plus.lst"</span></div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">acl sites url_regex <span style="color:#CC0000;">"/etc/squid/sites.lst"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">acl files url_regex -i .<span style="">exe</span> .<span style="">flv</span> .<span style="">mp4</span> .<span style="">mp3</span> .<span style="">avi</span> .<span style="">wma</span> .<span style="">mov</span> .<span style="">acc</span> .<span style="">wav</span> .<span style="">bat</span> .<span style="">asf</span> .<span style="">mpeg</span> .3gp .<span style="">swf</span></div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">acl localhost src <span style="color:#800000;color:#800000;">127</span>.<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">1</span>/<span style="color:#800000;color:#800000;">255</span>.<span style="color:#800000;color:#800000;">255</span>.<span style="color:#800000;color:#800000;">255</span>.<span style="color:#800000;color:#800000;">255</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">http_access deny red_local !plus sites</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">http_access deny red_local !plus files</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">http_access allow red_local</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">http_access allow localhost</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">http_access deny all </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Para que esto funciones habremos de crear dos archivos, uno donde se guardaran las paginas que deseamos bloquear, y otro donde tendremos una lista de las ip que  tendran derechos privilegiados <img src='http://vive-libre.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<div class="igBar"><span id="lcode-92"><a href="#" onclick="javascript:showPlainTxt('code-92'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-92">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">vi /etc/squid/sites.<span style="">lst</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Aqui pondremos las paginas bloqueadas, esta es mi lista, algunas paginas de video redes sociales, mensageros web etc.</p>
<div class="igBar"><span id="lcode-93"><a href="#" onclick="javascript:showPlainTxt('code-93'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-93">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">hi5.<span style="">com</span></div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">www.<span style="">metroflog</span>.<span style="">com</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">mx.<span style="">youtube</span>.<span style="">com</span></div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">es.<span style="">youtube</span>.<span style="">com</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">www.<span style="">youtube</span>.<span style="">com</span>.<span style="">us</span></div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">www.<span style="">youtube</span>.<span style="">com</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">www.<span style="">youtube</span>.<span style="">com</span>.<span style="">mx</span></div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">www.<span style="">dailymotion</span>.<span style="">com</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">www.<span style="">tu</span>.<span style="">tv</span></div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">www.<span style="">ebuddy</span>.<span style="">com</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">www.<span style="">meebo</span>.<span style="">com</span></div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">webmessenger.<span style="">msn</span>.<span style="">com</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">www.<span style="">webmessenger</span>.<span style="">msn</span>.<span style="">com</span></div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">www.<span style="">iloveim</span>.<span style="">com</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">www.<span style="">spacelive</span>.<span style="">com</span></div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">home.<span style="">spaces</span>.<span style="">live</span>.<span style="">com</span>/</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">www.<span style="">myspace</span>.<span style="">com</span>/</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">spaces.<span style="">live</span>.<span style="">com</span>/</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">www.<span style="">radiusim</span>.<span style="">com</span>/</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">www.<span style="">messengerfx</span>.<span style="">com</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">messengerfx.<span style="">com</span>/</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">www.<span style="">facebook</span>.<span style="">com</span>/</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">fulltono.<span style="">com</span>/</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">www.<span style="">fulltono</span>.<span style="">com</span>/</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">rapidshare.<span style="">com</span></div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">megaupload.<span style="">com</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">www.<span style="">veoh</span>.<span style="">com</span>/</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">www.<span style="">megavideo</span>.<span style="">com</span>/</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">www.<span style="">proxybutton</span>.<span style="">com</span>/</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">www.<span style="">videoblogs</span>.<span style="">com</span>/</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">video.<span style="">google</span>.<span style="">com</span>/</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">imo.<span style="">im</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">www.<span style="">koolim</span>.<span style="">com</span>/</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">koolim.<span style="">com</span>/</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">voltv.<span style="">es</span>/</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">www.<span style="">imhaha</span>.<span style="">com</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">imhaha.<span style="">com</span></div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">proxify.<span style="">com</span>/</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">www.<span style="">proxify</span>.<span style="">com</span>/</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">www.<span style="">megaclick</span>.<span style="">com</span>/</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">www.<span style="">my</span>-proxy.<span style="">com</span></div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">www.<span style="">blogger</span>.<span style="">com</span>/</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cbox.<span style="">ws</span></div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">megaclilck.<span style="">com</span>/</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">facebook.<span style="">com</span>/</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">youporn.<span style="">com</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">www.<span style="">lajaula</span>.<span style="">net</span></div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">www.<span style="">alianzo</span>.<span style="">com</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">www.<span style="">goear</span>.<span style="">com</span></div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">www.<span style="">zshare</span>.<span style="">com</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">zshare.<span style="">net</span></div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">skydrive.<span style="">live</span>.<span style="">com</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Y sigue la lista de direcciones privilegiadas</p>
<div class="igBar"><span id="lcode-94"><a href="#" onclick="javascript:showPlainTxt('code-94'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-94">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sudo vi /etc/squid/plus.<span style="">lst</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Y agregamos las ip que deseemos</p>
<div class="igBar"><span id="lcode-95"><a href="#" onclick="javascript:showPlainTxt('code-95'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-95">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">150</span></div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">135</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Ahora regresando al archivo de configuracion del squid</p>
<p>Indicamos que por el puerto 3128 escucharemos y que sera proy tranparente</p>
<div class="igBar"><span id="lcode-96"><a href="#" onclick="javascript:showPlainTxt('code-96'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-96">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">http_port <span style="color:#800000;color:#800000;">3128</span> transparent </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Estos valores dejarlos tal cual</p>
<div class="igBar"><span id="lcode-97"><a href="#" onclick="javascript:showPlainTxt('code-97'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-97">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cache_mem <span style="color:#800000;color:#800000;">16</span> MB</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cache_dir ufs /var/spool/squid <span style="color:#800000;color:#800000;">700</span> <span style="color:#800000;color:#800000;">16</span> <span style="color:#800000;color:#800000;">256</span></div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">ie_refresh on</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">offline_mode on </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Las acl o definiciones de control de acceso, son las que nos permitiran hacer referencias hacia ciertos elementos ya sea ip, direciones etc</p>
<p>La definicion all indica un origen definido por todo el rango de direciones ip</p>
<div class="igBar"><span id="lcode-98"><a href="#" onclick="javascript:showPlainTxt('code-98'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-98">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">acl all src <span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">0</span>/<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">0</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>La siguiente definicion hace referencia al conjunto de ip comprendidas dentro de nuestra red</p>
<div class="igBar"><span id="lcode-99"><a href="#" onclick="javascript:showPlainTxt('code-99'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-99">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">acl red_local src <span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">0</span>/<span style="color:#800000;color:#800000;">24</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>La definicion plus hace referencia alas ip que se encuentran listadas dentro del archivo que creamos</p>
<div class="igBar"><span id="lcode-100"><a href="#" onclick="javascript:showPlainTxt('code-100'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-100">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">acl plus src <span style="color:#CC0000;">"/etc/squid/plus.lst"</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>La definicion sites hace referencia ala lista de sitios restringidos</p>
<div class="igBar"><span id="lcode-101"><a href="#" onclick="javascript:showPlainTxt('code-101'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-101">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">acl sites url_regex <span style="color:#CC0000;">"/etc/squid/sites.lst"</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>La definicion files es un conjunto de extenciones las cuales se van a restringir para su descarga, hay que tener un poco de cuidado, por ejemplo los archivos .bin pueden ser desde binarios de linux, como imagenes de cd o archivos comprimidos, si añaden esa extencion se daran cuenta que las busquedas de google desencadenaran el bloqueo del proxy y no les dejara buscar nada, ya que dentro de la url de la busqueda se generan este tipo de extenciones, la cadena .mp bloquea el yahoo mail, asi que sehan cuidadosos es este sentido, y evitense dolores de cabeza.</p>
<div class="igBar"><span id="lcode-102"><a href="#" onclick="javascript:showPlainTxt('code-102'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-102">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">acl files url_regex -i .<span style="">exe</span> .<span style="">flv</span> .<span style="">mp4</span> .<span style="">mp3</span> .<span style="">avi</span> .<span style="">wma</span> .<span style="">mov</span> .<span style="">acc</span> .<span style="">wav</span> .<span style="">bat</span> .<span style="">asf</span> .<span style="">mpeg</span> .3gp .<span style="">swf</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Y por ultimo la definicion del loopback</p>
<div class="igBar"><span id="lcode-103"><a href="#" onclick="javascript:showPlainTxt('code-103'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-103">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">acl localhost src <span style="color:#800000;color:#800000;">127</span>.<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">1</span>/<span style="color:#800000;color:#800000;">255</span>.<span style="color:#800000;color:#800000;">255</span>.<span style="color:#800000;color:#800000;">255</span>.<span style="color:#800000;color:#800000;">255</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Ahora ay que generar las reglas, para permitir o denegar el acceso usamos http_acces despues la accion deny o allow aquien se lo vamos a aplicar y que le vamos a restringir</p>
<p>Aqui denegamos a todas las direciones de la red que sean diferente a las definidas en la lista plus los sitios definidos por la lista sites</p>
<div class="igBar"><span id="lcode-104"><a href="#" onclick="javascript:showPlainTxt('code-104'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-104">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">http_access deny red_local !plus sites </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>De igual forma denegamos a todas las ip de la red local que sean diferentes a las definidas por la lista plus el acceso a los archivo definidos en la lista files</p>
<div class="igBar"><span id="lcode-105"><a href="#" onclick="javascript:showPlainTxt('code-105'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-105">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">http_access deny red_local !plus files </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Muy importante todas las reglas siempre deben de ir antes de estas ultimas de lo contrario el proxy aparentara que no esta funcionando, ya que las reglas llevan un orden de ejecucion</p>
<div class="igBar"><span id="lcode-106"><a href="#" onclick="javascript:showPlainTxt('code-106'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-106">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">http_access allow red_local</div>
</li>
<li style="font-weight: bold;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">http_access allow localhost</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#498BFE;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">http_access deny all </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Cada vez que se haga un cambio en las reglas habra que reiniciara el servicio, esto interrunpuria todo el trafico que este pasando por el proxy, hasta que recargue el servcio  segun la velocidad del servidor y la carga de trafico unos 20 o 30 segundo.</p>
<p>Espero sea de utilidad, y como siempre espero sus comentarios, criticas y chiste.</p>
<p>Pd. este post fue motivado por algunas dudas de los amigos del foro de Byte.</p>
<p>Asi que esto es todo</p>
<p>Byte.</p>
<p><!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:HyphenationZone>21</w:HyphenationZone> <w:PunctuationKerning /> <w:ValidateAgainstSchemas /> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:Compatibility> <w:BreakWrappedTables /> <w:SnapToGridInCell /> <w:WrapTextWithPunct /> <w:UseAsianBreakRules /> <w:DontGrowAutofit /> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]--></p>
]]></content:encoded>
			<wfw:commentRss>http://vive-libre.com/blog/2009/03/03/configuracion-de-ubuntu-server-810-dhcp-squid-iptables/feed/</wfw:commentRss>
		<slash:comments>199</slash:comments>
		</item>
	</channel>
</rss>
