Senhores;

Primeiramente, meus problemas, logo abaixo, o que estou fazendo.

Problema: resolver nomes www.terra.com.br - www.goo..... ...
Se pingo para a internet ? sim
Se estou vendo os logs ? sim, estou tendo essa resposta por tcpdump:

{r...@matadeiro}/mnt/sda/vmware [ tcpdump -i eth0 host 10.0.10.1


tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes
16:16:59.378678 IP 10.0.10.1.46182 > 10.0.0.2.domain: 5787+ A? 
www.google.com. (32)
16:16:59.378881 IP 10.0.0.2.domain > 10.0.10.1.46182: 5787 Refused- 
0/0/0 (32)
16:16:59.379280 IP 10.0.10.1.49751 > 10.0.0.2.domain: 5787+ A? 
www.google.com. (32)
16:16:59.379361 IP 10.0.0.2.domain > 10.0.10.1.49751: 5787 Refused- 
0/0/0 (32)
16:16:59.379542 IP 10.0.10.1.58422 > 10.0.0.2.domain: 57641+ A? 
www.google.com. (32)
16:16:59.379595 IP 10.0.0.2.domain > 10.0.10.1.58422: 57641 Refused- 
0/0/0 (32)
16:16:59.379716 IP 10.0.10.1.44449 > 10.0.0.2.domain: 57641+ A? 
www.google.com. (32)
16:16:59.379774 IP 10.0.0.2.domain > 10.0.10.1.44449: 57641 Refused- 
0/0/0 (32)

e estou tendo a resposta por logs no iptables:
{r...@matadeiro}/mnt/sda/vmware [ tail -f /var/log/messages


Dec  1 16:17:14 localhost dhcpd: DHCPREQUEST for 10.0.0.56 from 
00:01:6c:11:45:c8 via eth0
Dec  1 16:17:38 localhost named[30142]: client 10.0.10.1#37432: query 
(cache) 'www.google.com/A/IN' denied
Dec  1 16:17:38 localhost named[30142]: client 10.0.10.1#60710: query 
(cache) 'www.google.com/A/IN' denied
Dec  1 16:17:38 localhost named[30142]: client 10.0.10.1#51006: query 
(cache) 'www.google.com/A/IN' denied
Dec  1 16:17:38 localhost named[30142]: client 10.0.10.1#41290: query 
(cache) 'www.google.com/A/IN' denied

----
Vamos lá:
Estou isolando redes aqui na empresa, mas ainda tudo em fazes de testes.

Tenho 2 redes no momento, na verdade agora são 3 (essa em teste);
1 - 10.0.0.0/24 = 255.255.255.0
2 - 10.0.1.0/24 = 255.255.255.0
3 - 10.0.10.0/29 = 255.255.255.248

os gateways de cada de rede
0 - modem 10.0.0.1 que é gateway da maquina 10.0.0.2
1 - 10.0.0.2/24 (firewall + proxy + cache dns) - modem 10.0.0.1
2 - 10.0.1.254/24
3 - 10.0.10.1/29


No momento nao preciso de acesso a rede 10.0.1.0/24, estou testando 
apenas nas outras duas redes, no caso 10.0.0.0/24 e 10.0.10/29

Entao o seguinte, rede 10.0.0.0/24:
Kernel IP routing table
Destination     Gateway         Genmask
10.0.0.0        0.0.0.0         255.255.255.0
10.0.1.0        10.0.0.253      255.255.255.0
127.0.0.0       0.0.0.0         255.0.0.0
0.0.0.0         10.0.0.1        0.0.0.0

Como eu nao tinha a rota para a rede 10.0.10.0/29 tive que criar:
route add -net 10.0.10.0 netmask 255.255.255.248 gw 10.0.0.2

e na rede 10.0.10.0 criei a rota para a rede 10.0.0.0/24 e para a internet:

route add -net 10.0.0.0 netmask 255.255.255.0 gw 10.0.10.1
route add -net 0.0.0.0 netmask 0.0.0.0 gw 10.0.0.2

ficando assim na rede 10.0.0.0/24:
Kernel IP routing table
Destination     Gateway         Genmask
10.0.10.0       10.0.0.2        255.255.255.248
10.0.0.0        0.0.0.0         255.255.255.0
10.0.1.0        10.0.0.253      255.255.255.0
127.0.0.0       0.0.0.0         255.0.0.0
0.0.0.0         10.0.0.1        0.0.0.0

e na rede 10.0.10.0/24:
Kernel IP routing table
Destination     Gateway         Genmask
10.0.10.0       0.0.0.0         255.255.255.248
10.0.0.0        10.0.10.1       255.255.255.0
0.0.0.0         10.0.0.2        0.0.0.0
127.0.0.0       0.0.0.0         255.0.0.0

No meu humilde conhecimento, me parece problema nas minhas regras de 
firewall (que trabalho pra configurar estaticamente as portas de nfs 
através de firewall), mas não consigo achar o que seria, ou ainda no meu 
cache dns, mas nao conheço (no momento) muito de dns.

Segue minhas regras (sugestões, SEMPRE bem vindas):

#!/bin/bash
# Criado em: 2009/10/29 (Thu) 15:19:39 (BRST)
# Ultima Modificação: 2009/11/03 (Tue) 14:30:39 (BRST)
# Autor: Rafael Dutra <[email protected]>
# http://www.du3x.com

           IPTABLES="/usr/sbin/iptables"
               NIC0="eth0"
               NIC1="eth1"
               NIC2="eth2"
             SERVER="10.0.0.2"
               REDE="10.0.0.0/24"
ROUTER_TIJUQUINHAS="10.0.0.253"
   REDE_TIJUQUINHAS="10.0.1.0"
   MASC_TIJUQUINHAS="255.255.255.0"

# Alguns computadores que precisam de permissões extras
          GANDALF="10.0.0.36"

function color()
{
     VERMELHO="31"
        VERDE="32"
      AMARELO="33"
         AZUL="34"
      MAGENTA="35"
        CIANO="36"
       BRANCO="37"
     echo -e "\e[$AMARELO;1m [ OK ]\e[m\e[35;1m\e[m"
}

function stop()
{
     echo -n "Limpando regras:"
     # Limpar regras
     $IPTABLES -F                  # Delete all rules in  chain or all 
chains
     $IPTABLES -Z                  # Zero counters in chain or all chains
     $IPTABLES -X                  # Delete a user-defined chain
     $IPTABLES -t filter -F        # table to manipulate (default: `filter')
     $IPTABLES -t filter -Z
     $IPTABLES -t nat    -Z
     $IPTABLES -t nat    -F        # Flushing table nat
     color
}

function start()
{
     # Determina a política padrão
     $IPTABLES -P   INPUT DROP
     $IPTABLES -P  OUTPUT DROP
     $IPTABLES -P FORWARD DROP

     # Aceitando tudo em loopback
     $IPTABLES -A  INPUT -i lo -j ACCEPT
     $IPTABLES -A OUTPUT -o lo -j ACCEPT

     # Ativa roteamento e mascaramento
     echo -n "Ativando o roteamento:"
     echo 1 > /proc/sys/net/ipv4/ip_forward
     color

     # Habilitando ping
     $IPTABLES -A INPUT -p icmp -j ACCEPT

     # Aceita os pacotes que realmente devem entrar
     $IPTABLES -A   INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
     $IPTABLES -A  OUTPUT -m state --state ESTABLISHED,RELATED,NEW -j ACCEPT
     $IPTABLES -A FORWARD -m state --state ESTABLISHED,RELATED,NEW -j ACCEPT

     $IPTABLES -A FORWARD -d $SERVER -j ACCEPT
     $IPTABLES -A FORWARD -s $SERVER -j ACCEPT

     # dns para entrar
     $IPTABLES -A  INPUT -p tcp -m multiport --dports 53,953 -m state 
--state NEW -j ACCEPT
     $IPTABLES -A  INPUT -p udp -m multiport --dports 53,953 -m state 
--state NEW -j ACCEPT

     # dns para sair
     $IPTABLES -A OUTPUT -p tcp -m multiport --dports 53,953 -m state 
--state NEW -j ACCEPT
     $IPTABLES -A OUTPUT -p udp -m multiport --dports 53,953 -m state 
--state NEW -j ACCEPT


     # Loga tentativa de acesso a deter determinadas portas
     $IPTABLES -A  INPUT -p tcp --dport 3128 -i $NIC0 -j LOG --log-level 
6 --log-prefix "FIREWALL: squid: "
     $IPTABLES -A  INPUT -p tcp --dport   80 -i $NIC0 -j LOG --log-level 
6 --log-prefix "FIREWALL: http: "
     $IPTABLES -A  INPUT -p icmp             -i $NIC0 -j LOG --log-level 
6 --log-prefix "FIREWALL: icmp: "
     $IPTABLES -A  INPUT -p tcp --dport  111 -i $NIC0 -j LOG --log-level 
6 --log-prefix "FIREWALL: nfs-111-tcp: "
     $IPTABLES -A  INPUT -p udp --dport  111 -i $NIC0 -j LOG --log-level 
6 --log-prefix "FIREWALL: nfs-111-udp: "
     $IPTABLES -A  INPUT -p tcp --dport 2049 -i $NIC0 -j LOG --log-level 
6 --log-prefix "FIREWALL: nfs-2049: "
     $IPTABLES -A  INPUT -p udp --dport 2049 -i $NIC0 -j LOG --log-level 
6 --log-prefix "FIREWALL: nfs-2049: "
     $IPTABLES -A  INPUT -p udp --dport   53 -i $NIC0 -j LOG --log-level 
6 --log-prefix "FIREWALL: DNS-53: "

     # libero apenas para meu note o acesso ao autofs
     $IPTABLES -A INPUT -p tcp -m multiport --dports 
111,2049,32765:32768 -j ACCEPT
     $IPTABLES -A INPUT -p udp -m multiport --dports 
111,2049,32765:32768 -j ACCEPT


     $IPTABLES -A INPUT -p tcp --dport 137 -j ACCEPT
     $IPTABLES -A INPUT -p udp --dport 137 -j ACCEPT

     $IPTABLES -A INPUT -p tcp --dport 138 -j ACCEPT
     $IPTABLES -A INPUT -p udp --dport 138 -j ACCEPT

     $IPTABLES -A INPUT -p tcp --dport 139 -j ACCEPT
     $IPTABLES -A INPUT -p udp --dport 139 -j ACCEPT

     # ntp
     $IPTABLES -A INPUT -p udp --dport 123 -j ACCEPT

     # vmware server
     $IPTABLES -A INPUT -s $REDE -p tcp --dport 8222 -j ACCEPT
     $IPTABLES -A INPUT -s $REDE -p tcp --dport 8333 -j ACCEPT
     $IPTABLES -A INPUT -s $REDE -p tcp --dport  902 -j ACCEPT

     # dhcp
     $IPTABLES  -I INPUT -i $NIC0 -p udp --dport 67:68 --sport 67:68 -j 
ACCEPT


     # Libera acesso externo a determinadas portas
     # Permite configurar um período de tempo no qual uma determinada 
conexão pode ocorrer a cada x segundos:
     $IPTABLES -A INPUT -m state --state ESTABLISHED -j ACCEPT
     $IPTABLES -A INPUT -p tcp --dport ssh -m recent --update --seconds 
10 -j DROP
     $IPTABLES -A INPUT -p tcp --dport ssh --tcp-flags syn,ack,rst syn 
-m recent --set -j ACCEPT
     $IPTABLES -A INPUT -p tcp -s $REDE --dport 22 -i $NIC0 -j ACCEPT

     # squid
     $IPTABLES -t nat -A PREROUTING -s $REDE -p tcp --dport 80 -j 
REDIRECT --to-port 3128
     $IPTABLES -A INPUT -d $SERVER -p tcp --dport 3128 -j ACCEPT

     # mascaramento
     $IPTABLES -t nat -A POSTROUTING -o $NIC0 -j MASQUERADE

}

function libera()
{
     stop
     $IPTABLES -P  OUTPUT ACCEPT
     $IPTABLES -P   INPUT ACCEPT
     $IPTABLES -P FORWARD ACCEPT
}


function status()
{
     $IPTABLES -vL -t filter
}

function routes()
{
     if [ "$1" == "start" ] || [ "$1" == "restart" ] || [ "$1" == "libera" ]
     then
         ADD="add"
     else
         ADD="del"
     fi

     route $ADD -net $REDE_TIJUQUINHAS netmask $MASC_TIJUQUINHAS gw 
$ROUTER_TIJUQUINHAS 2>/dev/null
     echo "route $ADD -net $REDE_TIJUQUINHAS netmask $MASC_TIJUQUINHAS 
gw $ROUTER_TIJUQUINHAS"

}

function restart()
{
     stop
     sleep 2
     start
}


case "$1" in
'libera')
   libera $1
   ;;
'start')
   start
   routes $1
   ;;
'stop')
   stop
   routes $1
   ;;
'status')
   status
   ;;
'restart')
   restart
   routes $1
   ;;
*)
   echo "usage $0 start|stop|restart|status"
esac


Como falei, pingo pra ips fora, mas nao resolvo dns.

Obrigado por qualquer sugestão !

Abraço

-- 
cat << EOT

Rafael Dutra <[email protected]>
http://www.du3x.com
Florianópolis - SC - Brasil
Linux user #376.904
Tel. +55 48 88279453
echo 1244394795515721490698P | dc
# while true; do work + work; done
Current System: Debian 5.0 (lenny)

http://pt.wikipedia.org/wiki/ASCII
01001010 01001111 01001001 01000011 01000101
01010100 01000101 01000001 01001101 01001111

EOT

--~--~---------~--~----~------------~-------~--~----~
GUS-BR - Grupo de Usuários de Slackware Brasil
http://www.slackwarebrasil.org/
http://groups.google.com/group/slack-users-br

Antes de perguntar:
http://www.istf.com.br/perguntas/

Para sair da lista envie um e-mail para:
[email protected]
-~----------~----~----~----~------~----~------~--~---

Responder a