<?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>Matheus Bratfisch &#187; roteador</title>
	<atom:link href="http://www.matbra.com/tag/roteador/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.matbra.com</link>
	<description>&#34;Cogito ergo sum&#34;</description>
	<lastBuildDate>Fri, 03 Sep 2010 14:17:12 +0000</lastBuildDate>
	<language>pt</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Compartilhar internet com servidor na porta WAN.</title>
		<link>http://www.matbra.com/2009/05/26/compartilhar-internet-com-servidor-na-porta-wan/</link>
		<comments>http://www.matbra.com/2009/05/26/compartilhar-internet-com-servidor-na-porta-wan/#comments</comments>
		<pubDate>Tue, 26 May 2009 21:01:41 +0000</pubDate>
		<dc:creator>Matheus (X-warrior) Bratfisch</dc:creator>
				<category><![CDATA[Aprendendo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[compartilhar]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[lan]]></category>
		<category><![CDATA[modem]]></category>
		<category><![CDATA[roteador]]></category>
		<category><![CDATA[servidor]]></category>
		<category><![CDATA[wan]]></category>

		<guid isPermaLink="false">http://www.matbra.com/?p=278</guid>
		<description><![CDATA[Boa tarde, Os ultimos dias passei instalando o servidor e com uns problemas para configurar o mesmo. Eu sabia como configurar a rede para funcionar da seguinte maneira: MODEM -> (eth0) Servidor (eth1) -> (Porta lan) Router (Portas lan) -> Computadores Porém não era essa topologia que eu desejava, pois com está eu perdia a [...]]]></description>
			<content:encoded><![CDATA[<p>Boa tarde, </p>
<p>Os ultimos dias passei instalando o servidor e com uns problemas para configurar o mesmo. Eu sabia como configurar a rede para funcionar da seguinte maneira: </p>
<blockquote><p>MODEM -> (eth0) Servidor (eth1) -> (Porta lan) Router (Portas lan) -> Computadores</p></blockquote>
<p>Porém não era essa topologia que eu desejava, pois com está eu perdia a porta WAN do meu roteador. Então decidi fazer a seguinte:</p>
<blockquote><p>MODEM -> (eth0) Servidor (eth1) -> (Porta WAN) Router (Portas LAN) -> Computadores</p></blockquote>
<p>Inicialmente, deixei meu servidor ligado somente ao modem e testei se o mesmo conseguia pingar a internet. Até o momento tudo ok. </p>
<p>Acessei o arquivo &#8220;/etc/network/interfaces&#8221;  e configurei a eth1 manualmente da seguinte maneira:</p>
<blockquote><p>auto eth1<br />
iface eth1 inet static<br />
address 192.168.100.254<br />
netmask 255.255.255.0<br />
network 192.168.100.0<br />
broadcast 192.168.100.255</p></blockquote>
<p>Logo em seguida adicionei as regras de iptables:</p>
<blockquote><p>sysctl net.ipv4.ip_forward=1<br />
iptables -t nat -A POSTROUTING &#8211;out-interface eth0 -j MASQUERADE<br />
iptables -A FORWARD &#8211;in-interface eth0 -j ACCEPT</p></blockquote>
<p>Teoricamente o compartilhamento de internet já devia estar funcionando. Mas não foi isso que aconteceu. Resolvi acessar o meu Roteador pela Lan e configura-lo manualmente da seguinte maneira: </p>
<blockquote><p>IP Address : 192.168.100.1<br />
Subnet Mask : 255.255.255.0<br />
ISP Gateway Address : 192.168.100.254<br />
Primary DNS Address : 200.247.141.11 (DNS VIRTUA SC)<br />
Secondary DNS Address : 200.247.141.12 (DNS VIRTUA SC)</p></blockquote>
<p>Salvei as modificações, esperei o mesmo ser reiniciado e pronto. Conexão funcionando. </p>
<p>Eu sei que isso não ficou como um tutorial, ficou um &#8220;relato&#8221; mas este relato pode lhe ajudar a configurar se você seguir os mesmos passos que eu. Lembre-se também que as regras de iptables devem ser executadas sempre na inicialização do servidor. <a href="http://www.matbra.com/2009/05/19/executar-script-ao-iniciar-computador/">Saiba mais sobre Executar scripts ao iniciar computador</a>. </p>
<p>Demorei bastante tempo e testei várias configurações para que conseguisse tudo funcionando mas acredito que o meu maior problema foi ter usado a mesma Classe de IPS para a rede interna (atrás do roteador) e a &#8220;externa&#8221; (comunicação entre o roteador e servidor). </p>
<p>Qualquer problema com Compartilhamento ou coisas do tipo, não hesite em perguntar.</p>
<p>Espero que este artigo seja de grande ajuda,<br />
Matheus</p>
<p>Agradecimentos ao <a href="http://ubuntuforum-br.org/index.php/topic,51113.0.html" target="_blank">Ubuntu Forum</a> que me deu uma ajuda.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matbra.com/2009/05/26/compartilhar-internet-com-servidor-na-porta-wan/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
