+ Responder ao Tópico



  1. #1
    andrelay
    Visitante

    Padrão Liberar FTP

    Olá Pessoal,

    Preciso liberar o meu acesso ftp, num manjo nada de iptables, ai estao as regras:

    Table: mangle
    Chain PREROUTING (policy ACCEPT)
    target prot opt source destination
    TOS tcp -- anywhere anywhere tcp sptop3 TOS set Minimize-Delay
    TOS tcp -- anywhere anywhere tcp spt:smtp TOS set Minimize-Delay
    TOS tcp -- anywhere anywhere tcp spt:http TOS set Maximize-Throughput

    Chain INPUT (policy ACCEPT)
    target prot opt source destination

    Chain FORWARD (policy ACCEPT)
    target prot opt source destination

    Chain OUTPUT (policy ACCEPT)
    target prot opt source destination
    TOS tcp -- anywhere anywhere tcp dpt:smtp TOS set Minimize-Delay
    TOS tcp -- anywhere anywhere tcp dptop3 TOS set Minimize-Delay
    TOS tcp -- anywhere anywhere tcp dpt:http TOS set Maximize-Throughput

    Chain POSTROUTING (policy ACCEPT)
    target prot opt source destination
    Table: nat
    Chain PREROUTING (policy ACCEPT)
    target prot opt source destination
    DNAT tcp -- anywhere 200-204-194-182.dsl.telesp.net.brtcp dpt:3389 to:192.168.0.92

    Chain POSTROUTING (policy ACCEPT)
    target prot opt source destination
    MASQUERADE all -- 192.168.0.50 anywhere
    MASQUERADE all -- 192.168.0.100 anywhere
    MASQUERADE tcp -- anywhere anywhere tcp dpt:smtp
    MASQUERADE tcp -- anywhere anywhere tcp dptop3
    MASQUERADE tcp -- 192.168.0.0/24 hm165.locaweb.com.br
    MASQUERADE tcp -- 192.168.0.0/24 ftpav.ca.com
    MASQUERADE tcp -- 192.168.0.0/24 www.grisoft.cz
    MASQUERADE all -- 192.168.0.223 anywhere

    Chain OUTPUT (policy ACCEPT)
    target prot opt source destination
    Table: filter
    Chain INPUT (policy ACCEPT)
    target prot opt source destination
    ACCEPT tcp -- anywhere anywhere tcp dpt:ftp flags:SYN,RST,ACK/SYN
    ACCEPT udp -- anywhere anywhere udp dpt:domain
    ACCEPT tcp -- anywhere anywhere tcp dpt:domain
    ACCEPT udp -- anywhere anywhere udp dpt:domain
    ACCEPT tcp -- anywhere anywhere tcp dpt:domain
    ACCEPT udp -- anywhere anywhere udp dpt:domain
    ACCEPT tcp -- anywhere anywhere tcp dpt:domain
    ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
    ACCEPT tcp -- anywhere anywhere tcp dpt:ftp
    ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
    ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED

    Chain FORWARD (policy ACCEPT)
    target prot opt source destination
    DROP all -- anywhere anywhere unclean
    DROP icmp -- anywhere anywhere icmp echo-request
    ACCEPT icmp -- anywhere anywhere icmp echo-request limit: avg 1/sec burst 5
    ACCEPT tcp -- anywhere anywhere limit: avg 1/sec burst 5
    ACCEPT tcp -- anywhere anywhere tcp flags:FIN,SYN,RST,ACK/RST limit: avg 1/sec burst 5
    ACCEPT all -- 192.168.0.0/24 anywhere

    Chain OUTPUT (policy ACCEPT)
    target prot opt source destination

    Preciso liberar o acesso FTP a um servidor externo a rede.

    Obrigado =?)

  2. #2

    Padrão Liberar FTP

    Baixa o guia-foca e da uma estudada ae =)
    http://focalinux.cipsga.org.br/

    Mexer com iptables não é dificil como parece.

  3. #3
    Kablu
    Visitante

    Padrão script

    Manda o script do seu firewall pra gente ver... com o resultado do list num da pra saber muito.

    Até! :good:

  4. #4

    Padrão Re: Liberar FTP

    iptables -A INPUT -p tcp --destination-port 21 -j ACCEPT

  5. #5
    Kablu
    Visitante

    Padrão nananao

    Opa,

    gatoseco, ele ja tem a porta ftp liberada nas regras...

    veja la

    ACCEPT tcp -- anywhere anywhere tcp dpt:ftp
    deve ser alguma regra restritiva que esta bloqueando ela depois

    até :good:

  6. #6

    Padrão Re: nananao

    pois e o certo seria ele postar o script que ta usando fica mais facil de verificar !!!

  7. #7
    Newton_Pasqualini
    Visitante

    Padrão Liberar FTP

    Está faltando uma regra de estado de conexão e uma liberando as portas 20 (autenticação FTP) e 21 (transf. de dados).

    iptables -t filter -A INPUT -p tcp -m multiport --dports 20,21 -j ACCEPT
    iptables -t filter -A INPUT -p tcp -m state --state RELATED,ESTABLISHED -j ACCEPT

    Abs