Visualizzazione dei risultati da 1 a 3 su 3
  1. #1

    Problema con firewall iptables

    Il firewall è così configurato
    iptables -L
    Chain INPUT (policy DROP)
    target prot opt source destination
    ACCEPT all -- loopback/8 anywhere
    ACCEPT all -- localnet/24 anywhere
    ACCEPT tcp -- anywhere anywhere tcp dpt:http flags:SYN,RST,ACK/SYN
    ACCEPT tcp -- anywhere anywhere tcp dpt:ssh flags:SYN,RST,ACK/SYN
    ACCEPT icmp -- anywhere anywhere icmp echo-request limit: avg 1/sec burst 5
    ACCEPT icmp -- anywhere anywhere icmp echo-reply
    DROP udp -- anywhere anywhere state NEW
    DROP tcp -- anywhere anywhere tcp flags:!SYN,RST,ACK/SYN state NEW
    ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED

    Chain FORWARD (policy DROP)
    target prot opt source destination
    ACCEPT icmp -- anywhere anywhere icmp echo-request limit: avg 5/sec burst 5
    ACCEPT all -- localnet/24 anywhere
    ACCEPT all -- anywhere localnet/24
    DROP all -- anywhere anywhere

    Chain OUTPUT (policy ACCEPT)
    target prot opt source destination

    Eppure non funziona,dall'esterno dice che tutte le porte sono aperte....
    Dove sbaglio?

  2. #2
    scusa, giusto 2 informazioni:

    - CHI o COSA dice che dall'esterno le porte sono "tutte aperte"?

    - Qual'è il tuo obiettivo? quali servizi vuoi lasciare accessibili?


    p.s.

    dalle tue regole sembra che accetti http, ssh, ping e connessioni stabilite da dentro a fuori... (e tutto quello che viene dalla LAN presumo)


    p.s.2 come si pronuncia il tuo nome?
    Ci sono cose che non si possono sapere. Per tutto il resto c'è man

    Prima di fare domande stupide: 1) googla 2) leggi le manpages 3) sparati.

  3. #3
    ho un pc con 2 interfaccie di rete, una interna con ip di classe C (eth0) e una che si affaccia su internet con ip pubblico (eth1).
    Con questo firewall

    #!/bin/sh

    echo "1" > /proc/sys/net/ipv4/ip_forward
    #modprobe iptables
    modprobe iptable_mangle
    modprobe ip_conntrack
    modprobe ipt_conntrack
    modprobe iptable_nat
    modprobe ipt_MASQUERADE
    modprobe ipt_TOS
    modprobe ipt_mark
    modprobe ipt_tos
    modprobe ipt_ecn
    modprobe ipt_dscp
    modprobe ipt_ttl
    modprobe ip_nat_irc

    iptables -F INPUT
    iptables -F OUTPUT
    iptables -F FORWARD


    iptables -A INPUT -s 127.0.0.1/8 -j ACCEPT
    iptables -A INPUT -i eth0 -s 10.0.0.0/255.255.255.0 -j ACCEPT

    iptables -A INPUT -i eth1 -s 0/0 -p tcp --syn --dport http -j ACCEPT
    iptables -A INPUT -i eth1 -s 0/0 -p tcp --syn --dport ssh -j ACCEPT

    iptables -A INPUT -p icmp -m icmp --icmp-type 8 -m limit --limit 1/s -j ACCEPT

    iptables -A INPUT -p icmp --icmp-type echo-reply -j ACCEPT

    iptables -A INPUT -p udp -m state --state NEW -j DROP

    iptables -A INPUT -p tcp ! --syn -m state --state NEW -j DROP

    iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

    iptables -P INPUT DROP
    iptables -A FORWARD -p icmp -m icmp --icmp-type 8 -m limit --limit 5/s -j ACCEPT

    iptables -t nat -A POSTROUTING -d ! 10.0.0.0/24 -j MASQUERADE
    iptables -A FORWARD -s 10.0.0.0/24 -j ACCEPT
    iptables -A FORWARD -d 10.0.0.0/24 -j ACCEPT
    iptables -A FORWARD -j DROP

    iptables -P FORWARD DROP

    # OUTPUT CHAIN
    iptables -P OUTPUT ACCEPT

    teoricamente dovrei ottenere che dall'esterno sia possibile collegarsi solo alle porte web e ssh invece risultano tutte aperte ma non capisco dove sia il problema....

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.