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

<channel>
	<title>freebsd &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/freebsd/</link>
	<description>Feed of posts on WordPress.com tagged "freebsd"</description>
	<pubDate>Wed, 25 Nov 2009 02:50:45 +0000</pubDate>

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

<item>
<title><![CDATA[FreeBSD]]></title>
<link>http://carlosandrade.wordpress.com/2009/11/25/freebsd/</link>
<pubDate>Wed, 25 Nov 2009 02:02:48 +0000</pubDate>
<dc:creator>Carlinhos Andrade</dc:creator>
<guid>http://carlosandrade.wordpress.com/2009/11/25/freebsd/</guid>
<description><![CDATA[&#160; É um avançado sistema operacioal baseado na versão Unix BSD, desenvolvido pela Universidade d]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><blockquote></blockquote>
<blockquote></blockquote>
<p>&#160;</p>
<blockquote><p>É um avançado sistema operacioal baseado na versão Unix BSD, desenvolvido pela Universidade de Barkeley. Robusto e estável, ele fornece um controle avançado dos parâmetros de desempenho, segurança e conectividade TCP/IP, alem de compatibilidade com o Linux e outros sistemas operacionais. Possui uma estrutura confiavel e robusta para comportar grandes cargas de acesso com milhares de conexões simultaneas. Dentre varias caracteristicas podemos citar: </p>
<ul>
<li>É multitarefa preemptiva ( multiplas CPU’s ), aliada ao ajuste dinâmico de prioridades e algoritimos para a proteção de memória;</li>
<li>É indicado para aplicações de grande capacidade de I/O ( Input/Output ) de disco devido ao seu sistema nativo de arquivos e metodologias de acesso a disco;</li>
<li>Atualização constante pelo Soft Update para sistema de arquivos Unix File System;</li>
<li>Kernel suporta Ipv6, SMP, criptografia GBDE ( GEOM Based Disk Encryption )&#160; ou GELI, firewalls stateful e jail aplicado a tecnicas de virtualização de sistema operacional;</li>
<li>Controla acesso ao disco, por quotas de usuario ou para auditoria de eventos com CAPP ( Controlled Access Protection Profile ) e ACL ( Access List );</li>
<li>Possui filtro de pacotes PF ( Packet Filter ) para controlar largura de banda e priorização de pacotes;</li>
<li>IPSec ( IP Security ) para criptografar as conexões entre equipamentos com recursos nativos do Kernel;</li>
<li>Executa de forma eficiente binarios pertencentes a outros sistemas operacionais;</li>
<li>Concentra um record de 2 Terabytes de armazenamento de um unico sistema operacional;</li>
<li>Pode ser utilizado para a construção de qualquer tipo de servidor.</li>
</ul>
</blockquote>
<blockquote><p>So para finalizar, ele é utilizado por empresas como Yahoo! ( <a href="http://www.yahoo.com/">http://www.yahoo.com/</a>), Apache ( <a href="http://www.apache.org/">http://www.apache.org/</a> ), Sony ( <a href="http://www.sony.co.jp/">http://www.sony.co.jp/</a>), dentre outras que confiam suas aplicações a esse sistema, que na minha opnião é o melhor quando se tratando de Servidores. </p>
<p>Vale ressaltar que o melhor sistema operacional é aquele que atende as necessidades do usuario, mas so para confrontá-lo com os outros sistemas operacionais, vale ressaltar alguns pontos entre o FreeBSD e os dois mais utilizados no segmento de servidores. </p>
<p><strong>FreeBSD x Windows</strong></p>
<ul>
<li>Alto custo para implementação devido ao preço de suas licenças.</li>
<li>O hardware deve ser muito robusto para melhorar seu desempenho, um exemplo do maior fracasso da microsoft nesse quesito,&#160; foi o Windows Vista .</li>
<li>O kernel do windows nao é personalizavel. Sendo impossivel adcionar ou remover recursos para torna-lo mais rapido, simples e seguro.</li>
<li>Usam interface grafica para realização de tarefas. Exceto o Windows 2008 Server Core. </li>
<li>Possui uma grande variedade de profissionais, desvalorizando o salario dos mesmos. Ao contrario, para se encontrar profissionais que dominem realmente um sistema Unix como Linux e FreeBSD com qualidade é mais dificil. </li>
</ul>
<p><strong>FreeBSD x Linux</strong> </p>
<ul>
<li>São derivados do Unix, porem o linux possui diversas distribuições enquanto o FreeBSD apenas uma. Sistemas linux, mantem varias equipes de diferentes distribuições, desenvolvendo em paralelo varias aplicações e adaptações.</li>
<li>O kernel do linux é mantido pelas ideias de seu criador Linus Torvald, enquanto o FreeBSD possui apenas uma equipe que simplifica a manutenção e gerenciamento.</li>
<li>As licenças do Linux não permite que seu codigo fonte seja apoderado ou que seja aplicado restrições quanto a sua distribuição, enquanto a do FreeBSD são mais permissivas e facilitam o uso de produtos comerciais.</li>
<li>O FreeBSD consegue executar 90% dos aplicativos linux sem nenhum ajuste ou adaptação no sistema, e possui um grande controle de I/O em disco com melhor qualidade do que qualquer distribuição linux. </li>
</ul>
</blockquote>
<p>&#160;</p>
<blockquote><p>Para obter uma distribuição do FreeBSD basta entrar no site <a href="http://www.freebsd.org/">http://www.freebsd.org/</a> e baixar plataforma compativel com seu hardware. </p>
<p>Caso tenha em mãos a arquitetura do seu hardware, basta instalar. Não é dificil, pelo contrario, é bem simples e facil. Porem se tratando de servidores que irão disponibilizar grandes aplicações, é recomendado que faça antes de tudo um Check-list de pré-instalação. Sintetizando, basta especificar : </p>
<ul>
<li>Nome da maquina. Defina padrões para nomes em redes, isso facilita a administração. Porem não dê nomes descritivos sobre a função do equipamento, como dns, web-server, storage, base-de-dados, etc. </li>
<li>Defina seu hardware. Verifique sua compatibilidade e descreva cada componente minuciosamente para evitar problemas.</li>
<li>Escolha o metodo de instalação ( CD/CDROM).</li>
<li>Faça um modelo de backup de dados. Defina local, tempo e restrições.</li>
<li>Identifique o equipamento de conexão de rede utilizado e o mapeamento da mesma.</li>
<li>Defina equipamentos de storage, suas partições, endereços e se será utilizado equipamentos de redundância RAIDS e etc.</li>
<li>Defina configurações de firewall, nome do dominio, dns, gateway, ips e etc.</li>
<li>Climatização, segurança, prevenindo incendios, explosões e etc. </li>
</ul>
</blockquote>
<blockquote><p>Enfim, um check-list, pode ser simples ou complexo, depende da necessidade de qualidade da sua implementação. Existem normas padrões para isso, basta pesquisar sobre ISO/IEC e normas para gerenciamento de TI. </p>
<p>Agora basta colocar a “mão na massa”!!! <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
</blockquote>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[How to add color to your SSH sessions in FreeBSD so files of different types have different colors when using ls?]]></title>
<link>http://rhyous.com/2009/11/24/how-to-add-color-to-your-ssh-sessions-in-freebsd-so-files-of-different-types-have-different-colors-when-using-ls/</link>
<pubDate>Wed, 25 Nov 2009 00:33:06 +0000</pubDate>
<dc:creator>rhyous</dc:creator>
<guid>http://rhyous.com/2009/11/24/how-to-add-color-to-your-ssh-sessions-in-freebsd-so-files-of-different-types-have-different-colors-when-using-ls/</guid>
<description><![CDATA[Hey this was really easy. Really, it is just a matter of aliasing your ls commands. However, it is o]]></description>
<content:encoded><![CDATA[Hey this was really easy. Really, it is just a matter of aliasing your ls commands. However, it is o]]></content:encoded>
</item>
<item>
<title><![CDATA[solang on FreeBSD]]></title>
<link>http://762e5e74.wordpress.com/2009/11/24/solang-on-freebsd/</link>
<pubDate>Tue, 24 Nov 2009 22:45:01 +0000</pubDate>
<dc:creator>762e5e74</dc:creator>
<guid>http://762e5e74.wordpress.com/2009/11/24/solang-on-freebsd/</guid>
<description><![CDATA[Submitted a PR for solang on FreeBSD.]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a title="solang by wahjava, on Flickr" href="http://www.flickr.com/photos/wahjava/4132217312/"><img src="http://farm3.static.flickr.com/2678/4132217312_15045aeed1_m.jpg" alt="solang" width="240" height="150" /></a><br />
Submitted a <a href="http://www.freebsd.org/cgi/query-pr.cgi?pr=140848">PR</a> for <a href="http://savannah.nongnu.org/projects/solang/">solang</a> on FreeBSD.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[How to remove the ^M characters in a file on FreeBSD?]]></title>
<link>http://rhyous.com/2009/11/24/how-to-remove-the-m-characters-in-a-file-on-freebsd/</link>
<pubDate>Tue, 24 Nov 2009 16:25:04 +0000</pubDate>
<dc:creator>rhyous</dc:creator>
<guid>http://rhyous.com/2009/11/24/how-to-remove-the-m-characters-in-a-file-on-freebsd/</guid>
<description><![CDATA[How to remove the ^M characters in a file on FreeBSD? This is simple: There are multiple ways to do ]]></description>
<content:encoded><![CDATA[How to remove the ^M characters in a file on FreeBSD? This is simple: There are multiple ways to do ]]></content:encoded>
</item>
<item>
<title><![CDATA[Customize shell prompt]]></title>
<link>http://netsou.wordpress.com/2009/11/24/customize-shell-prompt/</link>
<pubDate>Tue, 24 Nov 2009 12:58:09 +0000</pubDate>
<dc:creator>netatouille</dc:creator>
<guid>http://netsou.wordpress.com/2009/11/24/customize-shell-prompt/</guid>
<description><![CDATA[Many options can be added to your shell prompt such as : Server name, Date and time, Current folder,]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Many options can be added to your shell prompt such as :</p>
<ul>
<li>Server name,</li>
<li>Date and time,</li>
<li>Current folder,</li>
<li>Current user name.</li>
</ul>
<p>The file where you have to customize your prompt options depends on what shell are you using or for which shell do you want to customize the prompt.</p>
<p>For the moment, I will start by the csh and tcsh and I will add for others shells next time.</p>
<p><strong>The csh shell</strong></p>
<p>Open the .cshrc file and after the line &#8220;# An interactive shell &#8212; set some stuff up&#8221; specify the options for your prompt</p>
<p>set prompt =&#8221;%n@%m%/%# &#8220;</p>
<p><strong>The Tcsh shell</strong></p>
<p>You have to modify the .tcshrc file. If you don&#8217;t have it you can create one by copying the same content of the .cshrc file:</p>
<p>$cp .cshrc .tcshrc</p>
<p>Then you can modify the options of your prompt if the set prompt line is already available or add a new your options after the line &#8220;# An interactive shell &#8212; set some stuff up&#8221;:</p>
<p>set prompt =&#8221;%m[%t]%/%# &#8220;</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Change user shell on FreeBSD]]></title>
<link>http://netsou.wordpress.com/2009/11/24/change-user-shell-on-freebsd/</link>
<pubDate>Tue, 24 Nov 2009 12:27:23 +0000</pubDate>
<dc:creator>netatouille</dc:creator>
<guid>http://netsou.wordpress.com/2009/11/24/change-user-shell-on-freebsd/</guid>
<description><![CDATA[Display user&#8217;s information on FreeBSD: $pw showuser username Replace username with the usernam]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><strong>Display user&#8217;s information on FreeBSD:</strong></p>
<p>$pw showuser <em>username</em></p>
<p>Replace username with the username account<em><br />
</em></p>
<p><strong>Change the user&#8217;s shell:</strong></p>
<p>$pw usermod <em>username </em>-s /bin/tcsh</p>
<p>Replace the username with the username account. You can choose one of the shells available in your system.</p>
<p>Many shells are available for use in Unix based systems.</p>
<ul>
<li>sh: available on all Unix systems. It is an old shell.</li>
<li>ksh: based on sh and gives additional futures.</li>
<li>csh: not based on sh. available on all Unix systems</li>
<li>tcsh: based on csh with additional futures.</li>
</ul>
<p><strong>Display available shells in your system</strong></p>
<p>$cat /etc/shells</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[IPFW-Advanced-Supplement-HOWTO]]></title>
<link>http://ltphong.wordpress.com/2009/11/24/ipfw-advanced-supplement-howto/</link>
<pubDate>Tue, 24 Nov 2009 10:20:27 +0000</pubDate>
<dc:creator>anhptnn</dc:creator>
<guid>http://ltphong.wordpress.com/2009/11/24/ipfw-advanced-supplement-howto/</guid>
<description><![CDATA[&nbsp; IPFW:check-state/keep-state advanced stateful rules. By Joe Barbish  07/22/2002  All rights r]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>&#160;</p>
<div id="_mcePaste">IPFW:check-state/keep-state advanced stateful rules.</div>
<div id="_mcePaste">By Joe Barbish  07/22/2002  All rights reserved.</div>
<div id="_mcePaste">As most new ipfw users, I had a typical ipfw rules file built from the simple stateful rules in rc.firewall. I had originally been using user ppp with it&#8217;s internal Nat function, but went to natd as the simple stateful type in rc.firewall showed. Since the sample rc.firewall (simple) was pretty much just what I wanted to do, I just assumed this was the correct and proper way, so I cut out the simple type code from rc.firewall to create my own ipfw firewall rules. In searching FBSD and the many sites found by google search I saw many many other people before me had done the same thing. From a technical point of view the whole rc.firewall file is based on simple stateful rules using setup/established with some stateless rules thrown in. As a new ipfw user I did not know the difference and the comments sure did not call out the difference.</div>
<div id="_mcePaste">When I tried to change my simple stateful [established/setup] to advanced stateful [check-state/keep-state] rules, I kept having trouble with ip address being mismatched. Technically the mismatches showed up in /var/log/security as packets that got denied by the (default deny everything rule) for all packets that reach the end of the rule set with out matching any rule. Configuration looked like this.</div>
<div id="_mcePaste">Divert natd (network address translation)</div>
<div id="_mcePaste">(</div>
<div id="_mcePaste">(</div>
<div id="_mcePaste">LAN PC&#8217;s  &#60; &#8212; &#62; IPFW  &#60; &#8212; &#62;  internet</div>
<div id="_mcePaste">Private IP     advanced        public ip</div>
<div id="_mcePaste">Address      stateful rules    address</div>
<div id="_mcePaste"><!--more-->I spend weeks playing around trying different combinations of ipfw rules, but kept having mismatches in the dynamic table. Finally I removed the natd divert rule from the ipfw rules set and deactivated natd in rc.conf and re-activated ppp -Nat in rc.conf, and the advanced stateful [check-state/keep-state] rules started to work. Configuration looked like this.</div>
<div id="_mcePaste">LAN PC&#8217;s  &#60; &#8212; &#62; IPFW  &#60; &#8212; &#62;  user ppp -nat &#60; &#8212; &#62; internet</div>
<div id="_mcePaste">Private IP     advanced        network address      public ip</div>
<div id="_mcePaste">Address      stateful rules    translation           address</div>
<div id="_mcePaste">In this configuration IPFW only knows the private ip address on the LAN and the advanced stateful rules functioned just like described in the man documentation.</div>
<div id="_mcePaste">I wrote emails to the IPFW authors, gave then 2 documented examples of rules sets using exclusively advanced stateful rules and user ppp dial up ISP, the only difference was one used user ppp -nat and did not have the divert natd rulecd ../ one had the divert natd rule and no user ppp -nat and did not work. After much conflicting correspondences the results were that they were not going to do anything about it and I was left on my own.</div>
<div id="_mcePaste">The real problem here is ipfw advanced stateful rules are relatively new to the IPFW program (FBSD version 4.0 year 2000) and still does not fit cleanly into the divert natd program logic.</div>
<div id="_mcePaste">IPFW was originally designed as a firewall using stateless rules and/or simple stateful rules which is nothing more than an rules file coding logic technique based on the TP flags setup/established. Using these very primitive type of rules IPFW function&#8217;s correctly. When advanced stateful rules are used to tighten down the control of packets passing through the firewall by dynamically creating an internal rules table based on the by-directional exchange of packets which have to match the pre-known ip address, flow direction, and packet sequence numbers the divert natd function malfunctions. This problem is not limited to dial up internet access, but also occurs for &#8216;all ways on&#8217; environments (DSL, Cable, T1) with or without DHCP support.</div>
<div id="_mcePaste">Many users reach this point using the advanced check-state/keep-state stateful rules and go back to simple stateful rule set using established/setup simple because they can not get the advanced stateful rules to work. The rc.firewall file was created for FBSD 2.0 and has not been updated to exclusively utilize the advanced stateful rule set, so it is a very poor example to be using for your ipfw rules set.</div>
<div id="_mcePaste">Cable internet access became available in my area and I was forced to revisit the divert natd / advanced stateful rules again because (DSL, Cable, T1) &#8216;all ways on&#8217; environments normally use the ISP&#8217;s DHCP server to get it&#8217;s network configuration information so user ppp -nat is not used in this case. This meant I had to use the divert natd ipfw statement to provide the NAT function so I could use private ip address for my LAN because my cable ISP only issues one dynamic public ip address per customer account.</div>
<div id="_mcePaste">After many days of trial and error testing I finally found an rules coding logic which functioned correctly using exclusively advanced check-state/keep-state stateful rules and the divert natd rule statement. Normally the rule to allow the packets from local LAN Nic cards to pass through the ipfw firewall come before the divert natd rule as seen in the rc.firewall file. But for advanced stateful rules it has to be moved after the divert natd rule and the &#8216;keep-state&#8217; option has to be used so the dynamic rules table knows about the packet activity before they get passed through the rules file the second time. Technically this means each packet will have 2 sets of dynamic table rules, one set for the private Nic interface and one for the public Nic interface. This is an resource waste, decreases performance, and not necessary if the nat function is done outside of ipfw.</div>
<div id="_mcePaste">The simplest and best solution to the advanced stateful rules problem is to use &#8216;user ppp -nat&#8217; for all dialup ISP environments and have no divert natd rule in the ipfw rules file.  For all DSL, cable, and T1 connection where the ISP&#8217;s DHCP is used to configure FBSD&#8217;s public network you have to use the divert natd rule in your ipfw rules set followed by this rule for each private Nic interface,</div>
<div id="_mcePaste">&#8216;allow all from any to any via xl0 keep-state&#8217;</div>
<div id="_mcePaste">where xl0 is the private Nic card interface device name. This solution has been tested in FBSD version 4.5 &#38; 4.6.</div>
<div id="_mcePaste">The IPFW rules listed below are my current firewall rules file configured for a cable divert natd environment. Here are the matching /etc/rc.conf options</div>
<div id="_mcePaste">ifconfig_rl0=&#8221;DHCP&#8221;</div>
<div id="_mcePaste">ppp_enable=&#8221;NO&#8221;</div>
<div id="_mcePaste">natd_enable=&#8221;YES&#8221;</div>
<div id="_mcePaste">natd_interface=&#8221;rl0&#8243;</div>
<div id="_mcePaste">natd_flags=&#8221;-dynamic&#8221;</div>
<div id="_mcePaste">firewall_enable=&#8221;YES&#8221;</div>
<div id="_mcePaste">firewall_script=&#8221;/etc/ipfw.rules.conf&#8221;</div>
<div id="_mcePaste">For an user ppp dialup modem ISP connection using &#8216;divert natd&#8217; make</div>
<div id="_mcePaste">following changes to the ipfw rules below</div>
<div id="_mcePaste">Change  oif=&#8221;rl0&#8243;  to  oif=&#8221;tun0&#8243;</div>
<div id="_mcePaste">Here are the matching /etc/rc.conf options</div>
<div id="_mcePaste">#ifconfig_rl0=&#8221;DHCP&#8221;</div>
<div id="_mcePaste">ppp_enable=&#8221;YES&#8221;</div>
<div id="_mcePaste">ppp_mode=&#8221;ddial&#8221;</div>
<div id="_mcePaste">ppp_profile=&#8221;papchat&#8221;</div>
<div id="_mcePaste">ppp_nat=&#8221;NO&#8221;</div>
<div id="_mcePaste">natd_enable=&#8221;YES&#8221;</div>
<div id="_mcePaste">natd_interface=&#8221;tun0&#8243;</div>
<div id="_mcePaste">natd_flags=&#8221;-dynamic&#8221;</div>
<div id="_mcePaste">firewall_enable=&#8221;YES&#8221;</div>
<div id="_mcePaste">firewall_script=&#8221;/etc/ipfw.rules.conf</div>
<div id="_mcePaste">For an user ppp dialup modem ISP connection using &#8216;user ppp -nat&#8217; make</div>
<div id="_mcePaste">following changes to the ipfw rules below</div>
<div id="_mcePaste">Change  oif=&#8221;rl0&#8243;  to  oif=&#8221;tun0&#8243;</div>
<div id="_mcePaste">Add    $cmd 00130 allow all from any to any via xl0</div>
<div id="_mcePaste">Delete $cmd 00150 divert natd all from any to any via $oif</div>
<div id="_mcePaste">Delete $cmd 00210 allow all from any to any via xl0 keep-state</div>
<div id="_mcePaste">Here are the matching /etc/rc.conf options</div>
<div id="_mcePaste">#ifconfig_rl0=&#8221;DHCP&#8221;</div>
<div id="_mcePaste">ppp_enable=&#8221;YES&#8221;</div>
<div id="_mcePaste">ppp_mode=&#8221;ddial&#8221;</div>
<div id="_mcePaste">ppp_profile=&#8221;papchat&#8221;</div>
<div id="_mcePaste">ppp_nat=&#8221;YES&#8221;</div>
<div id="_mcePaste">natd_enable=&#8221;NO&#8221;</div>
<div id="_mcePaste">#natd_interface=&#8221;tun0&#8243;</div>
<div id="_mcePaste">#natd_flags=&#8221;-dynamic&#8221;</div>
<div id="_mcePaste">firewall_enable=&#8221;YES&#8221;</div>
<div id="_mcePaste">firewall_script=&#8221;/etc/ipfw.rules.conf</div>
<div id="_mcePaste">Following the rules file below are some other IP stack security options which are specified in the /etc/rc.conf file and kernel that you can use as a guide to configure your own world.</div>
<div id="_mcePaste">/etc/ipfw.rules.conf</div>
<div id="_mcePaste">###########################################################################</div>
<div id="_mcePaste">#</div>
<div id="_mcePaste"># Define IPFW firewall rules for gateway.poweruser.net</div>
<div id="_mcePaste"># 7/04/2002  Joe Barbish</div>
<div id="_mcePaste">#</div>
<div id="_mcePaste">#   Cable modem connection to ISP with dynamic IP addresses assigned.</div>
<div id="_mcePaste">#   Private Ip address used inside.</div>
<div id="_mcePaste">#   3 win98 boxes on LAN with DHCP used for auto private network configure.</div>
<div id="_mcePaste">#   Protect the whole private network from loss of service attacks</div>
<div id="_mcePaste">#   These rules can be reloaded with out rebooting by issuing this command</div>
<div id="_mcePaste">#   sh /etc/ipfw.rules.conf</div>
<div id="_mcePaste">#</div>
<div id="_mcePaste">#   The use of &#8216;me&#8217; in rules means IP address 127.0.0.0 localhost</div>
<div id="_mcePaste">#</div>
<div id="_mcePaste"># Firewall Policy Statement.</div>
<div id="_mcePaste">#   Each public internet function must be explicitly allowed by a rule.</div>
<div id="_mcePaste">#   Only valid response to the packets I&#8217;ve sent out are allowed in.</div>
<div id="_mcePaste">#   All packets must use the IPFW advanced &#8220;dynamic&#8221; rules function.</div>
<div id="_mcePaste">#   No state-less rules or simple-stateful rules are allowed to grant</div>
<div id="_mcePaste">#   internet function.</div>
<div id="_mcePaste">#############################################################################</div>
<div id="_mcePaste"># Flush out the list before we begin.</div>
<div id="_mcePaste">/sbin/ipfw -q -f flush</div>
<div id="_mcePaste"># Set rules command prefix</div>
<div id="_mcePaste"># The -q option on the command is for quite mode.</div>
<div id="_mcePaste"># Do not display rules as they load. Remove during development to see.</div>
<div id="_mcePaste">cmd=&#8221;/sbin/ipfw -q add&#8221;</div>
<div id="_mcePaste"># Set defaults</div>
<div id="_mcePaste"># set your outside interface network device name and</div>
<div id="_mcePaste"># domain name servers IP address to values issued by your ISP.</div>
<div id="_mcePaste">oif=&#8221;rl0&#8243;                  # Nic card to cable modem public internet connection</div>
<div id="_mcePaste">odns1=&#8221;24.50.201.66&#8243;       # ISP&#8217;s dns server 1 IP address</div>
<div id="_mcePaste">odns2=&#8221;24.52.201.66&#8243;       # ISP&#8217;s dns server 2 IP address</div>
<div id="_mcePaste"># Set these to your inside interface network and ip address range</div>
<div id="_mcePaste">iif=&#8221;xl0&#8243;                  # Nic card to private internal Local area network</div>
<div id="_mcePaste"># This is the start of the rules.</div>
<div id="_mcePaste"># All traffic coming in from the internet or</div>
<div id="_mcePaste"># leaving the local LAN start here</div>
<div id="_mcePaste"># Internal gateway housekeeping</div>
<div id="_mcePaste"># Rules # 100 exempt everything on localhost behind the firewall from this rules set.</div>
<div id="_mcePaste"># Rules # 110 &#38; 120 deny the reference to the localhost default IP address.</div>
<div id="_mcePaste">$cmd 00100 allow all from any to any via lo0  # allow all localhost</div>
<div id="_mcePaste">$cmd 00110 deny log  all from any to 127.0.0.0/8  # deny use of localhost IP</div>
<div id="_mcePaste">$cmd 00120 deny log  all from 127.0.0.0/8 to any  # deny use of localhost IP</div>
<div id="_mcePaste"># This does the  Network Address translation of every packet coming in</div>
<div id="_mcePaste"># or going out over the public internet.</div>
<div id="_mcePaste">$cmd 00150 divert natd all from any to any via $oif</div>
<div id="_mcePaste">#*** TESTING PURPOSES ONLY *** TESTING PURPOSES ONLY *** TESTING PURPOSES ONLY</div>
<div id="_mcePaste"># The following rule if un-commented will change the behavior of this</div>
<div id="_mcePaste"># Firewall rule set from closed to completely open, thus bypassing all of the</div>
<div id="_mcePaste"># following rules. This single rule is placed here for TESTING PURPOSES ONLY.</div>
<div id="_mcePaste">#$cmd 00160 allow log logamount 500 all from any to any</div>
<div id="_mcePaste">#$cmd 00161 allow all from any to any</div>
<div id="_mcePaste">########  control section  ############################################</div>
<div id="_mcePaste"># Start of IPFW advanced Stateful Filtering using &#8220;dynamic&#8221; rules.</div>
<div id="_mcePaste"># The check-state statement behavior is to match bi-directional packet traffic</div>
<div id="_mcePaste"># flow between source and destination using protocol/IP/port/sequence number.</div>
<div id="_mcePaste"># The dynamic rule has a limited lifetime which is controlled by a set of</div>
<div id="_mcePaste"># sysctl(8) variables. The lifetime is refreshed every time a matching</div>
<div id="_mcePaste"># packet is found in the dynamic table.</div>
<div id="_mcePaste"># Allow the packet through if it has previous been added to the</div>
<div id="_mcePaste"># the &#8220;dynamic&#8221; rules table by an allow keep-state statement.</div>
<div id="_mcePaste">$cmd 00200 check-state</div>
<div id="_mcePaste"># Run all private Lan packet traffic through the dynamic rules</div>
<div id="_mcePaste"># table so the IP address are in sync with Natd.</div>
<div id="_mcePaste">$cmd 00210 allow all from any to any via xl0 keep-state</div>
<div id="_mcePaste"># Deny all fragments as bogus packets</div>
<div id="_mcePaste">$cmd 00250 deny all from any to any frag in via $oif</div>
<div id="_mcePaste"># Deny  ACK packets that did not match the dynamic rule table</div>
<div id="_mcePaste">$cmd 00260 deny tcp from any to any established in via $oif</div>
<div id="_mcePaste">########  outbound section  ############################################</div>
<div id="_mcePaste"># Interrogate packets originating from behind the firewall, private net.</div>
<div id="_mcePaste"># Upon a rule match, it&#8217;s keep-state option will create a dynamic rule.</div>
<div id="_mcePaste"># Allow out non-secure standard www function</div>
<div id="_mcePaste">$cmd 00300 allow tcp  from any to any 80  out via $oif setup keep-state</div>
<div id="_mcePaste"># Allow out secure www function https over TLS SSL</div>
<div id="_mcePaste">$cmd 00301 allow tcp  from any to any 443 out via $oif setup keep-state</div>
<div id="_mcePaste"># Allow out access to my ISP&#8217;s Domain name server.</div>
<div id="_mcePaste">$cmd 00310 allow tcp  from any to $odns1 53 out via $oif setup keep-state</div>
<div id="_mcePaste">$cmd 00311 allow udp  from any to $odns1 53 out via $oif keep-state</div>
<div id="_mcePaste">$cmd 00315 allow tcp  from any to $odns2 53 out via $oif setup keep-state</div>
<div id="_mcePaste">$cmd 00316 allow udp  from any to $odns2 53 out via $oif keep-state</div>
<div id="_mcePaste"># Allow out send &#38; get email function</div>
<div id="_mcePaste">$cmd 00330 allow tcp from any to any 25  out via $oif setup keep-state</div>
<div id="_mcePaste">$cmd 00331 allow tcp from any to any 110 out via $oif setup keep-state</div>
<div id="_mcePaste"># Allow out &#38; in FBSD (make install &#38; CVSUP)  functions</div>
<div id="_mcePaste"># Basically give user id root  &#8221;GOD&#8221;  privileges.</div>
<div id="_mcePaste">$cmd 00340 allow tcp from me to any out via $oif setup keep-state uid root</div>
<div id="_mcePaste"># Allow out &#38; in console traceroot command</div>
<div id="_mcePaste">$cmd 00342 allow udp from me to any 33435-33500 out via $oif keep-state</div>
<div id="_mcePaste">$cmd 00343 allow log icmp from any to me icmptype 3,11 in via $oif limit src-addr 2</div>
<div id="_mcePaste"># Allow out ping</div>
<div id="_mcePaste">$cmd 00350 allow icmp from any to any   out via $oif keep-state</div>
<div id="_mcePaste">############ passive FTP rules to public Internet ######</div>
<div id="_mcePaste"># Allow passive FTP control channel 21 &#38; data high ports</div>
<div id="_mcePaste">$cmd 00375 allow tcp  from me to any 21  out via $oif setup keep-state</div>
<div id="_mcePaste">$cmd 00376 allow tcp  from me to any 10000-65000  out via $oif setup keep-state</div>
<div id="_mcePaste">############ End of passive FTP rules to public Internet ######</div>
<div id="_mcePaste"># Allow out ssh</div>
<div id="_mcePaste">$cmd 00380 allow tcp  from any to any 22   out via $oif setup keep-state</div>
<div id="_mcePaste"># Allow out TELNET</div>
<div id="_mcePaste">$cmd 00390 allow tcp  from any to any 23    out via $oif setup keep-state</div>
<div id="_mcePaste"># Allow out Network Time Protocol (NTP) queries</div>
<div id="_mcePaste">#$cmd 00394 allow tcp  from any to any 123   out via $oif setup keep-state</div>
<div id="_mcePaste">#$cmd 00395 allow udp  from any to any 123   out via $oif keep-state</div>
<div id="_mcePaste"># Allow out Time</div>
<div id="_mcePaste">$cmd 00396 allow tcp  from any to any 37    out via $oif setup keep-state</div>
<div id="_mcePaste">$cmd 00397 allow udp  from any to any 37    out via $oif keep-state</div>
<div id="_mcePaste"># Allow out ident</div>
<div id="_mcePaste">#$cmd 00400 allow tcp  from any to any 113   out via $oif setup keep-state</div>
<div id="_mcePaste">#$cmd 00401 allow udp  from any to any 113   out via $oif keep-state</div>
<div id="_mcePaste"># Allow out IRC</div>
<div id="_mcePaste">#$cmd 00410 allow tcp  from any to any 194   out via $oif setup keep-state</div>
<div id="_mcePaste">#$cmd 00411 allow udp  from any to any 194   out via $oif keep-state</div>
<div id="_mcePaste"># Allow out whois</div>
<div id="_mcePaste">$cmd 00412 allow tcp  from any to any 43    out via $oif setup keep-state</div>
<div id="_mcePaste">$cmd 00413 allow udp  from any to any 43    out via $oif keep-state</div>
<div id="_mcePaste"># Allow out whois++</div>
<div id="_mcePaste">#$cmd 00415 allow tcp  from any to any 63    out via $oif setup keep-state</div>
<div id="_mcePaste">#$cmd 00416 allow udp  from any to any 63    out via $oif keep-state</div>
<div id="_mcePaste"># Allow out finger</div>
<div id="_mcePaste">#$cmd 00420 allow tcp  from any to any 79    out via $oif setup keep-state</div>
<div id="_mcePaste">#$cmd 00421 allow udp  from any to any 79    out via $oif keep-state</div>
<div id="_mcePaste"># Allow out nntp news</div>
<div id="_mcePaste">$cmd 00425 allow tcp  from any to any 119   out via $oif setup keep-state</div>
<div id="_mcePaste">$cmd 00426 allow udp  from any to any 119   out via $oif keep-state</div>
<div id="_mcePaste"># Allow out gopher</div>
<div id="_mcePaste">#$cmd 00430 allow tcp  from any to any 70    out via $oif setup keep-state</div>
<div id="_mcePaste">#$cmd 00431 allow udp  from any to any 70    out via $oif keep-state</div>
<div id="_mcePaste">########  inbound section  ############################################</div>
<div id="_mcePaste"># Interrogate packets originating from in front of the firewall, public net.</div>
<div id="_mcePaste"># Place statements here to allow public requests for service.</div>
<div id="_mcePaste"># Allow in www</div>
<div id="_mcePaste">$cmd 00600 allow tcp from any to any 80 in via $oif setup keep-state limit src-addr 4</div>
<div id="_mcePaste"># Allow  TCP FTP control channel in &#38; data channel out</div>
<div id="_mcePaste">$cmd 00610 allow tcp from any to me 21  in via $oif setup keep-state limit src-addr 4</div>
<div id="_mcePaste">$cmd 00611 allow tcp from any 20 to any 1024-49151 out via $oif setup keep limit src-addr 4</div>
<div id="_mcePaste"># Allow in ssh function</div>
<div id="_mcePaste">$cmd 00620 allow log tcp from any to me 22 in via $oif setup keep-state limit src-addr 4</div>
<div id="_mcePaste"># Allow in Telnet</div>
<div id="_mcePaste">$cmd 00630 allow tcp from any to me 23 in via $oif setup keep-state limit src-addr 4</div>
<div id="_mcePaste"># Allow in Ping</div>
<div id="_mcePaste">$cmd 00635 allow log icmp from any to me icmptype 0,8  in via $oif</div>
<div id="_mcePaste"># This sends a RESET to all ident packets.</div>
<div id="_mcePaste">#$cmd 00640 reset log tcp from any to me 113  in via $oif limit src-addr 4</div>
<div id="_mcePaste">########  Catch all section  ############################################</div>
<div id="_mcePaste">#### Start Special rules for Adelphia Cable  #########################</div>
<div id="_mcePaste">#valid dhcp broadcast from Adelphia dhcp server</div>
<div id="_mcePaste">$cmd 00700 allow UDP from 0.0.0.0 68 to 255.255.255.255 67 in via rl0</div>
<div id="_mcePaste"># valid FBSD dhcp client request for dns config info</div>
<div id="_mcePaste">$cmd 00701 allow udp from me 68 to $odns1 67      out via rl0</div>
<div id="_mcePaste">$cmd 00702 allow udp from $odns1 67 to me 68       in via rl0</div>
<div id="_mcePaste"># invalid bogus packets on Adelphia Cable network.</div>
<div id="_mcePaste">$cmd 00705 deny udp from any to 255.255.255.255    in via rl0</div>
<div id="_mcePaste">$cmd 00706 deny udp from 0.0.0.0 to any            in via rl0</div>
<div id="_mcePaste">#               P:2</div>
<div id="_mcePaste">$cmd 00707 deny all  from 192.168.100.1 to 224.0.0.1   in via rl0</div>
<div id="_mcePaste">$cmd 00708 deny udp from $odns1 53 to me           in via rl0</div>
<div id="_mcePaste">#### End Special rules for Adelphia Cable  #########################</div>
<div id="_mcePaste"># Stop &#38; log external redirect requests.</div>
<div id="_mcePaste">$cmd 00720 deny log icmp from any to any icmptype 5  in via $oif</div>
<div id="_mcePaste"># Stop &#38; log spoofing Attack attempts.</div>
<div id="_mcePaste"># Examine incoming traffic for packets with both a source and destination</div>
<div id="_mcePaste"># IP address in my local domain as per CIAC prevention alert.</div>
<div id="_mcePaste">$cmd 00730 deny log ip from me to me  in via $oif</div>
<div id="_mcePaste"># Stop &#38; log ping echo attacks</div>
<div id="_mcePaste"># stop echo reply (ICMP type 0), and echo request (type 8).</div>
<div id="_mcePaste">$cmd 00740 deny log icmp from any to me icmptype 0,8  in via $oif</div>
<div id="_mcePaste"># Reject &#38; Log all setup of tcp incoming connections from the outside</div>
<div id="_mcePaste">$cmd 00750 deny log tcp from any to any  setup  in via $oif</div>
<div id="_mcePaste"># Reject &#38; Log all netbios service. 137=name, 138=datagram, 139=session</div>
<div id="_mcePaste"># netbios is ms/windows sharing services.</div>
<div id="_mcePaste">$cmd 00760 deny log tcp from any to any 137,138,139  in via $oif</div>
<div id="_mcePaste">$cmd 00761 deny log udp from any to any 137,138,139  in via $oif</div>
<div id="_mcePaste"># Reject all port 80 http packets that fall through to here.</div>
<div id="_mcePaste"># These packets are auto spawn web page requests from within</div>
<div id="_mcePaste"># original web page request.</div>
<div id="_mcePaste">$cmd 00770 deny  tcp from any to any 80   out via $oif</div>
<div id="_mcePaste"># Everything else is denied by default</div>
<div id="_mcePaste"># deny and log all packets that fell through to see what they are</div>
<div id="_mcePaste">$cmd 00950 deny log logamount 500 all from any to any</div>
<div id="_mcePaste">################## End Of IPFW Firewall Rules  #########################</div>
<div id="_mcePaste">Other IP stack security options.</div>
<div id="_mcePaste">The main run control configuration file /etc/rc.conf has a whole group of run time security options to control the flood of falsified packets entering the system which get control before IPFW evens knows their coming in.</div>
<div id="_mcePaste">The following is from my rc.conf file.</div>
<div id="_mcePaste"># Required IPFW  kernel firewall support</div>
<div id="_mcePaste"># For more info see</div>
<div id="_mcePaste"># www.onlamp.com/pub/a/bsd/2001/04/25/FreeBSD_Basics.html</div>
<div id="_mcePaste">#</div>
<div id="_mcePaste">firewall_enable=&#8221;YES&#8221;                 # Start daemon</div>
<div id="_mcePaste">firewall_script=&#8221;/etc/ipfw.stdrules&#8221;  # run my custom rules if present</div>
<div id="_mcePaste"># sh /etc/ipfw.stdrules will load</div>
<div id="_mcePaste"># new rules file after editing.</div>
<div id="_mcePaste">filewall_logging=&#8221;YES&#8221;                # Enable events logging</div>
<div id="_mcePaste"># Extra firewalling options</div>
<div id="_mcePaste">log_in_vain=&#8221;YES&#8221;           # NO is default. YES enables logging of</div>
<div id="_mcePaste"># connection attempts to ports that have no</div>
<div id="_mcePaste"># listening socket on them. Put msg on consol</div>
<div id="_mcePaste">icmp_drop_redirect=&#8221;YES&#8221;    # YES will cause the kernel to ignore</div>
<div id="_mcePaste"># ICMP REDIRECT packets.</div>
<div id="_mcePaste">tcp_drop_synfin=&#8221;YES&#8221;       # YES will cause the kernel to ignore TCP</div>
<div id="_mcePaste"># frames that have both the SYN and FIN flags</div>
<div id="_mcePaste"># set. Only available if the kernel was built</div>
<div id="_mcePaste"># with the TCP_DROP_SYNFIN option.</div>
<div id="_mcePaste"># change to NO if web server behind firewall.</div>
<div id="_mcePaste">tcp_restrict_rst=&#8221;YES&#8221;      # YES will cause the kernel to refrain from</div>
<div id="_mcePaste"># emitting TCP RST frames in response to</div>
<div id="_mcePaste"># invalid TCP packets (e.g., frames destined</div>
<div id="_mcePaste"># for closed ports). This option is only</div>
<div id="_mcePaste"># available if the kernel was built with the</div>
<div id="_mcePaste"># TCP_RESTRICT_RST option.</div>
<div id="_mcePaste">syslogd_flags=&#8221;-ss&#8221;         # Don&#8217;t use network sockets so portscan</div>
<div id="_mcePaste"># will not find (security tip)</div>
<div id="_mcePaste">portmap_enable=&#8221;NO&#8221;         # Don&#8217;t allow nfs portmapper (security tip)</div>
<div id="_mcePaste">The  log_in_vain=&#8221;YES&#8221; option will post a message to the root console screen every time it stops a packet. This became very annoying so I changed the syslog to put these messages in the security log. All the ipfw messages that were going to the /var/log/security file was also going to the /var/log/message file. I did not think it was wise to be posting ipfw messages in more that one place, so I stopped them from going to the message file.  Below are the lines I changed in /etc/syslog.conf to make this happen.</div>
<div id="_mcePaste">The original lines.</div>
<div id="_mcePaste">*.err;kern.debug;auth.notice;mail.crit		/dev/console</div>
<div id="_mcePaste">*.notice;kern.debug;lpr.info;mail.crit;news.err	/var/log/messages</div>
<div id="_mcePaste">security.*					/var/log/security</div>
<div id="_mcePaste">replaced by this lines</div>
<div id="_mcePaste"># kern.info is where the log_in_vain messages come from. The following</div>
<div id="_mcePaste"># will stop the log_in_vain messages from coming out on root console &#38;</div>
<div id="_mcePaste"># put them in the security log.  2/20/2002 Joe Barbish</div>
<div id="_mcePaste"># remove kern.info messages from /dev/console &#38; /var/log/messages</div>
<div id="_mcePaste"># and put them into /var/log/security.</div>
<div id="_mcePaste">*.err;auth.notice;mail.crit			/dev/console</div>
<div id="_mcePaste">kern.notice;kern.=debug				/dev/console</div>
<div id="_mcePaste">*.notice;lpr.info;mail.crit;news.err	/var/log/messages</div>
<div id="_mcePaste">kern.notice;kern.=debug				/var/log/messages</div>
<div id="_mcePaste">security.*;kern.=info				/var/log/security</div>
<div id="_mcePaste">Another very obscure option is blackhole, new in FBSD 4.4</div>
<div id="_mcePaste">The blackhole sysctl(8) is used to control system behavior when connection requests are received on TCP or UDP ports where there is no socket listening.</div>
<div id="_mcePaste">Normal behavior, when a TCP SYN segment is received on a port where there is no socket accepting connections, is for the system to return a RST segment, and drop the connection. The connecting system will see this as a &#8220;Connection reset by peer&#8221;.</div>
<div id="_mcePaste">By setting the TCP blackhole MIB to a numeric value of 1, the incoming SYN segment is merely dropped, and no RST is sent, making the system appear as a blackhole.</div>
<div id="_mcePaste">By setting the MIB value to 2, any segment arriving on a closed port is dropped without returning a RST.  This provides some degree of protection against stealth port scans.</div>
<div id="_mcePaste">In the UDP instance, enabling blackhole behavior turns off the sending of an ICMP port unreachable message in response to a UDP datagram which arrives on a port where there is no socket listening. It must be noted that this behavior will prevent remote systems from running traceroute(8) to a system.</div>
<div id="_mcePaste">The blackhole behavior is useful to slow down anyone who is port scanning a system, attempting to detect vulnerable services on a system. It could potentially also slow down someone who is attempting a denial of service attack.</div>
<div id="_mcePaste">The sysctl net.inet.tcp.blackhole=2 command can be entered from the command line and will be in effect until the next boot. The sysctl command can also be in the /etc/sysctl.conf file (which you must create) and if present will be activated during the boot process. Read man sysctl for command format to display settings of this option and some others that allow you to change to default dynamic rules time out values. For the really advanced technical ipfw user check out ipfw user patches at  http://people.freebsd.org/~cjc/</div>
<div id="_mcePaste">See http://bsdvault.net/sections.php?op=viewarticle&#38;artid=57 for info on sysctl.</div>
<div id="_mcePaste">See http://www.practicallynetworked.com/sharing/app_port_list.htm  for a list of ports used by different applications.</div>
<div id="_mcePaste">/etc/sysctl.conf  file contents</div>
<div id="_mcePaste">sysctl net.inet.tcp.blackhole=2</div>
<div id="_mcePaste">sysctl net.inet.udp.blackhole=1</div>
<div id="_mcePaste">Here are the statements for the kernel source to include IPFW in the kernel.</div>
<div id="_mcePaste">#</div>
<div id="_mcePaste"># The following options add sysctl variables for controlling how certain</div>
<div id="_mcePaste"># TCP packets are handled by the kernel.</div>
<div id="_mcePaste">#</div>
<div id="_mcePaste">options	        ICMP_BANDLIM	        # Enables icmp error response bandwidth</div>
<div id="_mcePaste"># limiting. This will help protect from</div>
<div id="_mcePaste"># D.O.S. packet attacks.</div>
<div id="_mcePaste">option          TCP_DROP_SYNFIN       # Adds support for ignoring TCP packets</div>
<div id="_mcePaste"># with SYN+FIN. This prevents nmap from</div>
<div id="_mcePaste"># identifying the TCP/IP stack, but</div>
<div id="_mcePaste"># breaks support for RFC1644 extensions</div>
<div id="_mcePaste"># &#38; is not recommended for web servers.</div>
<div id="_mcePaste"># not supported in 4.4 &#38; newer</div>
<div id="_mcePaste">#option          TCP_RESTRICT_RST     # Adds support for blocking emission of</div>
<div id="_mcePaste"># TCP RST packets. Useful in limiting</div>
<div id="_mcePaste"># SYN floods &#38; port scanning.</div>
<div id="_mcePaste"># Enable kernel IPFW, the FBSD supplied packet filtering and accounting system</div>
<div id="_mcePaste"># Has a FBSD supplied user land control utility ipfw.</div>
<div id="_mcePaste">#</div>
<div id="_mcePaste">option 		IPFIREWALL                  # Adds filtering code into kernel</div>
<div id="_mcePaste">option		IPFIREWALL_VERBOSE          # enable logging thru syslogd(8)</div>
<div id="_mcePaste">option		IPFIREWALL_VERBOSE_LIMIT=10 # stop attack via syslog flooding</div>
<div id="_mcePaste">option         IPFIREWALL_IPDIVERT         # Enable NATD divert function</div>
<p>IPFW:check-state/keep-state advanced stateful rules.  By Joe Barbish  07/22/2002  All rights reserved.<br />
As most new ipfw users, I had a typical ipfw rules file built from the simple stateful rules in rc.firewall. I had originally been using user ppp with it&#8217;s internal Nat function, but went to natd as the simple stateful type in rc.firewall showed. Since the sample rc.firewall (simple) was pretty much just what I wanted to do, I just assumed this was the correct and proper way, so I cut out the simple type code from rc.firewall to create my own ipfw firewall rules. In searching FBSD and the many sites found by google search I saw many many other people before me had done the same thing. From a technical point of view the whole rc.firewall file is based on simple stateful rules using setup/established with some stateless rules thrown in. As a new ipfw user I did not know the difference and the comments sure did not call out the difference.<br />
When I tried to change my simple stateful [established/setup] to advanced stateful [check-state/keep-state] rules, I kept having trouble with ip address being mismatched. Technically the mismatches showed up in /var/log/security as packets that got denied by the (default deny everything rule) for all packets that reach the end of the rule set with out matching any rule. Configuration looked like this.<br />
Divert natd (network address translation)                   (                   (LAN PC&#8217;s  &#60; &#8212; &#62; IPFW  &#60; &#8212; &#62;  internetPrivate IP     advanced        public ip  Address      stateful rules    address<br />
I spend weeks playing around trying different combinations of ipfw rules, but kept having mismatches in the dynamic table. Finally I removed the natd divert rule from the ipfw rules set and deactivated natd in rc.conf and re-activated ppp -Nat in rc.conf, and the advanced stateful [check-state/keep-state] rules started to work. Configuration looked like this.</p>
<p>LAN PC&#8217;s  &#60; &#8212; &#62; IPFW  &#60; &#8212; &#62;  user ppp -nat &#60; &#8212; &#62; internetPrivate IP     advanced        network address      public ip  Address      stateful rules    translation           address<br />
In this configuration IPFW only knows the private ip address on the LAN and the advanced stateful rules functioned just like described in the man documentation.<br />
I wrote emails to the IPFW authors, gave then 2 documented examples of rules sets using exclusively advanced stateful rules and user ppp dial up ISP, the only difference was one used user ppp -nat and did not have the divert natd rulecd ../ one had the divert natd rule and no user ppp -nat and did not work. After much conflicting correspondences the results were that they were not going to do anything about it and I was left on my own.<br />
The real problem here is ipfw advanced stateful rules are relatively new to the IPFW program (FBSD version 4.0 year 2000) and still does not fit cleanly into the divert natd program logic.<br />
IPFW was originally designed as a firewall using stateless rules and/or simple stateful rules which is nothing more than an rules file coding logic technique based on the TP flags setup/established. Using these very primitive type of rules IPFW function&#8217;s correctly. When advanced stateful rules are used to tighten down the control of packets passing through the firewall by dynamically creating an internal rules table based on the by-directional exchange of packets which have to match the pre-known ip address, flow direction, and packet sequence numbers the divert natd function malfunctions. This problem is not limited to dial up internet access, but also occurs for &#8216;all ways on&#8217; environments (DSL, Cable, T1) with or without DHCP support.<br />
Many users reach this point using the advanced check-state/keep-state stateful rules and go back to simple stateful rule set using established/setup simple because they can not get the advanced stateful rules to work. The rc.firewall file was created for FBSD 2.0 and has not been updated to exclusively utilize the advanced stateful rule set, so it is a very poor example to be using for your ipfw rules set.<br />
Cable internet access became available in my area and I was forced to revisit the divert natd / advanced stateful rules again because (DSL, Cable, T1) &#8216;all ways on&#8217; environments normally use the ISP&#8217;s DHCP server to get it&#8217;s network configuration information so user ppp -nat is not used in this case. This meant I had to use the divert natd ipfw statement to provide the NAT function so I could use private ip address for my LAN because my cable ISP only issues one dynamic public ip address per customer account.<br />
After many days of trial and error testing I finally found an rules coding logic which functioned correctly using exclusively advanced check-state/keep-state stateful rules and the divert natd rule statement. Normally the rule to allow the packets from local LAN Nic cards to pass through the ipfw firewall come before the divert natd rule as seen in the rc.firewall file. But for advanced stateful rules it has to be moved after the divert natd rule and the &#8216;keep-state&#8217; option has to be used so the dynamic rules table knows about the packet activity before they get passed through the rules file the second time. Technically this means each packet will have 2 sets of dynamic table rules, one set for the private Nic interface and one for the public Nic interface. This is an resource waste, decreases performance, and not necessary if the nat function is done outside of ipfw.<br />
The simplest and best solution to the advanced stateful rules problem is to use &#8216;user ppp -nat&#8217; for all dialup ISP environments and have no divert natd rule in the ipfw rules file.  For all DSL, cable, and T1 connection where the ISP&#8217;s DHCP is used to configure FBSD&#8217;s public network you have to use the divert natd rule in your ipfw rules set followed by this rule for each private Nic interface,  &#8217;allow all from any to any via xl0 keep-state&#8217;<br />
where xl0 is the private Nic card interface device name. This solution has been tested in FBSD version 4.5 &#38; 4.6.<br />
The IPFW rules listed below are my current firewall rules file configured for a cable divert natd environment. Here are the matching /etc/rc.conf optionsifconfig_rl0=&#8221;DHCP&#8221;ppp_enable=&#8221;NO&#8221;             natd_enable=&#8221;YES&#8221;natd_interface=&#8221;rl0&#8243;natd_flags=&#8221;-dynamic&#8221;firewall_enable=&#8221;YES&#8221;                 firewall_script=&#8221;/etc/ipfw.rules.conf&#8221;</p>
<p>For an user ppp dialup modem ISP connection using &#8216;divert natd&#8217; make following changes to the ipfw rules below   Change  oif=&#8221;rl0&#8243;  to  oif=&#8221;tun0&#8243;<br />
Here are the matching /etc/rc.conf options#ifconfig_rl0=&#8221;DHCP&#8221;ppp_enable=&#8221;YES&#8221;ppp_mode=&#8221;ddial&#8221;             ppp_profile=&#8221;papchat&#8221;        ppp_nat=&#8221;NO&#8221;                       natd_enable=&#8221;YES&#8221;natd_interface=&#8221;tun0&#8243;natd_flags=&#8221;-dynamic&#8221;firewall_enable=&#8221;YES&#8221;                 firewall_script=&#8221;/etc/ipfw.rules.conf</p>
<p>For an user ppp dialup modem ISP connection using &#8216;user ppp -nat&#8217; make following changes to the ipfw rules belowChange  oif=&#8221;rl0&#8243;  to  oif=&#8221;tun0&#8243;  Add    $cmd 00130 allow all from any to any via xl0Delete $cmd 00150 divert natd all from any to any via $oifDelete $cmd 00210 allow all from any to any via xl0 keep-state<br />
Here are the matching /etc/rc.conf options#ifconfig_rl0=&#8221;DHCP&#8221;ppp_enable=&#8221;YES&#8221;ppp_mode=&#8221;ddial&#8221;             ppp_profile=&#8221;papchat&#8221;        ppp_nat=&#8221;YES&#8221;                       natd_enable=&#8221;NO&#8221;#natd_interface=&#8221;tun0&#8243;#natd_flags=&#8221;-dynamic&#8221;firewall_enable=&#8221;YES&#8221;                 firewall_script=&#8221;/etc/ipfw.rules.conf</p>
<p>Following the rules file below are some other IP stack security options which are specified in the /etc/rc.conf file and kernel that you can use as a guide to configure your own world.<br />
/etc/ipfw.rules.conf############################################################################# Define IPFW firewall rules for gateway.poweruser.net # 7/04/2002  Joe Barbish  ##   Cable modem connection to ISP with dynamic IP addresses assigned.#   Private Ip address used inside.#   3 win98 boxes on LAN with DHCP used for auto private network configure. #   Protect the whole private network from loss of service attacks#   These rules can be reloaded with out rebooting by issuing this command#   sh /etc/ipfw.rules.conf##   The use of &#8216;me&#8217; in rules means IP address 127.0.0.0 localhost #   # Firewall Policy Statement.#   Each public internet function must be explicitly allowed by a rule.#   Only valid response to the packets I&#8217;ve sent out are allowed in.#   All packets must use the IPFW advanced &#8220;dynamic&#8221; rules function.#   No state-less rules or simple-stateful rules are allowed to grant#   internet function.#############################################################################<br />
# Flush out the list before we begin./sbin/ipfw -q -f flush<br />
# Set rules command prefix# The -q option on the command is for quite mode. # Do not display rules as they load. Remove during development to see.cmd=&#8221;/sbin/ipfw -q add&#8221;<br />
# Set defaults  # set your outside interface network device name and # domain name servers IP address to values issued by your ISP.</p>
<p>oif=&#8221;rl0&#8243;                  # Nic card to cable modem public internet connectionodns1=&#8221;24.50.201.66&#8243;       # ISP&#8217;s dns server 1 IP addressodns2=&#8221;24.52.201.66&#8243;       # ISP&#8217;s dns server 2 IP address<br />
# Set these to your inside interface network and ip address rangeiif=&#8221;xl0&#8243;                  # Nic card to private internal Local area network</p>
<p># This is the start of the rules. # All traffic coming in from the internet or# leaving the local LAN start here</p>
<p># Internal gateway housekeeping# Rules # 100 exempt everything on localhost behind the firewall from this rules set.# Rules # 110 &#38; 120 deny the reference to the localhost default IP address.$cmd 00100 allow all from any to any via lo0  # allow all localhost$cmd 00110 deny log  all from any to 127.0.0.0/8  # deny use of localhost IP $cmd 00120 deny log  all from 127.0.0.0/8 to any  # deny use of localhost IP</p>
<p># This does the  Network Address translation of every packet coming in# or going out over the public internet.<br />
$cmd 00150 divert natd all from any to any via $oif<br />
#*** TESTING PURPOSES ONLY *** TESTING PURPOSES ONLY *** TESTING PURPOSES ONLY# The following rule if un-commented will change the behavior of this# Firewall rule set from closed to completely open, thus bypassing all of the# following rules. This single rule is placed here for TESTING PURPOSES ONLY.#$cmd 00160 allow log logamount 500 all from any to any#$cmd 00161 allow all from any to any</p>
<p>########  control section  ############################################# Start of IPFW advanced Stateful Filtering using &#8220;dynamic&#8221; rules.# The check-state statement behavior is to match bi-directional packet traffic# flow between source and destination using protocol/IP/port/sequence number. # The dynamic rule has a limited lifetime which is controlled by a set of# sysctl(8) variables. The lifetime is refreshed every time a matching# packet is found in the dynamic table.<br />
# Allow the packet through if it has previous been added to the # the &#8220;dynamic&#8221; rules table by an allow keep-state statement. $cmd 00200 check-state<br />
# Run all private Lan packet traffic through the dynamic rules# table so the IP address are in sync with Natd.$cmd 00210 allow all from any to any via xl0 keep-state<br />
# Deny all fragments as bogus packets $cmd 00250 deny all from any to any frag in via $oif<br />
# Deny  ACK packets that did not match the dynamic rule table$cmd 00260 deny tcp from any to any established in via $oif</p>
<p>########  outbound section  ############################################# Interrogate packets originating from behind the firewall, private net.# Upon a rule match, it&#8217;s keep-state option will create a dynamic rule.<br />
# Allow out non-secure standard www function$cmd 00300 allow tcp  from any to any 80  out via $oif setup keep-state<br />
# Allow out secure www function https over TLS SSL$cmd 00301 allow tcp  from any to any 443 out via $oif setup keep-state<br />
# Allow out access to my ISP&#8217;s Domain name server. $cmd 00310 allow tcp  from any to $odns1 53 out via $oif setup keep-state $cmd 00311 allow udp  from any to $odns1 53 out via $oif keep-state$cmd 00315 allow tcp  from any to $odns2 53 out via $oif setup keep-state  $cmd 00316 allow udp  from any to $odns2 53 out via $oif keep-state<br />
# Allow out send &#38; get email function$cmd 00330 allow tcp from any to any 25  out via $oif setup keep-state$cmd 00331 allow tcp from any to any 110 out via $oif setup keep-state<br />
# Allow out &#38; in FBSD (make install &#38; CVSUP)  functions# Basically give user id root  &#8221;GOD&#8221;  privileges.$cmd 00340 allow tcp from me to any out via $oif setup keep-state uid root<br />
# Allow out &#38; in console traceroot command$cmd 00342 allow udp from me to any 33435-33500 out via $oif keep-state  $cmd 00343 allow log icmp from any to me icmptype 3,11 in via $oif limit src-addr 2<br />
# Allow out ping $cmd 00350 allow icmp from any to any   out via $oif keep-state<br />
############ passive FTP rules to public Internet ####### Allow passive FTP control channel 21 &#38; data high ports $cmd 00375 allow tcp  from me to any 21  out via $oif setup keep-state$cmd 00376 allow tcp  from me to any 10000-65000  out via $oif setup keep-state############ End of passive FTP rules to public Internet ######<br />
# Allow out ssh $cmd 00380 allow tcp  from any to any 22   out via $oif setup keep-state<br />
# Allow out TELNET $cmd 00390 allow tcp  from any to any 23    out via $oif setup keep-state<br />
# Allow out Network Time Protocol (NTP) queries #$cmd 00394 allow tcp  from any to any 123   out via $oif setup keep-state#$cmd 00395 allow udp  from any to any 123   out via $oif keep-state<br />
# Allow out Time $cmd 00396 allow tcp  from any to any 37    out via $oif setup keep-state$cmd 00397 allow udp  from any to any 37    out via $oif keep-state<br />
# Allow out ident#$cmd 00400 allow tcp  from any to any 113   out via $oif setup keep-state#$cmd 00401 allow udp  from any to any 113   out via $oif keep-state<br />
# Allow out IRC#$cmd 00410 allow tcp  from any to any 194   out via $oif setup keep-state#$cmd 00411 allow udp  from any to any 194   out via $oif keep-state<br />
# Allow out whois$cmd 00412 allow tcp  from any to any 43    out via $oif setup keep-state$cmd 00413 allow udp  from any to any 43    out via $oif keep-state<br />
# Allow out whois++#$cmd 00415 allow tcp  from any to any 63    out via $oif setup keep-state#$cmd 00416 allow udp  from any to any 63    out via $oif keep-state<br />
# Allow out finger#$cmd 00420 allow tcp  from any to any 79    out via $oif setup keep-state#$cmd 00421 allow udp  from any to any 79    out via $oif keep-state<br />
# Allow out nntp news$cmd 00425 allow tcp  from any to any 119   out via $oif setup keep-state$cmd 00426 allow udp  from any to any 119   out via $oif keep-state<br />
# Allow out gopher#$cmd 00430 allow tcp  from any to any 70    out via $oif setup keep-state#$cmd 00431 allow udp  from any to any 70    out via $oif keep-state</p>
<p>########  inbound section  ############################################# Interrogate packets originating from in front of the firewall, public net.# Place statements here to allow public requests for service.<br />
# Allow in www$cmd 00600 allow tcp from any to any 80 in via $oif setup keep-state limit src-addr 4<br />
# Allow  TCP FTP control channel in &#38; data channel out $cmd 00610 allow tcp from any to me 21  in via $oif setup keep-state limit src-addr 4$cmd 00611 allow tcp from any 20 to any 1024-49151 out via $oif setup keep limit src-addr 4<br />
# Allow in ssh function $cmd 00620 allow log tcp from any to me 22 in via $oif setup keep-state limit src-addr 4<br />
# Allow in Telnet  $cmd 00630 allow tcp from any to me 23 in via $oif setup keep-state limit src-addr 4<br />
# Allow in Ping $cmd 00635 allow log icmp from any to me icmptype 0,8  in via $oif<br />
# This sends a RESET to all ident packets.#$cmd 00640 reset log tcp from any to me 113  in via $oif limit src-addr 4<br />
########  Catch all section  ############################################<br />
#### Start Special rules for Adelphia Cable  #########################<br />
#valid dhcp broadcast from Adelphia dhcp server$cmd 00700 allow UDP from 0.0.0.0 68 to 255.255.255.255 67 in via rl0<br />
# valid FBSD dhcp client request for dns config info$cmd 00701 allow udp from me 68 to $odns1 67      out via rl0$cmd 00702 allow udp from $odns1 67 to me 68       in via rl0<br />
# invalid bogus packets on Adelphia Cable network.$cmd 00705 deny udp from any to 255.255.255.255    in via rl0$cmd 00706 deny udp from 0.0.0.0 to any            in via rl0#               P:2$cmd 00707 deny all  from 192.168.100.1 to 224.0.0.1   in via rl0$cmd 00708 deny udp from $odns1 53 to me           in via rl0#### End Special rules for Adelphia Cable  #########################</p>
<p># Stop &#38; log external redirect requests.$cmd 00720 deny log icmp from any to any icmptype 5  in via $oif<br />
# Stop &#38; log spoofing Attack attempts.# Examine incoming traffic for packets with both a source and destination# IP address in my local domain as per CIAC prevention alert.$cmd 00730 deny log ip from me to me  in via $oif<br />
# Stop &#38; log ping echo attacks# stop echo reply (ICMP type 0), and echo request (type 8).$cmd 00740 deny log icmp from any to me icmptype 0,8  in via $oif<br />
# Reject &#38; Log all setup of tcp incoming connections from the outside$cmd 00750 deny log tcp from any to any  setup  in via $oif<br />
# Reject &#38; Log all netbios service. 137=name, 138=datagram, 139=session# netbios is ms/windows sharing services.$cmd 00760 deny log tcp from any to any 137,138,139  in via $oif$cmd 00761 deny log udp from any to any 137,138,139  in via $oif<br />
# Reject all port 80 http packets that fall through to here.# These packets are auto spawn web page requests from within # original web page request.$cmd 00770 deny  tcp from any to any 80   out via $oif<br />
# Everything else is denied by default # deny and log all packets that fell through to see what they are$cmd 00950 deny log logamount 500 all from any to any<br />
################## End Of IPFW Firewall Rules  #########################</p>
<p>Other IP stack security options.The main run control configuration file /etc/rc.conf has a whole group of run time security options to control the flood of falsified packets entering the system which get control before IPFW evens knows their coming in.<br />
The following is from my rc.conf file.<br />
# Required IPFW  kernel firewall support# For more info see # www.onlamp.com/pub/a/bsd/2001/04/25/FreeBSD_Basics.html #<br />
firewall_enable=&#8221;YES&#8221;                 # Start daemonfirewall_script=&#8221;/etc/ipfw.stdrules&#8221;  # run my custom rules if present                                      # sh /etc/ipfw.stdrules will load                                       # new rules file after editing.filewall_logging=&#8221;YES&#8221;                # Enable events logging</p>
<p># Extra firewalling optionslog_in_vain=&#8221;YES&#8221;           # NO is default. YES enables logging of                             # connection attempts to ports that have no                            # listening socket on them. Put msg on consol<br />
icmp_drop_redirect=&#8221;YES&#8221;    # YES will cause the kernel to ignore                            # ICMP REDIRECT packets.<br />
tcp_drop_synfin=&#8221;YES&#8221;       # YES will cause the kernel to ignore TCP                            # frames that have both the SYN and FIN flags                            # set. Only available if the kernel was built                            # with the TCP_DROP_SYNFIN option.                            # change to NO if web server behind firewall.<br />
tcp_restrict_rst=&#8221;YES&#8221;      # YES will cause the kernel to refrain from                             # emitting TCP RST frames in response to                             # invalid TCP packets (e.g., frames destined                            # for closed ports). This option is only                             # available if the kernel was built with the                            # TCP_RESTRICT_RST option.<br />
syslogd_flags=&#8221;-ss&#8221;         # Don&#8217;t use network sockets so portscan			          # will not find (security tip)<br />
portmap_enable=&#8221;NO&#8221;         # Don&#8217;t allow nfs portmapper (security tip)</p>
<p>The  log_in_vain=&#8221;YES&#8221; option will post a message to the root console screen every time it stops a packet. This became very annoying so I changed the syslog to put these messages in the security log. All the ipfw messages that were going to the /var/log/security file was also going to the /var/log/message file. I did not think it was wise to be posting ipfw messages in more that one place, so I stopped them from going to the message file.  Below are the lines I changed in /etc/syslog.conf to make this happen.</p>
<p>The original lines.*.err;kern.debug;auth.notice;mail.crit		/dev/console*.notice;kern.debug;lpr.info;mail.crit;news.err	/var/log/messagessecurity.*					/var/log/security<br />
replaced by this lines# kern.info is where the log_in_vain messages come from. The following# will stop the log_in_vain messages from coming out on root console &#38;# put them in the security log.  2/20/2002 Joe Barbish# remove kern.info messages from /dev/console &#38; /var/log/messages# and put them into /var/log/security.*.err;auth.notice;mail.crit			/dev/consolekern.notice;kern.=debug				/dev/console*.notice;lpr.info;mail.crit;news.err	/var/log/messageskern.notice;kern.=debug				/var/log/messagessecurity.*;kern.=info				/var/log/security</p>
<p>Another very obscure option is blackhole, new in FBSD 4.4<br />
The blackhole sysctl(8) is used to control system behavior when connection requests are received on TCP or UDP ports where there is no socket listening.<br />
Normal behavior, when a TCP SYN segment is received on a port where there is no socket accepting connections, is for the system to return a RST segment, and drop the connection. The connecting system will see this as a &#8220;Connection reset by peer&#8221;.<br />
By setting the TCP blackhole MIB to a numeric value of 1, the incoming SYN segment is merely dropped, and no RST is sent, making the system appear as a blackhole.<br />
By setting the MIB value to 2, any segment arriving on a closed port is dropped without returning a RST.  This provides some degree of protection against stealth port scans.<br />
In the UDP instance, enabling blackhole behavior turns off the sending of an ICMP port unreachable message in response to a UDP datagram which arrives on a port where there is no socket listening. It must be noted that this behavior will prevent remote systems from running traceroute(8) to a system.<br />
The blackhole behavior is useful to slow down anyone who is port scanning a system, attempting to detect vulnerable services on a system. It could potentially also slow down someone who is attempting a denial of service attack.<br />
The sysctl net.inet.tcp.blackhole=2 command can be entered from the command line and will be in effect until the next boot. The sysctl command can also be in the /etc/sysctl.conf file (which you must create) and if present will be activated during the boot process. Read man sysctl for command format to display settings of this option and some others that allow you to change to default dynamic rules time out values. For the really advanced technical ipfw user check out ipfw user patches at  http://people.freebsd.org/~cjc/<br />
See http://bsdvault.net/sections.php?op=viewarticle&#38;artid=57 for info on sysctl.<br />
See http://www.practicallynetworked.com/sharing/app_port_list.htm  for a list of ports used by different applications.<br />
/etc/sysctl.conf  file contents<br />
sysctl net.inet.tcp.blackhole=2sysctl net.inet.udp.blackhole=1</p>
<p>Here are the statements for the kernel source to include IPFW in the kernel.## The following options add sysctl variables for controlling how certain # TCP packets are handled by the kernel. #options	        ICMP_BANDLIM	        # Enables icmp error response bandwidth                                      # limiting. This will help protect from                                       # D.O.S. packet attacks.option          TCP_DROP_SYNFIN       # Adds support for ignoring TCP packets                                       # with SYN+FIN. This prevents nmap from                                       # identifying the TCP/IP stack, but                                       # breaks support for RFC1644 extensions                                      # &#38; is not recommended for web servers.<br />
# not supported in 4.4 &#38; newer#option          TCP_RESTRICT_RST     # Adds support for blocking emission of                                      # TCP RST packets. Useful in limiting                                       # SYN floods &#38; port scanning.</p>
<p># Enable kernel IPFW, the FBSD supplied packet filtering and accounting system# Has a FBSD supplied user land control utility ipfw.# option 		IPFIREWALL                  # Adds filtering code into kerneloption		IPFIREWALL_VERBOSE          # enable logging thru syslogd(8)option		IPFIREWALL_VERBOSE_LIMIT=10 # stop attack via syslog floodingoption         IPFIREWALL_IPDIVERT         # Enable NATD divert function</p>
<p>&#160;</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Escritorio GNOME listo para Debian GNU/kFreeBSD]]></title>
<link>http://fausto23.wordpress.com/2009/11/23/escritorio-gnome-listo-para-debian-gnukfreebsd/</link>
<pubDate>Tue, 24 Nov 2009 04:27:36 +0000</pubDate>
<dc:creator>fausto23</dc:creator>
<guid>http://fausto23.wordpress.com/2009/11/23/escritorio-gnome-listo-para-debian-gnukfreebsd/</guid>
<description><![CDATA[Otro avance en el port BSD para Debian, ahora es posible instalar el metapaquete GNOME para esta dis]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a href="http://fausto23.wordpress.com/files/2009/11/nagato_kfreebsd.png"><img class="aligncenter size-full wp-image-1483" title="nagato_kfreebsd" src="http://fausto23.wordpress.com/files/2009/11/nagato_kfreebsd.png" alt="" width="409" height="413" /></a></p>
<p>Otro avance en el port BSD para Debian, ahora es posible instalar el metapaquete GNOME para esta distribución, ahora se puede ofrecer un escritorio completo para esta versión, esto aplica para las versiones amd64 e i386, aunque claro esto con algunas excepciones:</p>
<p>-No hay soporte para manejo de energia (DeviceKit-Power necesita ser portado)<br />
-No hay soporte para wireless (libiw necesita ser portado)<br />
-No hay soporte para Bluetooth (el kernel FreeBSD no tiene soporte)<br />
-No hay soporte para webcams.</p>
<p>Dejando eso a un lado, todo lo demás trabaja como debería, aunque se necesitan personas que prueben este entorno de escritorio en la versión. Para ello nos invitan a descargar e instalar <a href="http://glibc-bsd.alioth.debian.org/doc/">Debian GNU/kFreeBSD</a> en una maquina virtual, actualizar a la ultima versión de Sid e instalar gnome <code>apt-get install gnome</code></p>
<p>Este es otro paso para Debian 6, ya que <a href="http://fausto23.wordpress.com/2009/08/12/debian-6-%C2%BFque-habra-de-nuevo/">recordemos que esta versión</a> sera la primera en ofrecer un soporte al kernel FreeBSD, que aunque ya esta, sera una alternativa mas al kernel Linux.</p>
<p>Visto en &#124; <a href="http://np237.livejournal.com/27048.html">Joss Blog</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[FreeBSD memory disk]]></title>
<link>http://chiouss0817.wordpress.com/2009/11/24/freebsd-memory-disk/</link>
<pubDate>Tue, 24 Nov 2009 01:02:12 +0000</pubDate>
<dc:creator>Maverick</dc:creator>
<guid>http://chiouss0817.wordpress.com/2009/11/24/freebsd-memory-disk/</guid>
<description><![CDATA[說穿了其實也沒多困難，看一下 mdconfig 的 manual 就差不多可以上手了。這次要測試碰巧是因為想要試試看是不是真的如過去經驗一樣，compile 的速度瓶頸卡在 disk I/O 比較大，]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>說穿了其實也沒多困難，看一下 <code>mdconfig</code> 的 manual 就差不多可以上手了。這次要測試碰巧是因為想要試試看是不是真的如過去經驗一樣，compile 的速度瓶頸卡在 disk I/O 比較大，所以決定做個 memory disk 來放 <code>/usr/obj</code>。<br />
<!--more--><br />
做法就參考 manual 還有 <a href="http://www.in2home.org/">in2</a> 加持過的建議：</p>
<blockquote><p><code>mdconfig -a -t malloc -o reserve -s 2g -u 0</code><br />
<code>newfs -U /dev/md0</code><br />
<code>mount /dev/md0 /usr/obj</code></p></blockquote>
<p>然後咧？當然又是來一次 <code>make -j64 buildworld</code> 啦！結果當然是快了一些，只花了 22min 左右就結束了  XD</p>
<p>PS. 因為上次把機器玩爛了，昨天重灌一次，用的是 8.0-RELEASE (沒錯，已經偷偷上線了  <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> )</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Quickie HowTo &ndash; Installing PHP 5.x on FreeBSD]]></title>
<link>http://jasonk2600.wordpress.com/2009/11/24/quickie-howto-installing-php-5-x-on-freebsd/</link>
<pubDate>Tue, 24 Nov 2009 00:38:00 +0000</pubDate>
<dc:creator>jasonk2600</dc:creator>
<guid>http://jasonk2600.wordpress.com/2009/11/24/quickie-howto-installing-php-5-x-on-freebsd/</guid>
<description><![CDATA[Installation Install Apache and PHP from the ports collection. NOTE: When configuring the PHP 5.x po]]></description>
<content:encoded><![CDATA[Installation Install Apache and PHP from the ports collection. NOTE: When configuring the PHP 5.x po]]></content:encoded>
</item>
<item>
<title><![CDATA[Quickie HowTo - Cron Jobs Under FreeBSD]]></title>
<link>http://jasonk2600.wordpress.com/2009/11/24/quickie-howto-cron-jobs-under-freebsd/</link>
<pubDate>Tue, 24 Nov 2009 00:19:00 +0000</pubDate>
<dc:creator>jasonk2600</dc:creator>
<guid>http://jasonk2600.wordpress.com/2009/11/24/quickie-howto-cron-jobs-under-freebsd/</guid>
<description><![CDATA[Cron is a simple, but powerful utility used to automate repetitive tasks that do not require any use]]></description>
<content:encoded><![CDATA[Cron is a simple, but powerful utility used to automate repetitive tasks that do not require any use]]></content:encoded>
</item>
<item>
<title><![CDATA[FreeBSD ]]></title>
<link>http://dicon1973.wordpress.com/2009/11/23/freebsd/</link>
<pubDate>Mon, 23 Nov 2009 12:44:00 +0000</pubDate>
<dc:creator>di_con</dc:creator>
<guid>http://dicon1973.wordpress.com/2009/11/23/freebsd/</guid>
<description><![CDATA[FreeBSD &#8211; это современная операционная система для компьютеров, совместимых с архитектурами x8]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><strong>FreeBSD</strong> &#8211; это современная операционная система для компьютеров, совместимых с архитектурами x86 (в том числе Pentium® и Athlon™), amd64 (включая Opteron™, Athlon 64 и EM64T), Alpha/AXP, IA-64, PC-98 и UltraSPARC®. Она основана на BSD, версии UNIX®, созданной в Калифорнийском Университете в Беркли.<!--more--></p>
<p>Официальный сайт: www.freebsd.org<br />
Скачать: <a href="ftp://ftp15.us.freebsd.org/pub/FreeBSD/ISO-IMAGES-i386/8.0/">FreeBSD 8.0 Final</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[How to install dotProject 2.1.2 on FreeBSD 7.2 with Apache 2.2, PHP5, and MySQL 5.1 Server?]]></title>
<link>http://rhyous.com/2009/11/22/how-to-install-dotproject-2-1-2-on-freebsd-7-2-with-apache-2-2-php5-and-mysql-5-1-server/</link>
<pubDate>Mon, 23 Nov 2009 05:00:29 +0000</pubDate>
<dc:creator>rhyous</dc:creator>
<guid>http://rhyous.com/2009/11/22/how-to-install-dotproject-2-1-2-on-freebsd-7-2-with-apache-2-2-php5-and-mysql-5-1-server/</guid>
<description><![CDATA[How to install Bugzilla 3.4.2 on FreeBSD 7.2. The basic overview. Install FreeBSD. How do I install ]]></description>
<content:encoded><![CDATA[How to install Bugzilla 3.4.2 on FreeBSD 7.2. The basic overview. Install FreeBSD. How do I install ]]></content:encoded>
</item>
<item>
<title><![CDATA[Snort IDS Sensor on FreeBSD]]></title>
<link>http://jasonk2600.wordpress.com/2009/11/22/snort-ids-sensor-on-freebsd/</link>
<pubDate>Sun, 22 Nov 2009 23:54:00 +0000</pubDate>
<dc:creator>jasonk2600</dc:creator>
<guid>http://jasonk2600.wordpress.com/2009/11/22/snort-ids-sensor-on-freebsd/</guid>
<description><![CDATA[Installation This document assumes that a MySQL server has already been configured for Snort sensors]]></description>
<content:encoded><![CDATA[Installation This document assumes that a MySQL server has already been configured for Snort sensors]]></content:encoded>
</item>
<item>
<title><![CDATA[Quickie HowTo - Setting up a Rsync Server in FreeBSD]]></title>
<link>http://jasonk2600.wordpress.com/2009/11/22/quickie-howto-setting-up-a-rsync-server-in-freebsd/</link>
<pubDate>Sun, 22 Nov 2009 03:16:00 +0000</pubDate>
<dc:creator>jasonk2600</dc:creator>
<guid>http://jasonk2600.wordpress.com/2009/11/22/quickie-howto-setting-up-a-rsync-server-in-freebsd/</guid>
<description><![CDATA[Installation &#8211; Server Install the Rsync server from the ports collection. # cd /usr/ports/net/]]></description>
<content:encoded><![CDATA[Installation &#8211; Server Install the Rsync server from the ports collection. # cd /usr/ports/net/]]></content:encoded>
</item>
<item>
<title><![CDATA[Network Traffic Monitoring with nTop]]></title>
<link>http://jasonk2600.wordpress.com/2009/11/21/network-traffic-monitoring-with-ntop/</link>
<pubDate>Sat, 21 Nov 2009 18:03:00 +0000</pubDate>
<dc:creator>jasonk2600</dc:creator>
<guid>http://jasonk2600.wordpress.com/2009/11/21/network-traffic-monitoring-with-ntop/</guid>
<description><![CDATA[Installation Configure and install nTop from the ports collection.&#160; NOTE:&#160; Be sure to acti]]></description>
<content:encoded><![CDATA[Installation Configure and install nTop from the ports collection.&#160; NOTE:&#160; Be sure to acti]]></content:encoded>
</item>
<item>
<title><![CDATA[FreeBSD 8.0-RC3 on IBM x3850 M2]]></title>
<link>http://chiouss0817.wordpress.com/2009/11/21/freebsd-8-0-rc3-on-ibm-x3850-m2/</link>
<pubDate>Sat, 21 Nov 2009 07:08:28 +0000</pubDate>
<dc:creator>Maverick</dc:creator>
<guid>http://chiouss0817.wordpress.com/2009/11/21/freebsd-8-0-rc3-on-ibm-x3850-m2/</guid>
<description><![CDATA[因為工作的關係，昨天在公司的一台 IBM x3850 M2 上面安裝 FreeBSD，一共試了兩個版本 (6.4 &amp; 8.0-RC3)，都是 amd64 的。6.4 的光碟放進去跑到 load]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>因為工作的關係，昨天在公司的一台 <a href="http://www-03.ibm.com/systems/x/hardware/enterprise/x3850m2/index.html">IBM x3850 M2</a> 上面安裝 FreeBSD，一共試了兩個版本 (6.4 &#38; 8.0-RC3)，都是 amd64 的。6.4 的光碟放進去跑到 loader 就當住不動了，8.0-RC3 的就很順利地裝完，並且正常使用 (直到我自己亂搞的 kernel 把機器弄到開不起來為止)。<br />
<!--more--><br />
硬體的部分應該都有抓到而且可以正常使用，包括 Xeon E7320*2 (可以一共看到 8 顆 CPU)、8G 的 RAM、還有 ServeRAID-MR10k 上面接的 73G 10k SAS HDD (mfi)、兩個 Broadcom GbE 網路 (bce)。裝完之後有徵求過鄉民的意見，跑了一次 <code>make -j64 buildworld</code>，大概花了 25 分鐘。之後就因為我自己編的 kernel 有問題，重開之後掛在路上，等著我星期一進公司再處理 :Q</p>
<p>值得一提的是，mfi 的 driver 還會提醒我 RAID card 電池的狀態，公司這台機器的 RAID card BBU 似乎有點問題，常常顯示電池需要更換或是充電中的訊息。</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Quickie HowTo &ndash; RAID 0 on FreeBSD]]></title>
<link>http://jasonk2600.wordpress.com/2009/11/18/quickie-howto-raid-0-on-freebsd/</link>
<pubDate>Wed, 18 Nov 2009 22:26:00 +0000</pubDate>
<dc:creator>jasonk2600</dc:creator>
<guid>http://jasonk2600.wordpress.com/2009/11/18/quickie-howto-raid-0-on-freebsd/</guid>
<description><![CDATA[Configure The Kernel First, add the ccd device to your kernel configuration. device ccd Recompile, i]]></description>
<content:encoded><![CDATA[Configure The Kernel First, add the ccd device to your kernel configuration. device ccd Recompile, i]]></content:encoded>
</item>
<item>
<title><![CDATA[Existem vírus para Linux?]]></title>
<link>http://almalivre.wordpress.com/2009/11/18/existem-virus-para-linux/</link>
<pubDate>Wed, 18 Nov 2009 22:03:19 +0000</pubDate>
<dc:creator>stellarium</dc:creator>
<guid>http://almalivre.wordpress.com/2009/11/18/existem-virus-para-linux/</guid>
<description><![CDATA[Há uma certa tendência de muitos acreditarem que não existem vírus para sistemas operacionais aberto]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><img class="alignleft size-full wp-image-845" title="tux" src="http://almalivre.wordpress.com/files/2009/11/tux.jpeg" alt="" width="127" height="150" />Há uma certa tendência de muitos acreditarem que não existem vírus para sistemas operacionais abertos, como o GNU/Linux. Isso não é uma verdade absoluta. Na verdade, existem cerca de 1000 vírus conhecidos vírus para GNU/Linux (contra cerca de 6 milhões &#8211; e subindo &#8211; deles para os sistemas janelas), incluídos aí os rootkits, worms e scripts para invasão.</p>
<p>E isso é motivo para alarmes? Na verdade, não. Uma questão relevante sobre a existência de malwares é o impacto que tais programas têm no sistema infectado. Os vírus são desenvolvidos para explorar falhas de segurança dos sistemas. Descobrir falhas de segurança em sistemas proprietários é um pouco mais difícil do que em sistemas abertos, porque, no primeiro, o cracker precisa fazer uma engenharia reversa para &#8220;recuperar&#8221; o código fonte. No segundo, o código fonte está disponível para qualquer pessoa.</p>
<h3><!--more-->Auditoria de código.</h3>
<p>O que parece uma desvantagem para o sistema aberto, na verdade, é uma absurda vantagem. Enquanto que, nos sistemas fechados, o cracker faz a engenharia reversa, ou outros métodos, descobre as falhas e cria maneiras de explorá-las para, somente depois, o vírus ser descoberto pelos pesquisadores e empresas de segurança, e medidas sejam tomadas para, primeiro, contornar (antivírus), e depois corrigir a falha (correções e atualizações), nos sistemas abertos, o código é auditado constantemente por milhares de desenvolvedores voluntários ao redor do mundo. Isso permite que as falhas sejam descobertas e corrigidas com mais rapidez. O mesmo trabalho que um cracker teria de fazer para descobri-las, já é feito diariamente por muitas pessoas. Além de descobrir um código defeituoso, ele teria de procurar se esse defeito já não está documentado, pois se estiver, a correção estará na próxima atualização, com certeza. Nos sistemas fechados, a velocidade de pesquisa dos códigos e de correção é absurdamente maior, o que significa que, mesmo que a falha seja descoberta, não significa que será corrigida imediatamente. Isso expõe o sistema a ataques que a explorem.</p>
<p>Isso também significa que, nos sistemas abertos, os crackers estão no mesmo passo dos desenvolvedores, ou um passo atrás, mas estão sempre um ou dois passos à frente nos sistemas proprietários.</p>
<h3>Atualizações e correções.</h3>
<p>As atualizações de segurança em sistemas abertos é feita da mesma forma que em sistemas fechados, ou seja, através do download de correções, ou de versões novas do software com defeito. Ocorre que, nos sistemas proprietários, temos uma fragmentação das fontes de software, ou seja, são vários fornecedores diferentes, trabalhando de maneira independente, nem sempre coordenada e, por vezes, concorrentes. Isso causa problemas do tipo ocorrido recentemente, em que uma correção de segurança do Internet Explorer, lançada pela M$, abriu brechas de segurança no Navegador Mozilla Firefox para janelas. Além disso, as correções são feitas independentemente, ou seja, cada um é responsável pelo seu pedaço: o antivírus, o sistema operacional, o pacote de escritório, o navegador, o cliente de <em>email</em>, o pacote gráfico, os jogos, o <em>firewall</em>, etc.</p>
<p>Nos sistemas abertos, isso é bastante minimizado, já que todas as atualizações são disponibilizadas nos repositórios oficiais. Também são automáticas, mas estão todas agrupadas e podem ser feitas de uma vez. Há coordenação entre as equipes de desenvolvimento através do responsável pela distribuição. Programas &#8220;não oficiais&#8221; podem ser instalados e ter sua atualização feita em separado, mas são poucos os casos, já que cada distribuição já inclui tudo, ou quase tudo, que é necessário para a maior parte das pessoas.</p>
<h3>Exposição a ataques.</h3>
<p>Há um mito que diz que apenas existem mais vírus para janelas porque o GNU/Linux é bem menos utilizado. Ou seja, o janelas é mais visado.</p>
<p>Isso é uma meia verdade. Se fosse possível comprovar essa afirmação, poderíamos supor seria proporcional a disponibilidade de <em>malwares</em> para os dois sistemas. Recentemente, foi publicada uma <a title="Market Share" href="http://marketshare.hitslink.com/report.aspx?qprid=8" target="_blank">matéria sobre a taxa de penetração de cada um dos sistemas operacionais</a>. O janelas (em todas as suas versões) ficou com aproximadamente 90%, O GNU/Linux com 1%, e o Sistema da Maçã com cerca de 5%. Seria, portanto, lógico supor que dos milhões de vírus conhecidos, a proporção fosse semelhante, mas não é o que acontece. Os vírus para GNU/Linux respondem por cerca de 0,16% do total de vírus conhecidos, número semelhante aos do Sistema da Maçã, sistema proprietário cujo desenvolvimento foi baseado em Unix.</p>
<p>Dos vírus conhecidos para Sistema da Maçã e GNU/Linux, não se comprovou que algum deles causasse transtornos semelhantes aos causados pelos que atingem o janelas. Além disso, a forma de considerar a segurança em sistemas Unix-like, como o GNU/Linux e o Sistema da Maçã, é completamente diferente e bem mais aprimorada. Numa instalação padrão, a exposição a ataques desses sistemas é consideravelmente menor. O que significa que se você pegar um CD e instalar uma distribuição qualquer do GNU/Linux em um computador conectado diretamente à Internet, a possibilidade de invasão é quase nula. O mesmo computador com uma instalação padrão do sistema janelas XP tem um tempo médio e resistência de 90 segundos. Ou seja, se você formatar a sua máquina e instalar o janelas XP nela, se ela estiver na Internet, você tem, em média,  90 segundos para instalar todas as atualizações de segurança, antivírus, <em>antispyware</em>, <em>firewall</em>, etc., o que é virtualmente impossível para qualquer &#8220;usuário comum&#8221;.</p>
<p>O janelas, ao contrário dos sistemas <em>Unix-like</em>, não foi originalmente concebido para trabalhar em rede. A demanda pela conectividade, na época do DOS+janelas 3.1, fez com que a M$ lançasse a versão 3.11 do janelas, com recursos de rede. A empresa tentou impor seu protocolo NetBeui como padrão para as redes locais, mas não conseguiu porque o TCP/IP já estava bem consolidado, e era utilizado na Internet restrita da época. Durante algum tempo, as redes locais não eram conectadas à Internet e trafegavam NetBeui. Quando começou a aparecer a necessidade de conectar essas redes à Internet, elas começaram a trafegar ambos os protocolos e, por fim, o NetBeui foi abandonado. As versões do janelas seguintes, não mudaram o conceito original. Hoje o janelas é altamente conectável, mas, como originalmente a segurança do sistema foi pensada para máquinas isoladas, quando muito conectadas em redes locais, por uma questão de compatibilidade com as versões anteriores e pelo custo de desenvolvimento, o conceito se propagou até os dias de hoje.</p>
<h3>Custos de desenvolvimento e estratégia de marketing.</h3>
<p>O custo de desenvolvimento de um sistema operacional completo pode chegar à casa de alguns bilhões de dólares. Por mais rica que uma empresa seja, um investimento desse tamanho é algo impraticável. Empresas como Petrobras, por exemplo, quando constroem uma refinaria de 2 ou 3 bilhões de dólares, invariavelmente procuram se associar a outras empresas e buscar financiamento de longo prazo em bancos, para o empreendimento. Vejam bem, uma refinaria pode ficar pronta em cerca de 2 ou 3 anos e tem um prazo de algumas dezenas de anos para pagar o financiamento e amortizar o investimento, além de dar lucro aos acionistas.</p>
<p>O que podemos dizer de um sistema operacional? Com a velocidade imposta para que uma versão de um sistema operacional proprietário seja substituído, seria necessário investir muitas centenas de milhões de dólares por ano no desenvolvimento de sistemas completamente novos para resolver o problema de segurança. Mas, a cada versão da família janelas, vemos as mesmas alegações de que o sistema novo é mais seguro que o antigo, fatos &#8220;comprovados&#8221; por pesquisas de cunho duvidoso e declarações de &#8220;especialistas&#8221; dos quais nunca se ouviu falar. O fato é que nunca se cria um sistema novo. Ela apenas se recicla códigos dos sistemas antigos, remodelando o velho para &#8220;criar o novo&#8221;, oferecendo um visual agradável para que o marketing atinja seus objetivos. É necessário que o ciclo seja curto para garantir os lucros altos. Portanto, não há tempo nem disponibilidade orçamentária, ou de financiamento, para a criação de um sistema novo, sem vícios herdados dos anteriores. Logo, o fato do janelas não ser um sistema seguro não se deve a uma questão de filosofia de código, mas a uma questão econômica. Se, mesmo com um sistema ruim, mantém-se a hegemonia do mercado, não há motivos econômicos para melhorar substancialmente o sistema, já que há quem o compre e o use sem grandes esforços de marketing. Além disso, existe uma &#8220;indústria da segurança&#8221; por trás disso. Além da M$, empresas como McAfee, Symantec, Trend Micro, entre outras, ganham fortunas oferecendo soluções paliativas para os problemas estruturais do janelas. Não espere que o janelas 7 seja muito melhor em termos de segurança do que seus antecessores, pois um sistema inseguro, mas hegemônico, é tudo o que a M$ e dezenas de empresas de segurança precisam para manter os acionistas felizes, e os usuários iludidos, mas igualmente felizes.</p>
<p><a title="BR-Linux" href="http://br-linux.org/noticias/003576.html" target="_blank">Os custos de desenvolvimento do kernel do Linux foi estimado em cerca de 614 milhões de dólares</a>, e o de uma <a title="Infosucata" href="http://infosucata.blogspot.com/2008/11/estimando-os-custos-totais-do.html" target="_blank">distribuição GNU/Linux típica em 1,2 bilhões de dólares</a>. Esse capital não é investido por uma única empresa, mas diluído entre milhares (talvez milhões) de empresas e pessoas comuns ao redor do mundo, que contribuem com um pouco para que o sistema final chegue ao que se espera. Por isso é possível oferecer um sistema seguro a um preço irrisório. Não existe a preocupação com um ciclo de vida curto para garantir os lucros. Na verdade, a preocupação é exatamente oposta: ter um sistema estável e seguro para que se possa oferecer serviços constantes aos clientes. Sempre que uma versão nova do janelas é lançada, há uma demanda geral por novos treinamentos, novos equipamentos, novas &#8220;<em>expertises</em>&#8220;. No GNU/Linux, o ciclo é muito maior. Isso significa que quem usa uma versão 7.04 do Ubuntu, por exemplo, também usará uma versão 9.10, sem grandes dificuldades, porque na essência o sistema é o mesmo, mas as inovações se traduzem em mais compatibilidade, mais funcionalidades, mais segurança. Também não há grandes preocupações com a atualização do parque de máquinas porque a versão 9.10 rodará na maior parte das máquinas que rodavam a versão 7.04, por exemplo. Finalmente, não haverá a necessidade de uma urgente atualização do conhecimento dos técnicos de suporte, já que em essência, as mudanças são focadas na inovação, ou seja, não há mudança no conceito.</p>
<p>Aqui podemos ver uma situação curiosa: No sistema proprietário, não há mudança num conceito ruim que é perpetuado para que o &#8220;produto&#8221; continue a gerar lucros com mudanças &#8220;cosméticas&#8221;. Isso é bom para a empresa desenvolvedora, para as empresas de software incluídas no ecossistema. Não é tão bom para os técnicos porque precisam investir constantemente em treinamento, nem para os usuários que além do treinamento devem arcar com os custos do modelo (licenças de software diversas, treinamento constante, prejuízos decorrentes da insegurança do sistema, etc.). No sistema livre, o conceito originalmente bom, não tem a necessidade de ser modificado em profundidade, o que justifica mudanças que focam na inovação. Isso é bom para o ecossistema produtivo como um todo, já que diminui os custos tanto de desenvolvimento como o de treinamento de técnicos e usuários.</p>
<p>Como você pode observar, no sistema proprietário, a carga econômica fica com o consumidor final, bem como o ônus das deficiências do sistema. No sistema aberto, a carga é diluída entre todos e não há grandes ônus para nenhum dos envolvidos.</p>
<h3>A questão comportamental.</h3>
<p>Há uma tendência dos técnicos em afirmar que nenhum sistema é seguro, e que boa parte da segurança depende de quem o utiliza. Isso pode ser ou não uma verdade. Eu discordo de que isso seja uma verdade absoluta.</p>
<p>Partindo de uma instalação padrão, ou seja, uma que até seu sobrinho <em>nerd</em> poderia fazer, num sistema GNU/Linux é difícil para um &#8220;usuário padrão&#8221;, mesmo com comportamentos de risco, tornar o sistema vulnerável, a ponto de ser comparado aos sistemas janelas. Para fazer isso, ele teria de ter certos conhecimentos técnicos. Seria necessário habilitar o <em>login</em> automático do usuário <em>root</em> (o que por si só já é uma proeza), abrir todas as portas TCP e UDP fechadas por padrão (e para isso teria de instalar pacotes que não são instalados e/ou configurados por padrão), desabilitar o pedido de senha para ações consideradas &#8220;administrativas&#8221;, e/ou alterar os privilégios de usuário comum. Isso é bem mais do que um &#8220;usuário padrão&#8221; faria no janelas. No janelas, em uma instalação padrão, o administrador do sistema é quase que sugerido como usuário padrão. Um usuário não precisa se esforçar muito para abrir as poucas defesas existentes. Isso, aliado à insegurança inerente e aos comportamentos de risco (clicar em links suspeitos de <em>email</em>, entrar em sites de reputação duvidosa, instalar programas piratas de origem duvidosa, utilizar programas de downloads como bitorrent ou semelhantes, desabilitar a proteção por senhas do sistema para alterações no registro, não instalar atualizações, não saber como utilizar um antivirus, não usar o <em>firewall</em>, senhas pequenas e óbvias, etc.), tornam o janelas um verdadeiro problema para que o usa e uma ótima oportunidade para quem quer invadi-lo.</p>
<h3>A falácia dos antivírus.</h3>
<p>A maior ilusão de um usuário do janelas é pensar que um antivírus o salvará das pragas da Internet. Para se beneficiar da proteção oferecida pelos antivírus, são necessárias três condições adicionais:</p>
<ul>
<li>Conhecimento técnico para sua correta configuração, atualização e utilização (o que muito poucos detém);</li>
<li>Utilização de softwares complementares como firewall e antispyware (o que também exige conhecimento técnico);</li>
<li>Comportamentos seguros na utilização da Internet (o que exige treinamento e capacitação).</li>
</ul>
<p>Se qualquer um dos três requisitos não for atendido, todo o resto será comprometido, ou seja, as várias centenas de reais gastos com toda essa parafernália será, literalmente, inútil.</p>
<p>As empresas de segurança há anos fingem que são capazes de oferecer proteção para seus clientes, mas têm absoluta certeza de que isso é uma batalha perdida, portanto, a única razão para continuarem a oferecer &#8220;soluções de segurança&#8221; é a existência de uma massa enorme de pessoas que as compram acreditando que elas tornarão seu sistema seguro. <em>They don&#8217;t give a damn, they just want the money.</em></p>
<p>Recentemente, Eva Chen, uma das fundadoras da Trend Micro, <a title="Channel Register" href="http://www.channelregister.co.uk/2008/06/22/trend_micro_eva_chen/" target="_blank">concedeu uma entrevista</a> onde afirma que os <em>crackers</em> estão na dianteira e que a indústria de antivírus é uma piada (de mal gosto). Portanto, se nem eles acreditam que poderão ganhar o jogo, porque você, que é o elo mais fraco, se arriscaria a bancá-lo?</p>
<h3>Conclusão.</h3>
<p>Existem vírus para Linux? Sim, existem mas, na prática, são completamente irrelevantes, pois não só é difícil de encontrá-los, como seu impacto é irrisório.</p>
<p>Se você não acredita que é possível existir um sistema seguro que dificulta ao máximo a infecção por vírus, o uso não autorizado da sua máquina, seja por <em>crackers</em>, seja por &#8220;empresas idôneas&#8221;, e que tira das suas costas grande parte da responsabilidade sobre a segurança dos seus dados e arquivos, deveria experimentar o GNU/Linux ou outro sistema aberto, como o FreeBSD. Não se trata de militância ideológica a favor de sistemas livres. Trata-se de resguardar o que é seu, seu patrimônio, sua privacidade e sua liberdade. É uma questão prática, não filosófica.</p>
<p>Porque pagar, ou usar ilegalmente um sistema que, notoriamente, é problemático e o expõe a riscos, os quais você nem mesmo dá conta da existência, nem tem condições de se proteger, se é possível ter um sistema seguro e gratuito?</p>
<p>Por que pagar por softwares &#8220;tapa buraco&#8221;, como os antivírus, que tapam o sol como uma peneira, se é possível ter um sistema que não necessita desses paliativos?</p>
<p><span style="color:#ff0000;"><strong>Pense bem sobre isso. E depois considere usar uma distribuição GNU/Linux.</strong></span></p>
<div id="_mcePaste" style="overflow:hidden;position:absolute;left:-10000px;top:1737px;width:1px;height:1px;">sse capital não é investido por uma única empresa, mas diluído entre milhares (talvez milhões) de empresas e pessoas comuns ao redor do mundo, que contribuem com um pouco para que o sistema final chegue ao que se espera. Por isso é possível oferecer um sistema seguro a um preço irrisório. Não existe a preocupação com um ciclo de vida curto para garantir os lucros. Na verdade, a preocupação é exatamente oposta: ter um sistema estável e seguro para que se possa oferecer serviços constantes aos clientes. Sempre que uma versão nova do janelas é lançada, há uma demanda geral por novos treinamentos, novos equipamentos, novas &#8220;expertises&#8221;. No Linux, o ciclo é muito maior. Isso significa que quem usa uma versão 7.04 do Ubuntu, por exemplo, também usará uma versão 9.10, sem grandes dificuldades, porque na essência o sistema é o mesmo, mas com grandes melhorias em termos de automação de tarefas. Também não há grandes preocupações com a atualização do parque de máquinas porque a versão 9.10 rodará na maior parte das máquinas que rodavam a versão 7.04, por exemplo. Finalmente, não haverá a necessidade de uma urgente atualização do conhecimento dos técnicos de suporte, já que em essência, as mudanças são focadas na inovação, ou seja, não há mudança no conceito, quase que apenas na aparência e em novas funcionalidades.Aqui podemos ver uma situação curiosa: No sistema proprietário, não há mudança num conceito ruim que é perpetuado para que o &#8220;produto&#8221; continue a gerar lucros com mudanças &#8220;cosméticas&#8221;. Isso é bom para a empresa desenvolvedora, para as empresas de software incluídas no ecossistema. Não é tão bom para os técnicos porque precisam investir constantemente em treinamento, nem para os usuários que além do treinamento devem arcar com os custos do modelo (licenças de software diversas, treinamento constante, prejuízos decorrentes da insegurança do sistema, etc.). No sistema livre, o conceito originalmente bom, não tem a necessidade de ser modificado em profundidade, o que justifica mudanças que focam na inovação. Isso é bom para o ecossistema produtivo como um todo, já que diminui os custos tanto de desenvolvimento como o de treinamento de técnicos e usuários.</p>
<p>Como você pode observar, no sistema proprietário, a carga econômica fica com o consumidor final, bem como o ônus das deficiências do sistema. No sistema aberto, a carga é diluída entre todos e não há grandes ônus para nenhum dos envolvidos.</p>
</div>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Be Careful With SHELL=/usr/local/bin/bash]]></title>
<link>http://keramida.wordpress.com/2009/11/18/be-careful-with-bash/</link>
<pubDate>Wed, 18 Nov 2009 08:38:15 +0000</pubDate>
<dc:creator>keramida</dc:creator>
<guid>http://keramida.wordpress.com/2009/11/18/be-careful-with-bash/</guid>
<description><![CDATA[One of the things I often do on FreeBSD machines is to install shells/mksh or shells/bash and work m]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>One of the things I often do on FreeBSD machines is to install <code>shells/mksh</code> or <code>shells/bash</code> and work most of the time with a bourne-compatible shell.</p>
<p>The default <code>/bin/csh</code> shell is mostly ok for short interactive sessions, but I can&#8217;t stand its command-syntax for semi-complex looping, iteration or other combined commands.  So  install <em>bash</em> or <em>mksh</em> and I launch one of them from my login prompt, using something like:</p>
<pre>csh# env SHELL=/usr/local/bin/bash /usr/local/bin/bash -l
bash# </pre>
<p>There&#8217;s a minor catch with <code>SHELL</code> being set to <code>/usr/local/bin/bash</code> though.  The default binary of bash is dynamically linked, and it depends on <code>libintl.so.XXX</code> from the <code>devel/gettext</code> package.  This means that if you happen to run a package update command that rebuilds <code>gettext</code> from source, there is a small period between the time the old <code>gettext</code> is uninstalled and the new version is installed that the following are all true:</p>
<ul>
<li>Your current <code>SHELL</code> points to <em>bash</em></li>
<li>The <em>bash</em> binary needs <code>libintl.so.XXX</code> to run, so it (temporarily) fails with a runtime linker error</li>
<li>The &#8220;<code>configure</code>&#8221; script of the <code>gettext</code> sources thinks that configure-time checks can use your current <code>SHELL</code></li>
<li>Boom!&#8230;</li>
</ul>
<p>So you cannot upgrade <code>gettext</code>, and your current shell needs it to run.  Any other packages that depend on <code>gettext</code> cannot be upgraded either.  Not a very nice corner to paint yourself into&#8230;</p>
<p>There are, however, at least three options to recover from a mess like this:</p>
<ol>
<li>Run a shell that is statically linked version of <em>bash</em>.  The <code>shells/bash</code> port of FreeBSD can build a statically linked version of the shell when <code>WITH_STATIC_BASH</code> is set at build-time.</li>
<li>Use <code>/bin/csh</code> or <code>shells/mksh</code> as a temporary shell to reinstall the broken packages, e.g. <code>gettext</code> and any other package that depends on it.</li>
<li>Set <code>CONFIG_SHELL</code> to a shell that works even without <code>gettext</code> (the <code>/bin/sh</code> shell of FreeBSD should work fine for this), or to one that has minimal library dependencies (the <code>/usr/local/bin/mksh</code> shell only depends on <code>libc.so.X</code> on FreeBSD, so it should work fine too).</li>
</ol>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[MacPorts Kicks Ass]]></title>
<link>http://ranguvar.wordpress.com/2009/11/17/macports-kicks-ass/</link>
<pubDate>Wed, 18 Nov 2009 03:02:20 +0000</pubDate>
<dc:creator>Ranguvar</dc:creator>
<guid>http://ranguvar.wordpress.com/2009/11/17/macports-kicks-ass/</guid>
<description><![CDATA[Lately, I&#8217;ve been playing around with Mac OS X Snow Leopard in a virtual machine.  Hey, you ha]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Lately, I&#8217;ve been playing around with Mac OS X Snow Leopard in a virtual machine.  Hey, you have to try it before you diss it! <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>I&#8217;ll save my overall review for later, but I just wanted to get this out to everyone: MacPorts?  It&#8217;s no hack.  In fact, it can rival or beat most major ports implementations.</p>
<p>For those of you who don&#8217;t know what I&#8217;m talking about in terms of &#8216;ports&#8217;, it&#8217;s a generic name for a system that allows a user to rapidly download and install software from source.</p>
<p>While I originally thought MacPorts would be very hackish, at least compared to FreeBSD ports or even Gentoo&#8217;s Portage, the opposite may be true.  MacPorts is slick, smooth, reliable, has a very well chosen set of shell commands and options, and is in general excellent in nearly every way.  It excels at the one problem I&#8217;ve always had with ports systems &#8212; it is very hard to think out every angle for such a system, but MacPorts seems to do so almost completely.  So, everyone interested in making their own ports system?  Go try MacPorts, and learn from its awesomeness.</p>
<p>More info when I do a full OS X review!</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Snapshots en UFS de FreeBSD]]></title>
<link>http://pedorro.wordpress.com/2009/11/17/snapshots-en-ufs-de-freebsd/</link>
<pubDate>Wed, 18 Nov 2009 02:38:27 +0000</pubDate>
<dc:creator>ignacio</dc:creator>
<guid>http://pedorro.wordpress.com/2009/11/17/snapshots-en-ufs-de-freebsd/</guid>
<description><![CDATA[Hace unos días descubrí los snapshots para filesystems UFS(2) de FreeBSD (lo se, lo se, soy un desas]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Hace unos días descubrí los <a href="http://people.freebsd.org/~rse/snapshot/">snapshots </a>para filesystems UFS(2) de <a href="http://freebsd.org">FreeBSD </a>(lo se, lo se, soy un desastre) y si bien se implementa también para ZFS le di caña a los snapshots para UFS (default de FreeBSD).<br />
Para probarlo, lo que hice fue crear y montar una imagen en un archivo (dd, mkfs, mdconfig, etc&#8230;) quedando algo así:</p>
<pre class="brush: bash;">
/home/ignacio $ mount &#124; grep md0
/dev/md0 on /usr/home/ignacio/md0 (ufs, local)
</pre>
<p>Lo primero que hay que hacer, es notar la existencia del directorio .snap dentro de la recién montada imagen. Es en la raíz de cada partición UFS es donde está el directorio .snap.<br />
Yo lo que hice fue instalar el frontend <a href="http://people.freebsd.org/~rse/snapshot/snapshot.8.html">snapshot(8) </a>mediante su port <em>sysutils/freebsd-snapshot</em>.</p>
<p>En la página citada, donde Ralf S. Engelschall explica la motivación y la forma de uso la verdad que está muy buena y simple.<br />
Básicamente el comando snapshot, consta de cuatro acciones básicas: list, make, mount y umount.</p>
<p>Con snapshot list podemos ver la lista completa de los snapshots creados para alguna partición, en este caso, aún no hemos creado ninguno por lo que el listado, estará vacío:</p>
<pre class="brush: bash;">
/home/ignacio $ snapshot list /home/ignacio/md0
Filesystem          User   User%     Snap   Snap%  Snapshot
</pre>
<p>Vemos el listado actual del directorio actual:</p>
<pre class="brush: bash;">/home/ignacio $ cd md0
/home/ignacio/md0 $ ls -l
drwxrwxr-x  2 root  operator      512 Nov 17 14:06 .snap
-rw-r--r--  1 root  wheel          12 Nov 10 16:23 ignacio
-rw-r--r--  1 root  wheel     1048576 Nov 10 17:37 test_file.txt
</pre>
<p>y creamos nuestro primer snapshot:</p>
<pre class="brush: bash;">
/home/ignacio/md0 $ snapshot make -g4 /home/ignacio/md0:snaps
</pre>
<p>Donde, -g4 indica que guardaremos 4 generaciones (cuatro vistas al <em>pasado</em>), /home/ignacio/md0 es (donde está montada) la partición y snaps es un tag que le asignamos.</p>
<p>Tiremos ahora un nuevo list:</p>
<pre class="brush: bash;">
/home/ignacio $ snapshot list /home/ignacio/md0
Filesystem          User   User%     Snap   Snap%  Snapshot
/home/ignacio/md0      2MB    2.9%    224KB    0.2%  snaps.0
</pre>
<p>Para jugar un poco borramos el archivo test_file.txt por error y ahora, para salvar el día, recuperamos el snapshot que creamos:</p>
<pre class="brush: bash;">
/home/ignacio/md0 $ ls -l
total 4
drwxrwxr-x  2 root  operator  512 Nov 17 14:09 .snap
-rw-r--r--  1 root  wheel      12 Nov 10 16:23 ignacio
/home/ignacio/md0 $
</pre>
<p>Para recuperar el snapshot debemos montarlo indicando que generación queremos recuperar, en nuestro caso, la 0:</p>
<pre class="brush: bash;">
/home/ignacio $ snapshot mount /home/ignacio/md0:snaps.0 /mnt
WARNING: opening backing store: /usr/home/ignacio/md0/.snap/snaps.0 readonly
</pre>
<p>Buscamos en el /mnt los archivos:</p>
<pre class="brush: bash;">
/home/ignacio $ cd /mnt
/mnt $ ls
.snap           ignacio         test_file.txt
/mnt $
</pre>
<p>Devolvemos test_file.txt a la normalidad:</p>
<pre class="brush: bash;">
/mnt $ cp -v test_file.txt /home/ignacio/md0
test_file.txt -&#62; /home/ignacio/md0/test_file.txt
/ $ snapshot umount /mnt
/ $ cd /home/ignacio/md0
/home/ignacio/md0 $ ls -l
total 1044
drwxrwxr-x  2 root  operator      512 Nov 17 14:09 .snap
-rw-r--r--  1 root  wheel          12 Nov 10 16:23 ignacio
-rw-r--r--  1 root  wheel     1048576 Nov 17 14:14 test_file.txt
</pre>
<p>Con lo de arriba, copiamos el archivo que habiamos perdido por error, desmontamos el snapshot y verificamos como quedó nuestra partición.</p>
<p>En fin, terrible herramienta! Es recomendado revisar además la man page <a href="http://people.freebsd.org/~rse/snapshot/periodic-snapshot.8.html">periodic-snapshot(8)</a> para hacer snapshots periodicos usando el cron y periodic.</p>
<p>Estoy comenzando a ser un usuario feliz de este tipo de filesystems. Claro que ya tengo configurado el cron para que genere los snapshots de manera automatizada para todas las particiones de mi disco y también espero jamás en mi vida necesitarlos.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[мониторинг работы с диском]]></title>
<link>http://mschedrin.wordpress.com/2009/11/18/%d0%bc%d0%be%d0%bd%d0%b8%d1%82%d0%be%d1%80%d0%b8%d0%bd%d0%b3-%d1%80%d0%b0%d0%b1%d0%be%d1%82%d1%8b-%d1%81-%d0%b4%d0%b8%d1%81%d0%ba%d0%be%d0%bc/</link>
<pubDate>Tue, 17 Nov 2009 23:03:20 +0000</pubDate>
<dc:creator>mschedrin</dc:creator>
<guid>http://mschedrin.wordpress.com/2009/11/18/%d0%bc%d0%be%d0%bd%d0%b8%d1%82%d0%be%d1%80%d0%b8%d0%bd%d0%b3-%d1%80%d0%b0%d0%b1%d0%be%d1%82%d1%8b-%d1%81-%d0%b4%d0%b8%d1%81%d0%ba%d0%be%d0%bc/</guid>
<description><![CDATA[Вот полезные утилиты для мониторинга работы системы и поцессов с жесткими дисками: gstat top -m io -]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Вот полезные утилиты для мониторинга работы системы и поцессов с жесткими дисками:<br />
gstat<br />
top -m io -o total<br />
lsof</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Sistem Yöneticileri için Değerli Bilgiler]]></title>
<link>http://ringotr.wordpress.com/2009/11/17/sistem-yoneticileri-icin-degerli-bilgiler/</link>
<pubDate>Tue, 17 Nov 2009 22:59:10 +0000</pubDate>
<dc:creator>ringotr</dc:creator>
<guid>http://ringotr.wordpress.com/2009/11/17/sistem-yoneticileri-icin-degerli-bilgiler/</guid>
<description><![CDATA[Sistem Yöneticileri için yeni bir ipucu bloğu kuruldu. Sistem Yöneticisi olmak istiyorsanız gözatmak]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Sistem Yöneticileri için yeni bir ipucu bloğu kuruldu. Sistem Yöneticisi olmak istiyorsanız gözatmakta fayda var. Zaman ilerledikçe bloğun içeriğinin zenginleşeceğini dolayısıylada kendisininde kalkınacağını düşünüyorum.</p>
<p>Link : <a href="http://sistemipucu.blogspot.com/">http://sistemipucu.blogspot.com/</a></p>
</div>]]></content:encoded>
</item>

</channel>
</rss>
