+ Responder ao Tópico



  1. #1
    muganga
    Visitante

    Padrão arquivo firewall

    yae moçada...

    seguinte...tenho REDE 1 (10.1.10) REDE 2 (10.1.2.0) e REDE 3 (10.1.13) ligadas a um mesmo hub...
    tenho duas entradas de interne...uma pela REDE3 (10.1.3.250) e outra pela REDE 1 (10.1.1.250)...quero fazer o seguinte...

    a rede 1 e rede 2 so podem navegar pelo gw 10.1.1.250
    a rede 3 pode navergar tanto pelo gw 10.1.1.250 e 10.1.3.250...

    minhas regras estao assim....

    #Direciona tudo para o SQUID
    #iptables -t nat -A PREROUTING -o 10.1.1.250 -p tcp --dport 80 -j REDIRECT -to-port 3128
    #iptables -t nat -A PREROUTING -o 10.1.3.250 -p tcp --dport 80 -j REDIRECT -to-port 3128


    #Esta regra faz com que todos os pacotes vindo de qualquer endereço da
    #rede 10.1.1.1/16 sejam negados
    iptables -A INPUT -s 10.1.1.1/16 -o 10.1.1.250 -j DROP
    iptables -A INPUT -s 10.1.1.1/16 -o 10.1.3.250 -j DROP


    #As redes 10.1.1.0 , 10.1.2.0 e 10.1.3.0 navegarao pelo gw 10.1.1.250
    iptables -t nat PREROUTING -s 10.1.1.1/16 -o 10.1.1.250 -j MASQUERADE

    #As redes 10.1.1.0 e 10.1.2.0 NAO navegarao pelo gw 10.1.3.250
    iptables -t nat -A PREROUTING -s 10.1.1.0/24 -o 10.1.3.250 -j REJECT
    iptables -t nat -A PREROUTING -s 10.1.2.0/24 -o 10.1.3.250 -j REJECT

    #A rede 10.1.3.0 navegara pelo gw 10.1.3.250
    iptables -t nat -A PREROUTING -s 10.1.3.0/24 -o 10.1.3.250 -j ACCEPT


    o que mais preciso fazer para meu firewall funcionar blz?

    abraço a todos

    Muganga
    ICQ: 314528019[/img]

  2. #2

    Padrão arquivo firewall

    ao inves de:
    iptables -t nat PREROUTING -s 10.1.1.1/16 -o 10.1.1.250 -j MASQUERADE

    naum seria
    iptables -t nat -A POSTROUTING -s 10.1.0.0/16 -o 10.1.1.250/32 -j MASQUERADE ???

    e vc naum precisa dessas regras:
    #As redes 10.1.1.0 e 10.1.2.0 NAO navegarao pelo gw 10.1.3.250
    iptables -t nat -A PREROUTING -s 10.1.1.0/24 -o 10.1.3.250 -j REJECT
    iptables -t nat -A PREROUTING -s 10.1.2.0/24 -o 10.1.3.250 -j REJECT

    #A rede 10.1.3.0 navegara pelo gw 10.1.3.250
    iptables -t nat -A PREROUTING -s 10.1.3.0/24 -o 10.1.3.250 -j ACCEPT

    sua firewall soh estara pronta se for soh isso q vc quer fazer

    q recurso a mais vc deseja ativar?

    []`s