+ Responder ao Tópico



  1. Pessoal,

    Sou novo em firewall e estou tendo problemas em abrir determinadas portas depois que carrego o firewall.

    Depois que carrego o script abaixo, não consigo mais pingar para o micro e para fora do micro nem usar os serviços de ssh, pop, www, etc

    Alguém pode me ajudar? estou usando o freebsd 4.10

    Segue um exemplo do script:

    # set these to your outside interface network and netmask and ip
    oif="vr0:"
    onet="192.168.0.0"
    omask="255.255.255.0"
    oip="192.168.0.230"

    # set these to your inside interface network and netmask and ip
    iif="fxp0:"
    inet="192.168.1.0"
    imask="255.255.255.0"
    iip="192.168.1.1"

    setup_loopback

    # Stop spoofing
    ${fwcmd} add deny all from ${inet}:${imask} to any in via ${oif}
    ${fwcmd} add deny all from ${onet}:${omask} to any in via ${iif}

    # Stop RFC1918 nets on the outside interface
    ${fwcmd} add deny all from any to 10.0.0.0/8 via ${oif}
    ${fwcmd} add deny all from any to 172.16.0.0/12 via ${oif}
    ${fwcmd} add deny all from any to 192.168.0.0/16 via ${oif}

    # Stop draft-manning-dsua-03.txt (1 May 2000) nets (includes RESERVED-1,
    # DHCP auto-configuration, NET-TEST, MULTICAST (class D), and class E)
    # on the outside interface
    ${fwcmd} add deny all from any to 0.0.0.0/8 via ${oif}
    ${fwcmd} add deny all from any to 169.254.0.0/16 via ${oif}
    ${fwcmd} add deny all from any to 192.0.2.0/24 via ${oif}
    ${fwcmd} add deny all from any to 224.0.0.0/4 via ${oif}
    ${fwcmd} add deny all from any to 240.0.0.0/4 via ${oif}

    # Network Address Translation. This rule is placed here deliberately
    # so that it does not interfere with the surrounding address-checking
    # rules. If for example one of your internal LAN machines had its IP
    # address set to 192.0.2.1 then an incoming packet for it after being
    # translated by natd(8) would match the `deny' rule above. Similarly
    # an outgoing packet originated from it before being translated would
    # match the `deny' rule below.
    case ${natd_enable} in
    [Yy][Ee][Ss])
    if [ -n "${natd_interface}" ]; then
    ${fwcmd} add divert natd all from any to any via ${natd_
    interface}
    fi
    ;;
    esac

    # Stop RFC1918 nets on the outside interface
    ${fwcmd} add deny all from 10.0.0.0/8 to any via ${oif}
    ${fwcmd} add deny all from 172.16.0.0/12 to any via ${oif}
    ${fwcmd} add deny all from 192.168.0.0/16 to any via ${oif}

    # Stop draft-manning-dsua-03.txt (1 May 2000) nets (includes RESERVED-1,
    # DHCP auto-configuration, NET-TEST, MULTICAST (class D), and class E)
    # on the outside interface
    ${fwcmd} add deny all from 0.0.0.0/8 to any via ${oif}
    ${fwcmd} add deny all from 169.254.0.0/16 to any via ${oif}
    ${fwcmd} add deny all from 192.0.2.0/24 to any via ${oif}
    ${fwcmd} add deny all from 224.0.0.0/4 to any via ${oif}
    ${fwcmd} add deny all from 240.0.0.0/4 to any via ${oif}

    # Allow TCP through if setup succeeded
    ${fwcmd} add pass tcp from any to any established

    #Checa o estado da conexao
    ${fwcmd} add check-state
    ${fwcmd} add allow tcp from ${inet}:${imask} to any setup

    ${fwcmd} add allow udp from ${inet}:${imask} to any

    #Permite requisicoes DNS pelo localhost
    ${fwcmd} add allow tcp rfom 127.0.0.1 to any 53
    ${fwcmd} add allow tcp from any to 127.0.0.1 53

    # Allow IP fragments to pass through
    ${fwcmd} add pass all from any to any frag

    #Permite qualquer tr\xe1fego para ou de minha rede
    ${fwcmd} add allow all from ${iip} to ${inet}:${imask}
    ${fwcmd} add allow all from ${iip} to ${onet}:${omask}
    ${fwcmd} add allow all from ${inet}:${imask} to ${oip}
    ${fwcmd} add allow all from ${inet}:${imask} to ${iip}
    ${fwcmd} add allow all from ${inet}:${imask} to any

    #Permite passar SSH internet e rede local
    ${fwcmd} add pass tcp from any to 192.168.0.250 22 setup
    ${fwcmd} add pass tcp from any to 192.168.0.250 22
    ${fwcmd} add pass tcp from any to ${oip} 22 setup
    ${fwcmd} add pass tcp from any to ${iip} 22 setup
    ${fwcmd} add pass tcp from ${oip} to any 22
    ${fwcmd} add pass tcp from ${iip} to any 22

    #Allow ICMP through
    ${fwcmd} add pass icmp from 192.168.0.0/24 to ${iip}
    ${fwcmd} add pass icmp from 192.168.0.0/24 to ${oip}
    ${fwcmd} add pass icmp from ${inet}:${imask} to ${iip}
    ${fwcmd} add pass icmp from ${inet}:${imask} to ${oip}
    ${fwcmd} add pass icmp from ${inet}:${imask} to any via ${iip}
    ${fwcmd} add pass icmp from ${inet}:${imask} to any via ${oip}



    ${fwcmd} add pass icmp from any to ${oip} via ${oif} icmptypes 0,3,4,8,11,12
    ${fwcmd} add pass icmp from any to ${oip} via ${iif} icmptypes 0,3,4,8,11,12
    ${fwcmd} add pass icmp from any to ${iip} via ${oif} icmptypes 0,3,4,8,11,12
    ${fwcmd} add pass icmp from any to ${iip} via ${iif} icmptypes 0,3,4,8,11,12

    # Allow setup of incoming email
    ${fwcmd} add pass tcp from any to ${oip} 25 setup
    ${fwcmd} add pass tcp from any to ${iip} 25 setup
    ${fwcmd} add pass udp from any to ${oip} 25
    ${fwcmd} add pass udp from any to ${iip} 25
    #Permite o checagem de POP3
    ${fwcmd} add pass tcp from any to ${oip} 110 setup
    ${fwcmd} add pass tcp from any to ${iip} 110 setup


    # Allow access to our DNS
    ${fwcmd} add pass tcp from any to any 53
    ${fwcmd} add pass udp from any to any 53
    ${fwcmd} add pass tcp from any to ${oip} 53 setup
    ${fwcmd} add pass udp from any to ${oip} 53
    ${fwcmd} add pass udp from ${oip} 53 to any

    ${fwcmd} add pass tcp from any to ${iip} 53 setup
    ${fwcmd} add pass udp from any to ${iip} 53
    ${fwcmd} add pass udp from ${iip} 53 to any

    # Allow access to our WWW via fdx0
    ${fwcmd} add pass tcp from any to ${oip} 80 setup
    ${fwcmd} add pass udp from any to ${oip} 80
    ${fwcmd} add pass tcp from any to ${iip} 80 setup
    ${fwcmd} add pass tcp from any to ${iip} 80


    # Reject&Log all setup of incoming connections from the outside
    ${fwcmd} add deny log tcp from any to any in via ${oif} setup

    # Allow setup of any other TCP connection
    ${fwcmd} add pass tcp from any to any setup

    # Allow DNS queries out in the world
    ${fwcmd} add pass udp from ${oip} to any 53 keep-state

    # Allow NTP queries out in the world
    ${fwcmd} add pass udp from ${oip} to any 123 keep-state

    # Everything else is denied by default, unless the
    # IPFIREWALL_DEFAULT_TO_ACCEPT option is set in your kernel
    # config file.
    ;;

  2. essas configurações de placa (vr0, fx0) correspondem às suas placas mesmo? Se não corresponderem, nada funciona.

    um basicão bem basicão:

    IGNORE (em termos) tudo o que está ANTES do check-state, concentre-se no que está depois..

    esse é um fwll fechado por natureza, então vc deve ter qualquer coisa assim como:

    add allow from any to any port xx setup keep-state

    para cada um dos serviços que vc quer que trafeguem

    ${fwcmd} add allow all from ${iip} to ${inet}:${imask}

    aqui há um preciosismo meio exagerado, uma vez que define que o que vier da rede interna pode seguir para ip/mascara..

    melhor revisar suas regras.. essas aí são complexas demais pra nós, principiantes, o que não quer dizer que sejam melhores. Procure na lista do fugsp-br (http://www4.fugspbr.org/lista/cgi-bi...mal&sort=score)

    e procure entender o que é que a galera tá falando lá
    :twisted:

    divirta-se






Tópicos Similares

  1. Continua o problema com rota
    Por redoctober no fórum Servidores de Rede
    Respostas: 13
    Último Post: 08-11-2002, 13:04
  2. Problema com os log do Apache
    Por Good_speed no fórum Servidores de Rede
    Respostas: 1
    Último Post: 28-10-2002, 08:51
  3. Problemas com Perl
    Por adcorp no fórum Servidores de Rede
    Respostas: 1
    Último Post: 17-08-2002, 11:52
  4. Problema com o ssh pelo windows !!!
    Por embbr no fórum Servidores de Rede
    Respostas: 1
    Último Post: 01-07-2002, 18:10
  5. problemas com o IMP
    Por marlonfuchs no fórum Servidores de Rede
    Respostas: 0
    Último Post: 27-06-2002, 08:13

Visite: BR-Linux ·  VivaOLinux ·  Dicas-L