[FUGSPBR] NAT

Márcio Luciano Donada marcio em sl.unochapeco.rct-sc.br
Qua Ago 13 00:35:22 BRT 2003


Olá Gustavo,
Isso foi discutido já no histórico, mas vou te mostrar como eu faço,

no /usr/src/sys/i386/conf ee seu_kernel
options         IPDIVERT
options         IPFIREWALL
options         IPFIREWALL_FORWARD
options         RANDOM_IP_ID
options         TCP_DROP_SYNFIN
options         IPSTEALTH
options         INCLUDE_CONFIG_FILE
options         IPFIREWALL_VERBOSE
options         DUMMYNET

Sugiro você ler o LINT para saber o que cada linha acima irá trabalhar no
sistema apos compilado o novo kernel!

config -g  seu_kernel
cd ../../compile/seu_kernel
make depend
make
make install
shutdown -r now

Agora no /etc/rc.conf as seguintes linhas:
network_interfaces="xl0 xl1 lo0"
firewall_enable="YES"
firewall_script="/etc/firewall/firewall.conf"
firewall_type="UNKNOW"
firewall_quiet="NO"
firewall_logging="YES"
natd_enable="YES"
natd_interface="xl1" (essa interface deve ser a da internet)
natd_flags="-l -f /etc/natd.conf"

no natd.conf
interface xl1 (interface com a internet)
dynamic yes
same_ports yes
use_sockets yes

no firewall.conf
/sbin/ipfw -f flush
/sbin/ipfw add divert natd all from any to any via xl1
/sbin/ipfw add pass all from any to any

Bom você deve ver que no kernel não temos a regra "options
FIREWALL_DEFAULT_TO_ACCEPT" dessa forma a ultima regra será deny ip from any
to any e você deve liberar no seu firewall as portas que você quer utilizar,
tipo 80,25,22 etc...
Leia a documentação do Jean (www.free.bsd.com.br) sobre o nat que você tira
ainda mais suas duvidas, mas com isso você resolve o problema do nat,
Blz?

Abraço,
Márcio


> Pessoal,
> estou com um freebsd e tenho que fazer um nat, tentei seguir os passos do
> link:
> http://www.linuxbsd.com.br/phpLinuxBSD/modules/man/freebsd/sessao8_9.html,
> mas infelizmente não tive sucesso, então se alguem conhecer algum outro
site
> que possa ajudar-me eu agradeceria.
> boa noite a todos
> gus
>
> _______________________________________________________________
> Sair da Lista: http://www2.fugspbr.org/mailman/listinfo/fugspbr
> Historico: http://www4.fugspbr.org/lista/html/FUG-BR/
>
>

_______________________________________________________________
Sair da Lista: http://www2.fugspbr.org/mailman/listinfo/fugspbr
Historico: http://www4.fugspbr.org/lista/html/FUG-BR/



Mais detalhes sobre a lista de discussão freebsd