diff --git a/documentation/content/pt-br/articles/filtering-bridges/_index.adoc b/documentation/content/pt-br/articles/filtering-bridges/_index.adoc index a7e3faef87..672aa8049c 100644 --- a/documentation/content/pt-br/articles/filtering-bridges/_index.adoc +++ b/documentation/content/pt-br/articles/filtering-bridges/_index.adoc @@ -1,235 +1,235 @@ --- authors: - author: 'Alex Dupre' email: ale@FreeBSD.org description: 'Configurando firewalls e filtros em hosts FreeBSD que atuam como bridges em vez de roteadores' tags: ["network", "filtering", "bridges", "FreeBSD"] title: 'Pontes de Filtragem (Filtering Bridges)' trademarks: ["freebsd", "3com", "intel", "general"] --- = Pontes de Filtragem (Filtering Bridges) :doctype: article :toc: macro :toclevels: 1 :icons: font :sectnums: :sectnumlevels: 6 :source-highlighter: rouge :experimental: :images-path: articles/filtering-bridges/ ifdef::env-beastie[] ifdef::backend-html5[] include::shared/authors.adoc[] include::shared/mirrors.adoc[] include::shared/releases.adoc[] include::shared/attributes/attributes-{{% lang %}}.adoc[] include::shared/{{% lang %}}/teams.adoc[] include::shared/{{% lang %}}/mailing-lists.adoc[] include::shared/{{% lang %}}/urls.adoc[] :imagesdir: ../../../images/{images-path} endif::[] ifdef::backend-pdf,backend-epub3[] include::../../../../shared/asciidoctor.adoc[] endif::[] endif::[] ifndef::env-beastie[] include::../../../../../shared/asciidoctor.adoc[] endif::[] [.abstract-title] Resumo Muitas vezes é útil dividir uma rede física (como uma Ethernet) em dois segmentos separados sem precisar criar sub-redes e usar um roteador para conectá-los. O dispositivo que conecta as duas redes dessa forma é chamado de bridge. Um sistema FreeBSD com duas interfaces de rede é suficiente para atuar como uma ponte. Uma bridge funciona analisando os endereços de nível MAC (endereços Ethernet) dos dispositivos conectados a cada uma de suas interfaces de rede e, em seguida, encaminhando o tráfego entre as duas redes apenas se a origem e o destino estiverem em segmentos diferentes. Em muitos aspectos, um bridge é semelhante a um switch Ethernet com apenas duas portas. ''' toc::[] [[filtering-bridges-why]] == Por que usar uma ponte de filtragem? Cada vez mais frequentemente, graças à redução nos custos das conexões de banda larga à Internet (xDSL) e também devido à redução dos endereços IPv4 disponíveis, muitas empresas estão conectadas à Internet 24 horas por dia e com poucos (às vezes nem mesmo 2) endereços IP. Nestas situações, muitas vezes é desejável ter um firewall que filtre o tráfego de entrada e saída da Internet, mas uma solução de filtragem de pacotes baseada em roteador pode não ser aplicável, seja devido a problemas de sub-rede, o roteador pertence ao provedor de conectividade (ISP), ou porque não suporta tais funcionalidades. Nestes cenários, é altamente recomendável o uso de uma ponte de filtragem (filtering bridge). Um firewall baseado em bridge pode ser configurado e inserido entre o roteador xDSL e seu hub/switch Ethernet sem problemas de numeração IP. [[filtering-bridges-how]] == Como Instalar Adicionar funcionalidades de bridge a um sistema FreeBSD não é difícil. Desde a versão 4.5 é possível carregar tais funcionalidades como módulos ao invés de ter que reconstruir o kernel, simplificando bastante o procedimento. Nas subseções seguintes, explicarei as duas formas de instalação. [IMPORTANT] ==== _Não siga_ ambas as instruções: um procedimento _exclui_ o outro. Selecione a melhor opção de acordo com suas necessidades e habilidades. ==== Antes de continuar, certifique-se de ter pelo menos duas placas Ethernet que suportem o modo promíscuo tanto para recepção quanto para transmissão, uma vez que elas devem ser capazes de enviar pacotes Ethernet com qualquer endereço, não apenas o próprio. Além disso, para obter um bom desempenho, as placas devem ser placas de barramento PCI master. As melhores opções ainda são as placas Intel EtherExpress(TM) Pro, seguidas pela série 3Com(R) 3c9xx. Para simplificar a configuração do firewall, pode ser útil ter duas placas de fabricantes diferentes (usando drivers diferentes) para distinguir claramente qual interface está conectada ao roteador e qual está na rede interna. [[filtering-bridges-kernel]] === Configuração do Kernel Então você decidiu usar o método de instalação mais antigo, mas bem testado. Para começar, você precisa adicionar as seguintes linhas ao seu arquivo de configuração do kernel: [.programlisting] .... options BRIDGE options IPFIREWALL options IPFIREWALL_VERBOSE .... A primeira linha é para compilar o suporte à bridge, a segunda é para o firewall e a terceira é para as funções de registro do firewall. Agora é necessário compilar e instalar o novo kernel. Instruções detalhadas podem ser encontradas na seção extref:{handbook}[Compilação e Instalação de um Kernel Personalizado, kernelconfig-building] do FreeBSD Handbook. [[filtering-bridges-modules]] === Carregamento de Módulos Se você escolheu usar o novo e mais simples método de instalação, a única coisa a fazer agora é adicionar a seguinte linha ao [.filename]#/boot/loader.conf#: [.programlisting] .... bridge_load="YES" .... Dessa forma, durante a inicialização do sistema, o módulo [.filename]#bridge.ko# será carregado juntamente com o kernel. Não é necessário adicionar uma linha semelhante para o módulo [.filename]#ipfw.ko#, pois ele será carregado automaticamente após a execução das etapas na seção seguinte. [[filtering-bridges-finalprep]] == Preparação Final -Antes de reiniciar para carregar o novo kernel ou os módulos necessários (de acordo com o método de instalação escolhido anteriormente), você deve fazer algumas alterações no arquivo de configuração [.filename]#/etc/rc.conf#. A regra padrão do firewall é rejeitar todos os pacotes IP. Inicialmente, configuraremos um firewall `aberto`, a fim de verificar sua operação sem problemas relacionados à filtragem de pacotes (caso você esteja executando este procedimento remotamente, essa configuração evitará que você fique isolado da rede). Adicione estas linhas em [.filename]#/etc/rc.conf#: +Antes de reiniciar para carregar o novo kernel ou os módulos necessários (de acordo com o método de instalação escolhido anteriormente), você deve fazer algumas alterações no arquivo de configuração [.filename]#/etc/rc.conf#. A regra padrão do firewall é rejeitar todos os pacotes IP. Inicialmente, configuraremos um firewall `open`, para verificar sua operação sem problemas relacionados à filtragem de pacotes (caso você esteja executando este procedimento remotamente, essa configuração evitará que você fique isolado da rede). Adicione estas linhas em [.filename]#/etc/rc.conf#: [.programlisting] .... firewall_enable="YES" firewall_type="open" firewall_quiet="YES" firewall_logging="YES" .... A primeira linha ativará o firewall (e carregará o módulo [.filename]#ipfw.ko# caso não esteja compilado no kernel), a segunda configurará o firewall no modo `open` (conforme explicado em [.filename]#/etc/rc.firewall#), a terceira linha não exibirá o carregamento de regras e a quarta linha ativará o suporte a registro de logs. Sobre a configuração das interfaces de rede, o modo mais comum é atribuir um endereço IP a apenas uma das placas de rede, mas a ponte funcionará igualmente mesmo que ambas as interfaces ou nenhuma tenha um endereço IP configurado. No último caso (sem IP), a máquina da ponte ainda será mais oculta e inacessível pela rede: para configurá-la, é necessário fazer login pelo console ou por meio de uma terceira interface de rede separada da bridge. Às vezes, durante a inicialização do sistema, alguns programas exigem acesso à rede, por exemplo, para resolução de domínio: nesse caso, é necessário atribuir um endereço IP à interface externa (a que está conectada à Internet, onde o servidor DNS reside), pois a bridge será ativada no final do procedimento de inicialização. Isso significa que a interface [.filename]#fxp0# (no nosso caso) deve ser mencionada na seção ifconfig do arquivo [.filename]#/etc/rc.conf#, enquanto a [.filename]#xl0# não. Atribuir um endereço IP a ambas as placas de rede não faz muito sentido, a menos que, durante o procedimento de inicialização, aplicativos precisem acessar serviços em ambos os segmentos Ethernet. Uma outra coisa importante a se saber é que, ao executar IP sobre Ethernet, existem na verdade dois protocolos Ethernet em uso: um é o IP e o outro é o ARP. ARP faz a conversão do endereço IP de um host em seu endereço Ethernet (camada MAC). Para permitir a comunicação entre dois hosts separados pela bridge, é necessário que a bridge encaminhe pacotes ARP. Esse protocolo não está incluído na camada IP, uma vez que ele existe apenas com IP sobre Ethernet. O firewall do FreeBSD filtra exclusivamente na camada IP e, portanto, todos os pacotes não-IP (incluindo ARP) serão encaminhados sem serem filtrados, mesmo se o firewall estiver configurado para não permitir nada. Agora é hora de reiniciar o sistema e usá-lo como antes: haverá algumas novas mensagens sobre a bridge e o firewall, mas a bridge não será ativada e o firewall, estando no modo `aberto` , não evitará nenhuma operação. Se houver algum problema, você deve resolvê-los agora antes de prosseguir. [[filtering-bridges-enabling]] == Habilitando a Bridge Neste ponto, para habilitar a ponte, você tem que executar os seguintes comandos (tendo a perspicácia para substituir os nomes das duas interfaces de rede [.filename]#fxp0# e [.filename]#xl0# with your own ones) com as suas próprias): [source, shell] .... # sysctl net.link.ether.bridge.config=fxp0:0,xl0:0 # sysctl net.link.ether.bridge.ipfw=1 # sysctl net.link.ether.bridge.enable=1 .... A primeira linha especifica quais interfaces devem ser ativadas pela bridge, a segunda irá habilitar o firewall na bridge e, finalmente, a terceira irá habilitar a bridge. Neste ponto, você deverá ser capaz de inserir a máquina entre dois conjuntos de hosts sem comprometer as habilidades de comunicação entre eles. Se sim, o próximo passo é adicionar as partes `net.link.ether.bridge._[blah]_=_[blah]_` dessas linhas ao arquivo [.filename]#/etc/sysctl.conf#, para que elas sejam executadas na inicialização. [[filtering-bridges-ipfirewall]] == Configurando o Firewall -Agora é hora de criar seu próprio arquivo com regras personalizadas de firewall, a fim de proteger a rede interna. Haverá alguma complicação em fazer isso porque nem todas as funcionalidades do firewall estão disponíveis em pacotes encaminhados através de uma bridge. Além disso, há uma diferença entre os pacotes que estão em processo de encaminhamento e os pacotes que estão sendo recebidos pela máquina local. Em geral, os pacotes de entrada são filtrados apenas uma vez, não duas vezes como normalmente ocorre; de fato, eles são filtrados apenas no momento do recebimento, portanto, as regras que usam `out` ou `xmit` nunca darão match. Pessoalmente, eu uso `in via`, que é uma sintaxe mais antiga, mas que faz sentido quando você lê. Outra limitação é que você está restrito a usar apenas comandos `pass` ou `drop` para pacotes filtrados por uma ponte. Coisas sofisticadas como `divert`, `forward` ou `reject` não estão disponíveis. Tais opções ainda podem ser usadas, mas apenas no tráfego destinado ou originado na máquina que atua como bridge em si (se ela tiver um endereço IP). +Agora é hora de criar seu próprio arquivo com regras personalizadas de firewall, para proteger a rede interna. Haverá alguma complicação em fazer isso porque nem todas as funcionalidades do firewall estão disponíveis em pacotes encaminhados através de uma bridge. Além disso, há uma diferença entre os pacotes que estão em processo de encaminhamento e os pacotes que estão sendo recebidos pela máquina local. Em geral, os pacotes de entrada são filtrados apenas uma vez, não duas vezes como normalmente ocorre; de fato, eles são filtrados apenas no momento do recebimento, portanto, as regras que usam `out` ou `xmit` nunca darão match. Pessoalmente, eu uso `in via`, que é uma sintaxe mais antiga, mas que faz sentido quando você lê. Outra limitação é que você está restrito a usar apenas comandos `pass` ou `drop` para pacotes filtrados por uma ponte. Coisas sofisticadas como `divert`, `forward` ou `reject` não estão disponíveis. Tais opções ainda podem ser usadas, mas apenas no tráfego destinado ou originado na máquina que atua como bridge em si (se ela tiver um endereço IP). O conceito de filtragem stateful é novo no FreeBSD 4.0. Esta é uma grande melhoria para o tráfego UDP, que geralmente é uma solicitação que sai, seguida logo depois por uma resposta com o mesmo conjunto de endereços IP e portas (mas com origem e destino invertidos, é claro). Para firewalls que não têm o controle de estado, quase não há como lidar com esse tipo de tráfego como uma sessão única. Mas com um firewall que pode "lembrar" de um pacote UDP de saída e, nos próximos minutos, permitir uma resposta, lidar com serviços UDP é trivial. O exemplo a seguir mostra como fazer isso. É possível fazer a mesma coisa com pacotes TCP. Isso permite evitar alguns ataques de negação de serviço e outros truques desagradáveis, mas também faz com que a tabela de estado cresça rapidamente em tamanho. Vamos dar uma olhada em um exemplo de configuração. Note primeiro que no início de [.filename]#/etc/rc.firewall#, já existem regras padrão para a interface de loopback [.filename]#lo0#, então não precisamos mais nos preocupar com elas. As regras personalizadas devem ser colocadas em um arquivo separado (digamos [.filename]#/etc/rc.firewall.local#) e carregadas na inicialização do sistema, modificando a linha de [.filename]#/etc/rc.conf# onde definimos o firewall `open`: [.programlisting] .... firewall_type="/etc/rc.firewall.local" .... [IMPORTANT] ==== Você tem que especificar o _caminho completo_, caso contrário ele não será carregado com o risco de permanecer isolado da rede. ==== Para o nosso exemplo, imagine ter a interface [.filename]#fxp0# conectada ao exterior (Internet) e a [.filename]#xl0# ao interior (LAN). A máquina bridge tem o IP `1.2.3.4` (não é possível que o seu provedor de serviços de Internet possa lhe fornecer um endereço exatamente como este, mas para o nosso exemplo é suficiente). [.programlisting] .... # Things that we have kept state on before get to go through in a hurry add check-state # Throw away RFC 1918 networks add drop all from 10.0.0.0/8 to any in via fxp0 add drop all from 172.16.0.0/12 to any in via fxp0 add drop all from 192.168.0.0/16 to any in via fxp0 # Allow the bridge machine to say anything it wants # (if the machine is IP-less do not include these rows) add pass tcp from 1.2.3.4 to any setup keep-state add pass udp from 1.2.3.4 to any keep-state add pass ip from 1.2.3.4 to any # Allow the inside hosts to say anything they want add pass tcp from any to any in via xl0 setup keep-state add pass udp from any to any in via xl0 keep-state add pass ip from any to any in via xl0 # TCP section # Allow SSH add pass tcp from any to any 22 in via fxp0 setup keep-state # Allow SMTP only towards the mail server add pass tcp from any to relay 25 in via fxp0 setup keep-state # Allow zone transfers only by the secondary name server [dns2.nic.it] add pass tcp from 193.205.245.8 to ns 53 in via fxp0 setup keep-state # Pass ident probes. It is better than waiting for them to timeout add pass tcp from any to any 113 in via fxp0 setup keep-state # Pass the "quarantine" range add pass tcp from any to any 49152-65535 in via fxp0 setup keep-state # UDP section # Allow DNS only towards the name server add pass udp from any to ns 53 in via fxp0 keep-state # Pass the "quarantine" range add pass udp from any to any 49152-65535 in via fxp0 keep-state # ICMP section # Pass 'ping' add pass icmp from any to any icmptypes 8 keep-state # Pass error messages generated by 'traceroute' add pass icmp from any to any icmptypes 3 add pass icmp from any to any icmptypes 11 # Everything else is suspect add drop log all from any to any .... Aqueles que já configuraram firewalls antes podem notar que algumas coisas estão faltando. Em particular, não há regras anti-spoofing, na verdade, _não_ adicionamos: [.programlisting] .... add deny all from 1.2.3.4/8 to any in via fxp0 .... Isso significa descartar pacotes que estão chegando de fora e alegam ser da nossa rede. Isso é algo que normalmente se faz para garantir que alguém não tente evadir o filtro de pacotes, gerando pacotes maliciosos que parecem ser provenientes de dentro da rede. O problema é que há _pelo menos_ um host na interface externa que você não deseja ignorar: o roteador. Mas geralmente, o ISP faz o anti-spoofing em seu roteador, então não precisamos nos preocupar tanto com isso. A última regra parece ser uma duplicata exata da regra padrão, ou seja, não deixa passar nada que não seja especificamente permitido. Mas há uma diferença: todo tráfego suspeito será registrado. Existem duas regras para permitir o tráfego SMTP e DNS direcionado ao servidor de e-mail e servidor de nomes, se você tiver esses servidores. Obviamente, todo o conjunto de regras deve ser personalizado de acordo com as preferências pessoais, este é apenas um exemplo específico (o formato da regra é descrito com precisão na página do manual man:ipfw[8]). Observe que, para o "relay" e o "ns" funcionarem, as consultas ao serviço de nomes devem funcionar _antes_ de habilitar a ponte. Isto é um exemplo para garantir que você configure o IP no cartão de rede correto. Alternativamente, é possível especificar o endereço IP em vez do nome do host (obrigatório se a máquina não possuir um IP). Pessoas acostumadas a configurar firewalls provavelmente também estão acostumadas a ter uma regra de `reset` ou `forward` para pacotes ident (porta TCP 113). Infelizmente, essa não é uma opção aplicável com a bridge, então a melhor coisa a fazer é simplesmente passá-los para o destino. Contanto que a máquina de destino não esteja executando um ident daemon, isso é relativamente inofensivo. A alternativa é descartar conexões na porta 113, o que cria alguns problemas com serviços como IRC (a sondagem ident deve expirar). A única outra coisa um pouco estranha que você pode ter notado é que há uma regra para permitir que a máquina da bridge fale, e outra para os hosts internos. Lembre-se de que isso ocorre porque os dois conjuntos de tráfego seguirão caminhos diferentes através do kernel e do filtro de pacotes. A rede interna passará pela ponte, enquanto a máquina local usará o stack de IP normal para falar. Portando, existem duas regras para lidar com os casos diferentes. As regras `in via fxp0` funcionam para ambos os caminhos. Em geral, se você usar regras `in via` em todo o filtro, precisará fazer uma exceção para pacotes gerados localmente, porque eles não entraram por nenhuma de nossas interfaces. [[filtering-bridges-contributors]] == Colaboradores Muitas partes deste artigo foram retiradas, atualizadas e adaptadas de um antigo texto sobre bridges, editado por Nick Sayer. E um par de inspirações vieram de uma introdução sobre bridges de autoria de Steve Peterson. Um grande obrigado ao Luigi Rizzo pela implementação do código de ponte (bridge) no FreeBSD e pelo tempo que ele dedicou a mim respondendo a todas as minhas perguntas relacionadas. Agradeço também a Tom Rhodes, que olhou para o meu trabalho de tradução do italiano (a língua original deste artigo) para o inglês. diff --git a/documentation/content/pt-br/articles/filtering-bridges/_index.po b/documentation/content/pt-br/articles/filtering-bridges/_index.po index 360bf130d9..81c9a26f22 100644 --- a/documentation/content/pt-br/articles/filtering-bridges/_index.po +++ b/documentation/content/pt-br/articles/filtering-bridges/_index.po @@ -1,845 +1,842 @@ # SOME DESCRIPTIVE TITLE # Copyright (C) YEAR The FreeBSD Project # This file is distributed under the same license as the FreeBSD Documentation package. # Danilo G. Baio , 2021. # Edson Brandi , 2023. # "Danilo G. Baio" , 2023. msgid "" msgstr "" "Project-Id-Version: FreeBSD Documentation VERSION\n" -"POT-Creation-Date: 2022-02-01 09:21-0300\n" -"PO-Revision-Date: 2023-04-24 12:42+0000\n" +"POT-Creation-Date: 2023-05-21 14:43-0300\n" +"PO-Revision-Date: 2023-05-27 21:40+0000\n" "Last-Translator: Edson Brandi \n" "Language-Team: Portuguese (Brazil) \n" "Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" "X-Generator: Weblate 4.17\n" #. type: YAML Front Matter: description #: documentation/content/en/articles/filtering-bridges/_index.adoc:1 #, no-wrap msgid "Configuring firewalls and filtering on FreeBSD hosts acting as bridges rather than routers" -msgstr "" -"Configurando firewalls e filtros em hosts FreeBSD que atuam como bridges em " -"vez de roteadores" +msgstr "Configurando firewalls e filtros em hosts FreeBSD que atuam como bridges em vez de roteadores" #. type: Title = #: documentation/content/en/articles/filtering-bridges/_index.adoc:1 #: documentation/content/en/articles/filtering-bridges/_index.adoc:11 #, no-wrap msgid "Filtering Bridges" msgstr "Pontes de Filtragem (Filtering Bridges)" #. type: Plain text #: documentation/content/en/articles/filtering-bridges/_index.adoc:44 msgid "Abstract" msgstr "Resumo" #. type: Plain text #: documentation/content/en/articles/filtering-bridges/_index.adoc:48 msgid "" "Often it is useful to divide one physical network (like an Ethernet) into " "two separate segments without having to create subnets, and use a router to " "link them together. The device that connects the two networks in this way " "is called a bridge. A FreeBSD system with two network interfaces is enough " -"in order to act as a bridge." +"to act as a bridge." msgstr "" "Muitas vezes é útil dividir uma rede física (como uma Ethernet) em dois " "segmentos separados sem precisar criar sub-redes e usar um roteador para " "conectá-los. O dispositivo que conecta as duas redes dessa forma é chamado " "de bridge. Um sistema FreeBSD com duas interfaces de rede é suficiente para " "atuar como uma ponte." #. type: Plain text #: documentation/content/en/articles/filtering-bridges/_index.adoc:51 msgid "" "A bridge works by scanning the addresses of MAC level (Ethernet addresses) " "of the devices connected to each of its network interfaces and then " "forwarding the traffic between the two networks only if the source and the " "destination are on different segments. Under many points of view a bridge " "is similar to an Ethernet switch with only two ports." msgstr "" -"Uma bridge funciona analisando os endereços de nível MAC (endereços Ethernet)" -" dos dispositivos conectados a cada uma de suas interfaces de rede e, em " -"seguida, encaminhando o tráfego entre as duas redes apenas se a origem e o " -"destino estiverem em segmentos diferentes. Em muitos aspectos, um bridge é " -"semelhante a um switch Ethernet com apenas duas portas." +"Uma bridge funciona analisando os endereços de nível MAC (endereços " +"Ethernet) dos dispositivos conectados a cada uma de suas interfaces de rede " +"e, em seguida, encaminhando o tráfego entre as duas redes apenas se a origem " +"e o destino estiverem em segmentos diferentes. Em muitos aspectos, um bridge " +"é semelhante a um switch Ethernet com apenas duas portas." #. type: Plain text #: documentation/content/en/articles/filtering-bridges/_index.adoc:53 msgid "'''" msgstr "'''" #. type: Title == #: documentation/content/en/articles/filtering-bridges/_index.adoc:57 #, no-wrap msgid "Why use a filtering bridge?" msgstr "Por que usar uma ponte de filtragem?" #. type: Plain text #: documentation/content/en/articles/filtering-bridges/_index.adoc:62 msgid "" "More and more frequently, thanks to the lowering costs of broad band " "Internet connections (xDSL) and also because of the reduction of available " "IPv4 addresses, many companies are connected to the Internet 24 hours on 24 " "and with few (sometimes not even a power of 2) IP addresses. In these " "situations it is often desirable to have a firewall that filters incoming " "and outgoing traffic from and towards Internet, but a packet filtering " "solution based on router may not be applicable, either due to subnetting " "issues, the router is owned by the connectivity supplier (ISP), or because " "it does not support such functionalities. In these scenarios the use of a " "filtering bridge is highly advised." msgstr "" "Cada vez mais frequentemente, graças à redução nos custos das conexões de " "banda larga à Internet (xDSL) e também devido à redução dos endereços IPv4 " "disponíveis, muitas empresas estão conectadas à Internet 24 horas por dia e " "com poucos (às vezes nem mesmo 2) endereços IP. Nestas situações, muitas " "vezes é desejável ter um firewall que filtre o tráfego de entrada e saída da " "Internet, mas uma solução de filtragem de pacotes baseada em roteador pode " "não ser aplicável, seja devido a problemas de sub-rede, o roteador pertence " "ao provedor de conectividade (ISP), ou porque não suporta tais " "funcionalidades. Nestes cenários, é altamente recomendável o uso de uma " "ponte de filtragem (filtering bridge)." #. type: Plain text #: documentation/content/en/articles/filtering-bridges/_index.adoc:64 msgid "" "A bridge-based firewall can be configured and inserted between the xDSL " "router and your Ethernet hub/switch without any IP numbering issues." msgstr "" "Um firewall baseado em bridge pode ser configurado e inserido entre o " "roteador xDSL e seu hub/switch Ethernet sem problemas de numeração IP." #. type: Title == #: documentation/content/en/articles/filtering-bridges/_index.adoc:66 #, no-wrap msgid "How to Install" msgstr "Como Instalar" #. type: Plain text #: documentation/content/en/articles/filtering-bridges/_index.adoc:71 msgid "" "Adding bridge functionalities to a FreeBSD system is not difficult. Since " "4.5 release it is possible to load such functionalities as modules instead " "of having to rebuild the kernel, simplifying the procedure a great deal. In " "the following subsections I will explain both installation ways." msgstr "" "Adicionar funcionalidades de bridge a um sistema FreeBSD não é difícil. " "Desde a versão 4.5 é possível carregar tais funcionalidades como módulos ao " "invés de ter que reconstruir o kernel, simplificando bastante o " "procedimento. Nas subseções seguintes, explicarei as duas formas de " "instalação." #. type: delimited block = 4 #: documentation/content/en/articles/filtering-bridges/_index.adoc:76 msgid "" "_Do not_ follow both instructions: a procedure _excludes_ the other one. " "Select the best choice according to your needs and abilities." msgstr "" "_Não siga_ ambas as instruções: um procedimento _exclui_ o outro. Selecione " "a melhor opção de acordo com suas necessidades e habilidades." #. type: Plain text #: documentation/content/en/articles/filtering-bridges/_index.adoc:82 msgid "" "Before going on, be sure to have at least two Ethernet cards that support " "the promiscuous mode for both reception and transmission, since they must be " "able to send Ethernet packets with any address, not just their own. " "Moreover, to have a good throughput, the cards should be PCI bus mastering " "cards. The best choices are still the Intel EtherExpress(TM) Pro, followed " "by the 3Com(R) 3c9xx series. To simplify the firewall configuration it may " "be useful to have two cards of different manufacturers (using different " -"drivers) in order to distinguish clearly which interface is connected to the " -"router and which to the inner network." +"drivers) to distinguish clearly which interface is connected to the router " +"and which to the inner network." msgstr "" "Antes de continuar, certifique-se de ter pelo menos duas placas Ethernet que " "suportem o modo promíscuo tanto para recepção quanto para transmissão, uma " "vez que elas devem ser capazes de enviar pacotes Ethernet com qualquer " "endereço, não apenas o próprio. Além disso, para obter um bom desempenho, as " "placas devem ser placas de barramento PCI master. As melhores opções ainda " "são as placas Intel EtherExpress(TM) Pro, seguidas pela série 3Com(R) 3c9xx. " "Para simplificar a configuração do firewall, pode ser útil ter duas placas " "de fabricantes diferentes (usando drivers diferentes) para distinguir " "claramente qual interface está conectada ao roteador e qual está na rede " "interna." #. type: Title === #: documentation/content/en/articles/filtering-bridges/_index.adoc:84 #, no-wrap msgid "Kernel Configuration" msgstr "Configuração do Kernel" #. type: Plain text #: documentation/content/en/articles/filtering-bridges/_index.adoc:88 msgid "" "So you have decided to use the older but well tested installation method. " "To begin, you have to add the following rows to your kernel configuration " "file:" msgstr "" "Então você decidiu usar o método de instalação mais antigo, mas bem testado. " "Para começar, você precisa adicionar as seguintes linhas ao seu arquivo de " "configuração do kernel:" #. type: delimited block . 4 #: documentation/content/en/articles/filtering-bridges/_index.adoc:94 #, no-wrap msgid "" "options BRIDGE\n" "options IPFIREWALL\n" "options IPFIREWALL_VERBOSE\n" msgstr "" "options BRIDGE\n" "options IPFIREWALL\n" "options IPFIREWALL_VERBOSE\n" #. type: Plain text #: documentation/content/en/articles/filtering-bridges/_index.adoc:97 msgid "" "The first line is to compile the bridge support, the second one is the " "firewall and the third one is the logging functions of the firewall." msgstr "" "A primeira linha é para compilar o suporte à bridge, a segunda é para o " "firewall e a terceira é para as funções de registro do firewall." #. type: Plain text #: documentation/content/en/articles/filtering-bridges/_index.adoc:100 msgid "" "Now it is necessary to build and install the new kernel. You may find " "detailed instructions in the extref:{handbook}[Building and Installing a " "Custom Kernel, kernelconfig-building] section of the FreeBSD Handbook." msgstr "" "Agora é necessário compilar e instalar o novo kernel. Instruções detalhadas " "podem ser encontradas na seção extref:{handbook}[Compilação e Instalação de " "um Kernel Personalizado, kernelconfig-building] do FreeBSD Handbook." #. type: Title === #: documentation/content/en/articles/filtering-bridges/_index.adoc:102 #, no-wrap msgid "Modules Loading" msgstr "Carregamento de Módulos" #. type: Plain text #: documentation/content/en/articles/filtering-bridges/_index.adoc:105 msgid "" "If you have chosen to use the new and simpler installation method, the only " "thing to do now is add the following row to [.filename]#/boot/loader.conf#:" msgstr "" "Se você escolheu usar o novo e mais simples método de instalação, a única " "coisa a fazer agora é adicionar a seguinte linha ao [.filename]#/boot/loader." "conf#:" #. type: delimited block . 4 #: documentation/content/en/articles/filtering-bridges/_index.adoc:109 #, no-wrap msgid "bridge_load=\"YES\"\n" msgstr "bridge_load=\"YES\"\n" #. type: Plain text #: documentation/content/en/articles/filtering-bridges/_index.adoc:113 msgid "" "In this way, during the system startup, the [.filename]#bridge.ko# module " "will be loaded together with the kernel. It is not required to add a " "similar row for the [.filename]#ipfw.ko# module, since it will be loaded " "automatically after the execution of the steps in the following section." msgstr "" "Dessa forma, durante a inicialização do sistema, o módulo [.filename]#bridge." "ko# será carregado juntamente com o kernel. Não é necessário adicionar uma " "linha semelhante para o módulo [.filename]#ipfw.ko#, pois ele será carregado " "automaticamente após a execução das etapas na seção seguinte." #. type: Title == #: documentation/content/en/articles/filtering-bridges/_index.adoc:115 #, no-wrap msgid "Final Preparation" msgstr "Preparação Final" #. type: Plain text #: documentation/content/en/articles/filtering-bridges/_index.adoc:121 msgid "" -"Before rebooting in order to load the new kernel or the required modules " -"(according to the previously chosen installation method), you have to make " -"some changes to the [.filename]#/etc/rc.conf# configuration file. The " -"default rule of the firewall is to reject all IP packets. Initially we will " -"set up an `open` firewall, in order to verify its operation without any " -"issue related to packet filtering (in case you are going to execute this " -"procedure remotely, such configuration will avoid you to remain isolated " -"from the network). Put these lines in [.filename]#/etc/rc.conf#:" +"Before rebooting to load the new kernel or the required modules (according " +"to the previously chosen installation method), you have to make some changes " +"to the [.filename]#/etc/rc.conf# configuration file. The default rule of " +"the firewall is to reject all IP packets. Initially we will set up an " +"`open` firewall, to verify its operation without any issue related to packet " +"filtering (in case you are going to execute this procedure remotely, such " +"configuration will avoid you to remain isolated from the network). Put " +"these lines in [.filename]#/etc/rc.conf#:" msgstr "" "Antes de reiniciar para carregar o novo kernel ou os módulos necessários (de " "acordo com o método de instalação escolhido anteriormente), você deve fazer " "algumas alterações no arquivo de configuração [.filename]#/etc/rc.conf#. A " "regra padrão do firewall é rejeitar todos os pacotes IP. Inicialmente, " -"configuraremos um firewall `aberto`, a fim de verificar sua operação sem " -"problemas relacionados à filtragem de pacotes (caso você esteja executando " -"este procedimento remotamente, essa configuração evitará que você fique " -"isolado da rede). Adicione estas linhas em [.filename]#/etc/rc.conf#:" +"configuraremos um firewall `open`, para verificar sua operação sem problemas " +"relacionados à filtragem de pacotes (caso você esteja executando este " +"procedimento remotamente, essa configuração evitará que você fique isolado " +"da rede). Adicione estas linhas em [.filename]#/etc/rc.conf#:" #. type: delimited block . 4 #: documentation/content/en/articles/filtering-bridges/_index.adoc:128 #, no-wrap msgid "" "firewall_enable=\"YES\"\n" "firewall_type=\"open\"\n" "firewall_quiet=\"YES\"\n" "firewall_logging=\"YES\"\n" msgstr "" "firewall_enable=\"YES\"\n" "firewall_type=\"open\"\n" "firewall_quiet=\"YES\"\n" "firewall_logging=\"YES\"\n" #. type: Plain text #: documentation/content/en/articles/filtering-bridges/_index.adoc:131 msgid "" "The first row will enable the firewall (and will load the module [." "filename]#ipfw.ko# if it is not compiled in the kernel), the second one to " "set up it in `open` mode (as explained in [.filename]#/etc/rc.firewall#), " "the third one to not show rules loading and the fourth one to enable logging " "support." msgstr "" "A primeira linha ativará o firewall (e carregará o módulo [.filename]#ipfw." "ko# caso não esteja compilado no kernel), a segunda configurará o firewall " "no modo `open` (conforme explicado em [.filename]#/etc/rc.firewall#), a " "terceira linha não exibirá o carregamento de regras e a quarta linha ativará " "o suporte a registro de logs." #. type: Plain text #: documentation/content/en/articles/filtering-bridges/_index.adoc:137 msgid "" "About the configuration of the network interfaces, the most used way is to " "assign an IP to only one of the network cards, but the bridge will work " "equally even if both interfaces or none has a configured IP. In the last " "case (IP-less) the bridge machine will be still more hidden, as inaccessible " "from the network: to configure it, you have to login from console or through " "a third network interface separated from the bridge. Sometimes, during the " "system startup, some programs require network access, say for domain " "resolution: in this case it is necessary to assign an IP to the external " "interface (the one connected to Internet, where DNS server resides), since " "the bridge will be activated at the end of the startup procedure. It means " "that the [.filename]#fxp0# interface (in our case) must be mentioned in the " "ifconfig section of the [.filename]#/etc/rc.conf# file, while the [." "filename]#xl0# is not. Assigning an IP to both the network cards does not " "make much sense, unless, during the start procedure, applications should " "access to services on both Ethernet segments." msgstr "" "Sobre a configuração das interfaces de rede, o modo mais comum é atribuir um " "endereço IP a apenas uma das placas de rede, mas a ponte funcionará " "igualmente mesmo que ambas as interfaces ou nenhuma tenha um endereço IP " "configurado. No último caso (sem IP), a máquina da ponte ainda será mais " "oculta e inacessível pela rede: para configurá-la, é necessário fazer login " "pelo console ou por meio de uma terceira interface de rede separada da " "bridge. Às vezes, durante a inicialização do sistema, alguns programas " "exigem acesso à rede, por exemplo, para resolução de domínio: nesse caso, é " "necessário atribuir um endereço IP à interface externa (a que está conectada " "à Internet, onde o servidor DNS reside), pois a bridge será ativada no final " "do procedimento de inicialização. Isso significa que a interface [." "filename]#fxp0# (no nosso caso) deve ser mencionada na seção ifconfig do " "arquivo [.filename]#/etc/rc.conf#, enquanto a [.filename]#xl0# não. Atribuir " "um endereço IP a ambas as placas de rede não faz muito sentido, a menos que, " "durante o procedimento de inicialização, aplicativos precisem acessar " "serviços em ambos os segmentos Ethernet." #. type: Plain text #: documentation/content/en/articles/filtering-bridges/_index.adoc:144 msgid "" "There is another important thing to know. When running IP over Ethernet, " "there are actually two Ethernet protocols in use: one is IP, the other is " "ARP. ARP does the conversion of the IP address of a host into its Ethernet " -"address (MAC layer). In order to allow the communication between two hosts " -"separated by the bridge, it is necessary that the bridge will forward ARP " -"packets. Such protocol is not included in the IP layer, since it exists " -"only with IP over Ethernet. The FreeBSD firewall filters exclusively on the " -"IP layer and therefore all non-IP packets (ARP included) will be forwarded " -"without being filtered, even if the firewall is configured to not permit " -"anything." +"address (MAC layer). To allow the communication between two hosts separated " +"by the bridge, it is necessary that the bridge will forward ARP packets. " +"Such protocol is not included in the IP layer, since it exists only with IP " +"over Ethernet. The FreeBSD firewall filters exclusively on the IP layer and " +"therefore all non-IP packets (ARP included) will be forwarded without being " +"filtered, even if the firewall is configured to not permit anything." msgstr "" "Uma outra coisa importante a se saber é que, ao executar IP sobre Ethernet, " "existem na verdade dois protocolos Ethernet em uso: um é o IP e o outro é o " "ARP. ARP faz a conversão do endereço IP de um host em seu endereço Ethernet (" "camada MAC). Para permitir a comunicação entre dois hosts separados pela " "bridge, é necessário que a bridge encaminhe pacotes ARP. Esse protocolo não " "está incluído na camada IP, uma vez que ele existe apenas com IP sobre " "Ethernet. O firewall do FreeBSD filtra exclusivamente na camada IP e, " "portanto, todos os pacotes não-IP (incluindo ARP) serão encaminhados sem " "serem filtrados, mesmo se o firewall estiver configurado para não permitir " "nada." #. type: Plain text #: documentation/content/en/articles/filtering-bridges/_index.adoc:146 msgid "" "Now it is time to reboot the system and use it as before: there will be some " "new messages about the bridge and the firewall, but the bridge will not be " "activated and the firewall, being in `open` mode, will not avoid any " "operations." msgstr "" "Agora é hora de reiniciar o sistema e usá-lo como antes: haverá algumas " "novas mensagens sobre a bridge e o firewall, mas a bridge não será ativada e " "o firewall, estando no modo `aberto` , não evitará nenhuma operação." #. type: Plain text #: documentation/content/en/articles/filtering-bridges/_index.adoc:148 msgid "" "If there are any problems, you should sort them out now before proceeding." msgstr "" "Se houver algum problema, você deve resolvê-los agora antes de prosseguir." #. type: Title == #: documentation/content/en/articles/filtering-bridges/_index.adoc:150 #, no-wrap msgid "Enabling the Bridge" msgstr "Habilitando a Bridge" #. type: Plain text #: documentation/content/en/articles/filtering-bridges/_index.adoc:153 msgid "" "At this point, to enable the bridge, you have to execute the following " "commands (having the shrewdness to replace the names of the two network " "interfaces [.filename]#fxp0# and [.filename]#xl0# with your own ones):" msgstr "" "Neste ponto, para habilitar a ponte, você tem que executar os seguintes " "comandos (tendo a perspicácia para substituir os nomes das duas interfaces " "de rede [.filename]#fxp0# e [.filename]#xl0# with your own ones) com as suas " "próprias):" #. type: delimited block . 4 #: documentation/content/en/articles/filtering-bridges/_index.adoc:159 #, no-wrap msgid "" "# sysctl net.link.ether.bridge.config=fxp0:0,xl0:0\n" "# sysctl net.link.ether.bridge.ipfw=1\n" "# sysctl net.link.ether.bridge.enable=1\n" msgstr "" "# sysctl net.link.ether.bridge.config=fxp0:0,xl0:0\n" "# sysctl net.link.ether.bridge.ipfw=1\n" "# sysctl net.link.ether.bridge.enable=1\n" #. type: Plain text #: documentation/content/en/articles/filtering-bridges/_index.adoc:162 msgid "" "The first row specifies which interfaces should be activated by the bridge, " "the second one will enable the firewall on the bridge and finally the third " "one will enable the bridge." msgstr "" "A primeira linha especifica quais interfaces devem ser ativadas pela bridge, " "a segunda irá habilitar o firewall na bridge e, finalmente, a terceira irá " "habilitar a bridge." #. type: Plain text #: documentation/content/en/articles/filtering-bridges/_index.adoc:165 msgid "" "At this point you should be able to insert the machine between two sets of " "hosts without compromising any communication abilities between them. If so, " "the next step is to add the `net.link.ether.bridge._[blah]_=_[blah]_` " -"portions of these rows to the [.filename]#/etc/sysctl.conf# file, in order " -"to have them execute at startup." +"portions of these rows to the [.filename]#/etc/sysctl.conf# file, to have " +"them execute at startup." msgstr "" "Neste ponto, você deverá ser capaz de inserir a máquina entre dois conjuntos " "de hosts sem comprometer as habilidades de comunicação entre eles. Se sim, o " "próximo passo é adicionar as partes `net.link.ether.bridge._[blah]_=_[blah]_`" " dessas linhas ao arquivo [.filename]#/etc/sysctl.conf#, para que elas sejam " "executadas na inicialização." #. type: Title == #: documentation/content/en/articles/filtering-bridges/_index.adoc:167 #, no-wrap msgid "Configuring The Firewall" msgstr "Configurando o Firewall" #. type: Plain text #: documentation/content/en/articles/filtering-bridges/_index.adoc:177 msgid "" -"Now it is time to create your own file with custom firewall rules, in order " -"to secure the inside network. There will be some complication in doing this " -"because not all of the firewall functionalities are available on bridged " -"packets. Furthermore, there is a difference between the packets that are in " -"the process of being forwarded and packets that are being received by the " -"local machine. In general, incoming packets are run through the firewall " -"only once, not twice as is normally the case; in fact they are filtered only " -"upon receipt, so rules that use `out` or `xmit` will never match. " -"Personally, I use `in via` which is an older syntax, but one that has a " -"sense when you read it. Another limitation is that you are restricted to " -"use only `pass` or `drop` commands for packets filtered by a bridge. " -"Sophisticated things like `divert`, `forward` or `reject` are not " -"available. Such options can still be used, but only on traffic to or from " -"the bridge machine itself (if it has an IP address)." +"Now it is time to create your own file with custom firewall rules, to secure " +"the inside network. There will be some complication in doing this because " +"not all of the firewall functionalities are available on bridged packets. " +"Furthermore, there is a difference between the packets that are in the " +"process of being forwarded and packets that are being received by the local " +"machine. In general, incoming packets are run through the firewall only " +"once, not twice as is normally the case; in fact they are filtered only upon " +"receipt, so rules that use `out` or `xmit` will never match. Personally, I " +"use `in via` which is an older syntax, but one that has a sense when you " +"read it. Another limitation is that you are restricted to use only `pass` " +"or `drop` commands for packets filtered by a bridge. Sophisticated things " +"like `divert`, `forward` or `reject` are not available. Such options can " +"still be used, but only on traffic to or from the bridge machine itself (if " +"it has an IP address)." msgstr "" "Agora é hora de criar seu próprio arquivo com regras personalizadas de " -"firewall, a fim de proteger a rede interna. Haverá alguma complicação em " -"fazer isso porque nem todas as funcionalidades do firewall estão disponíveis " -"em pacotes encaminhados através de uma bridge. Além disso, há uma diferença " +"firewall, para proteger a rede interna. Haverá alguma complicação em fazer " +"isso porque nem todas as funcionalidades do firewall estão disponíveis em " +"pacotes encaminhados através de uma bridge. Além disso, há uma diferença " "entre os pacotes que estão em processo de encaminhamento e os pacotes que " "estão sendo recebidos pela máquina local. Em geral, os pacotes de entrada " "são filtrados apenas uma vez, não duas vezes como normalmente ocorre; de " "fato, eles são filtrados apenas no momento do recebimento, portanto, as " "regras que usam `out` ou `xmit` nunca darão match. Pessoalmente, eu uso `in " "via`, que é uma sintaxe mais antiga, mas que faz sentido quando você lê. " "Outra limitação é que você está restrito a usar apenas comandos `pass` ou " "`drop` para pacotes filtrados por uma ponte. Coisas sofisticadas como " "`divert`, `forward` ou `reject` não estão disponíveis. Tais opções ainda " "podem ser usadas, mas apenas no tráfego destinado ou originado na máquina " "que atua como bridge em si (se ela tiver um endereço IP)." #. type: Plain text #: documentation/content/en/articles/filtering-bridges/_index.adoc:185 msgid "" "New in FreeBSD 4.0, is the concept of stateful filtering. This is a big " "improvement for UDP traffic, which typically is a request going out, " "followed shortly thereafter by a response with the exact same set of IP " "addresses and port numbers (but with source and destination reversed, of " "course). For firewalls that have no statekeeping, there is almost no way to " "deal with this sort of traffic as a single session. But with a firewall " "that can \"remember\" an outgoing UDP packet and, for the next few minutes, " "allow a response, handling UDP services is trivial. The following example " "shows how to do it. It is possible to do the same thing with TCP packets. " "This allows you to avoid some denial of service attacks and other nasty " "tricks, but it also typically makes your state table grow quickly in size." msgstr "" "O conceito de filtragem stateful é novo no FreeBSD 4.0. Esta é uma grande " "melhoria para o tráfego UDP, que geralmente é uma solicitação que sai, " "seguida logo depois por uma resposta com o mesmo conjunto de endereços IP e " "portas (mas com origem e destino invertidos, é claro). Para firewalls que " "não têm o controle de estado, quase não há como lidar com esse tipo de " "tráfego como uma sessão única. Mas com um firewall que pode \"lembrar\" de " "um pacote UDP de saída e, nos próximos minutos, permitir uma resposta, lidar " "com serviços UDP é trivial. O exemplo a seguir mostra como fazer isso. É " "possível fazer a mesma coisa com pacotes TCP. Isso permite evitar alguns " "ataques de negação de serviço e outros truques desagradáveis, mas também faz " "com que a tabela de estado cresça rapidamente em tamanho." #. type: Plain text #: documentation/content/en/articles/filtering-bridges/_index.adoc:189 msgid "" "Let's look at an example setup. Note first that at the top of [.filename]#/" "etc/rc.firewall# there are already standard rules for the loopback interface " "[.filename]#lo0#, so we should not have to care for them anymore. Custom " "rules should be put in a separate file (say [.filename]#/etc/rc.firewall." "local#) and loaded at system startup, by modifying the row of [.filename]#/" "etc/rc.conf# where we defined the `open` firewall:" msgstr "" "Vamos dar uma olhada em um exemplo de configuração. Note primeiro que no " "início de [.filename]#/etc/rc.firewall#, já existem regras padrão para a " "interface de loopback [.filename]#lo0#, então não precisamos mais nos " "preocupar com elas. As regras personalizadas devem ser colocadas em um " "arquivo separado (digamos [.filename]#/etc/rc.firewall.local#) e carregadas " -"na inicialização do sistema, modificando a linha de [.filename]#/etc/rc.conf#" -" onde definimos o firewall `open`:" +"na inicialização do sistema, modificando a linha de [.filename]#/etc/rc." +"conf# onde definimos o firewall `open`:" #. type: delimited block . 4 #: documentation/content/en/articles/filtering-bridges/_index.adoc:193 #, no-wrap msgid "firewall_type=\"/etc/rc.firewall.local\"\n" msgstr "firewall_type=\"/etc/rc.firewall.local\"\n" #. type: delimited block = 4 #: documentation/content/en/articles/filtering-bridges/_index.adoc:198 msgid "" "You have to specify the _full_ path, otherwise it will not be loaded with " "the risk to remain isolated from the network." msgstr "" "Você tem que especificar o _caminho completo_, caso contrário ele não será " "carregado com o risco de permanecer isolado da rede." #. type: Plain text #: documentation/content/en/articles/filtering-bridges/_index.adoc:201 msgid "" "For our example imagine to have the [.filename]#fxp0# interface connected " "towards the outside (Internet) and the [.filename]#xl0# towards the inside " "(LAN). The bridge machine has the IP `1.2.3.4` (it is not possible that your " "ISP can give you an address quite like this, but for our example it is good)." msgstr "" "Para o nosso exemplo, imagine ter a interface [.filename]#fxp0# conectada ao " "exterior (Internet) e a [.filename]#xl0# ao interior (LAN). A máquina bridge " "tem o IP `1.2.3.4` (não é possível que o seu provedor de serviços de " "Internet possa lhe fornecer um endereço exatamente como este, mas para o " "nosso exemplo é suficiente)." #. type: delimited block . 4 #: documentation/content/en/articles/filtering-bridges/_index.adoc:206 #, no-wrap msgid "" "# Things that we have kept state on before get to go through in a hurry\n" "add check-state\n" msgstr "" "# Things that we have kept state on before get to go through in a hurry\n" "add check-state\n" #. type: delimited block . 4 #: documentation/content/en/articles/filtering-bridges/_index.adoc:211 #, no-wrap msgid "" "# Throw away RFC 1918 networks\n" "add drop all from 10.0.0.0/8 to any in via fxp0\n" "add drop all from 172.16.0.0/12 to any in via fxp0\n" "add drop all from 192.168.0.0/16 to any in via fxp0\n" msgstr "" "# Throw away RFC 1918 networks\n" "add drop all from 10.0.0.0/8 to any in via fxp0\n" "add drop all from 172.16.0.0/12 to any in via fxp0\n" "add drop all from 192.168.0.0/16 to any in via fxp0\n" #. type: delimited block . 4 #: documentation/content/en/articles/filtering-bridges/_index.adoc:217 #, no-wrap msgid "" "# Allow the bridge machine to say anything it wants\n" "# (if the machine is IP-less do not include these rows)\n" "add pass tcp from 1.2.3.4 to any setup keep-state\n" "add pass udp from 1.2.3.4 to any keep-state\n" "add pass ip from 1.2.3.4 to any\n" msgstr "" "# Allow the bridge machine to say anything it wants\n" "# (if the machine is IP-less do not include these rows)\n" "add pass tcp from 1.2.3.4 to any setup keep-state\n" "add pass udp from 1.2.3.4 to any keep-state\n" "add pass ip from 1.2.3.4 to any\n" #. type: delimited block . 4 #: documentation/content/en/articles/filtering-bridges/_index.adoc:222 #, no-wrap msgid "" "# Allow the inside hosts to say anything they want\n" "add pass tcp from any to any in via xl0 setup keep-state\n" "add pass udp from any to any in via xl0 keep-state\n" "add pass ip from any to any in via xl0\n" msgstr "" "# Allow the inside hosts to say anything they want\n" "add pass tcp from any to any in via xl0 setup keep-state\n" "add pass udp from any to any in via xl0 keep-state\n" "add pass ip from any to any in via xl0\n" #. type: delimited block . 4 #: documentation/content/en/articles/filtering-bridges/_index.adoc:234 #, no-wrap msgid "" "# TCP section\n" "# Allow SSH\n" "add pass tcp from any to any 22 in via fxp0 setup keep-state\n" "# Allow SMTP only towards the mail server\n" "add pass tcp from any to relay 25 in via fxp0 setup keep-state\n" "# Allow zone transfers only by the secondary name server [dns2.nic.it]\n" "add pass tcp from 193.205.245.8 to ns 53 in via fxp0 setup keep-state\n" "# Pass ident probes. It is better than waiting for them to timeout\n" "add pass tcp from any to any 113 in via fxp0 setup keep-state\n" "# Pass the \"quarantine\" range\n" "add pass tcp from any to any 49152-65535 in via fxp0 setup keep-state\n" msgstr "" "# TCP section\n" "# Allow SSH\n" "add pass tcp from any to any 22 in via fxp0 setup keep-state\n" "# Allow SMTP only towards the mail server\n" "add pass tcp from any to relay 25 in via fxp0 setup keep-state\n" "# Allow zone transfers only by the secondary name server [dns2.nic.it]\n" "add pass tcp from 193.205.245.8 to ns 53 in via fxp0 setup keep-state\n" "# Pass ident probes. It is better than waiting for them to timeout\n" "add pass tcp from any to any 113 in via fxp0 setup keep-state\n" "# Pass the \"quarantine\" range\n" "add pass tcp from any to any 49152-65535 in via fxp0 setup keep-state\n" #. type: delimited block . 4 #: documentation/content/en/articles/filtering-bridges/_index.adoc:240 #, no-wrap msgid "" "# UDP section\n" "# Allow DNS only towards the name server\n" "add pass udp from any to ns 53 in via fxp0 keep-state\n" "# Pass the \"quarantine\" range\n" "add pass udp from any to any 49152-65535 in via fxp0 keep-state\n" msgstr "" "# UDP section\n" "# Allow DNS only towards the name server\n" "add pass udp from any to ns 53 in via fxp0 keep-state\n" "# Pass the \"quarantine\" range\n" "add pass udp from any to any 49152-65535 in via fxp0 keep-state\n" #. type: delimited block . 4 #: documentation/content/en/articles/filtering-bridges/_index.adoc:247 #, no-wrap msgid "" "# ICMP section\n" "# Pass 'ping'\n" "add pass icmp from any to any icmptypes 8 keep-state\n" "# Pass error messages generated by 'traceroute'\n" "add pass icmp from any to any icmptypes 3\n" "add pass icmp from any to any icmptypes 11\n" msgstr "" "# ICMP section\n" "# Pass 'ping'\n" "add pass icmp from any to any icmptypes 8 keep-state\n" "# Pass error messages generated by 'traceroute'\n" "add pass icmp from any to any icmptypes 3\n" "add pass icmp from any to any icmptypes 11\n" #. type: delimited block . 4 #: documentation/content/en/articles/filtering-bridges/_index.adoc:250 #, no-wrap msgid "" "# Everything else is suspect\n" "add drop log all from any to any\n" msgstr "" "# Everything else is suspect\n" "add drop log all from any to any\n" #. type: Plain text #: documentation/content/en/articles/filtering-bridges/_index.adoc:254 msgid "" "Those of you who have set up firewalls before may notice some things " "missing. In particular, there are no anti-spoofing rules, in fact we did " "_not_ add:" msgstr "" "Aqueles que já configuraram firewalls antes podem notar que algumas coisas " "estão faltando. Em particular, não há regras anti-spoofing, na verdade, " "_não_ adicionamos:" #. type: delimited block . 4 #: documentation/content/en/articles/filtering-bridges/_index.adoc:258 #, no-wrap msgid "add deny all from 1.2.3.4/8 to any in via fxp0\n" msgstr "add deny all from 1.2.3.4/8 to any in via fxp0\n" #. type: Plain text #: documentation/content/en/articles/filtering-bridges/_index.adoc:264 msgid "" "That is, drop packets that are coming in from the outside claiming to be " "from our network. This is something that you would commonly do to be sure " "that someone does not try to evade the packet filter, by generating " "nefarious packets that look like they are from the inside. The problem with " "that is that there is _at least_ one host on the outside interface that you " "do not want to ignore: the router. But usually, the ISP anti-spoofs at " "their router, so we do not need to bother that much." msgstr "" "Isso significa descartar pacotes que estão chegando de fora e alegam ser da " "nossa rede. Isso é algo que normalmente se faz para garantir que alguém não " "tente evadir o filtro de pacotes, gerando pacotes maliciosos que parecem ser " "provenientes de dentro da rede. O problema é que há _pelo menos_ um host na " "interface externa que você não deseja ignorar: o roteador. Mas geralmente, o " "ISP faz o anti-spoofing em seu roteador, então não precisamos nos preocupar " "tanto com isso." #. type: Plain text #: documentation/content/en/articles/filtering-bridges/_index.adoc:267 msgid "" "The last rule seems to be an exact duplicate of the default rule, that is, " "do not let anything pass that is not specifically allowed. But there is a " "difference: all suspected traffic will be logged." msgstr "" "A última regra parece ser uma duplicata exata da regra padrão, ou seja, não " "deixa passar nada que não seja especificamente permitido. Mas há uma " "diferença: todo tráfego suspeito será registrado." #. type: Plain text #: documentation/content/en/articles/filtering-bridges/_index.adoc:273 msgid "" "There are two rules for passing SMTP and DNS traffic towards the mail server " "and the name server, if you have them. Obviously the whole rule set should " "be flavored to personal taste, this is only a specific example (rule format " -"is described accurately in the man:ipfw[8] man page). Note that in order " -"for \"relay\" and \"ns\" to work, name service lookups must work _before_ " -"the bridge is enabled. This is an example of making sure that you set the " -"IP on the correct network card. Alternatively it is possible to specify the " -"IP address instead of the host name (required if the machine is IP-less)." +"is described accurately in the man:ipfw[8] man page). Note that for \"relay" +"\" and \"ns\" to work, name service lookups must work _before_ the bridge is " +"enabled. This is an example of making sure that you set the IP on the " +"correct network card. Alternatively it is possible to specify the IP " +"address instead of the host name (required if the machine is IP-less)." msgstr "" "Existem duas regras para permitir o tráfego SMTP e DNS direcionado ao " "servidor de e-mail e servidor de nomes, se você tiver esses servidores. " "Obviamente, todo o conjunto de regras deve ser personalizado de acordo com " "as preferências pessoais, este é apenas um exemplo específico (o formato da " "regra é descrito com precisão na página do manual man:ipfw[8]). Observe que, " "para o \"relay\" e o \"ns\" funcionarem, as consultas ao serviço de nomes " "devem funcionar _antes_ de habilitar a ponte. Isto é um exemplo para " "garantir que você configure o IP no cartão de rede correto. " "Alternativamente, é possível especificar o endereço IP em vez do nome do " "host (obrigatório se a máquina não possuir um IP)." #. type: Plain text #: documentation/content/en/articles/filtering-bridges/_index.adoc:278 msgid "" "People that are used to setting up firewalls are probably also used to " "either having a `reset` or a `forward` rule for ident packets (TCP port " "113). Unfortunately, this is not an applicable option with the bridge, so " "the best thing is to simply pass them to their destination. As long as that " "destination machine is not running an ident daemon, this is relatively " "harmless. The alternative is dropping connections on port 113, which " "creates some problems with services like IRC (the ident probe must timeout)." msgstr "" "Pessoas acostumadas a configurar firewalls provavelmente também estão " -"acostumadas a ter uma regra de `reset` ou `forward` para pacotes ident (" -"porta TCP 113). Infelizmente, essa não é uma opção aplicável com a bridge, " +"acostumadas a ter uma regra de `reset` ou `forward` para pacotes ident " +"(porta TCP 113). Infelizmente, essa não é uma opção aplicável com a bridge, " "então a melhor coisa a fazer é simplesmente passá-los para o destino. " "Contanto que a máquina de destino não esteja executando um ident daemon, " "isso é relativamente inofensivo. A alternativa é descartar conexões na porta " "113, o que cria alguns problemas com serviços como IRC (a sondagem ident " "deve expirar)." #. type: Plain text #: documentation/content/en/articles/filtering-bridges/_index.adoc:285 msgid "" "The only other thing that is a little weird that you may have noticed is " "that there is a rule to let the bridge machine speak, and another for " "internal hosts. Remember that this is because the two sets of traffic will " "take different paths through the kernel and into the packet filter. The " "inside net will go through the bridge, while the local machine will use the " "normal IP stack to speak. Thus the two rules to handle the different " "cases. The `in via fxp0` rules work for both paths. In general, if you use " "`in via` rules throughout the filter, you will need to make an exception for " "locally generated packets, because they did not come in via any of our " "interfaces." msgstr "" "A única outra coisa um pouco estranha que você pode ter notado é que há uma " "regra para permitir que a máquina da bridge fale, e outra para os hosts " "internos. Lembre-se de que isso ocorre porque os dois conjuntos de tráfego " "seguirão caminhos diferentes através do kernel e do filtro de pacotes. A " "rede interna passará pela ponte, enquanto a máquina local usará o stack de " "IP normal para falar. Portando, existem duas regras para lidar com os casos " "diferentes. As regras `in via fxp0` funcionam para ambos os caminhos. Em " "geral, se você usar regras `in via` em todo o filtro, precisará fazer uma " "exceção para pacotes gerados localmente, porque eles não entraram por " "nenhuma de nossas interfaces." #. type: Title == #: documentation/content/en/articles/filtering-bridges/_index.adoc:287 #, no-wrap msgid "Contributors" msgstr "Colaboradores" #. type: Plain text #: documentation/content/en/articles/filtering-bridges/_index.adoc:291 msgid "" "Many parts of this article have been taken, updated and adapted from an old " "text about bridging, edited by Nick Sayer. A pair of inspirations are due " "to an introduction on bridging by Steve Peterson." msgstr "" "Muitas partes deste artigo foram retiradas, atualizadas e adaptadas de um " "antigo texto sobre bridges, editado por Nick Sayer. E um par de inspirações " "vieram de uma introdução sobre bridges de autoria de Steve Peterson." #. type: Plain text #: documentation/content/en/articles/filtering-bridges/_index.adoc:293 msgid "" "A big thanks to Luigi Rizzo for the implementation of the bridge code in " "FreeBSD and for the time he has dedicated to me answering all of my related " "questions." msgstr "" "Um grande obrigado ao Luigi Rizzo pela implementação do código de ponte " "(bridge) no FreeBSD e pelo tempo que ele dedicou a mim respondendo a todas " "as minhas perguntas relacionadas." #. type: Plain text #: documentation/content/en/articles/filtering-bridges/_index.adoc:294 msgid "" "A thanks goes out also to Tom Rhodes who looked over my job of translation " "from Italian (the original language of this article) into English." msgstr "" "Agradeço também a Tom Rhodes, que olhou para o meu trabalho de tradução do " "italiano (a língua original deste artigo) para o inglês." #~ msgid "" #~ "include::shared/attributes/attributes-{{% lang %}}.adoc[] include::shared/" #~ "{{% lang %}}/teams.adoc[] include::shared/{{% lang %}}/mailing-lists." #~ "adoc[] include::shared/{{% lang %}}/urls.adoc[]" #~ msgstr "" #~ "include::shared/attributes/attributes-{{% lang %}}.adoc[] include::shared/" #~ "{{% lang %}}/teams.adoc[] include::shared/{{% lang %}}/mailing-lists." #~ "adoc[] include::shared/{{% lang %}}/urls.adoc[]"