[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Regole del firewall



-FrA- wrote:

paolo wrote:


0 ACCEPT tcp -- eth2 any anywhere anywhere tcp dpt:ssh


OK, anche se a dir la verit� se � per una LAN casalinga io lascierei
entrare in input qualsiasi cosa dalle tue due LAN.
Si, in effetti volevo fare quello...
se sto iniziando a capire qualcosa il risultato dovrebbe essere qualcosa del genere no?:

###########################
#GATEWAY
###########################
#-------------------------------------------
#interfaccia internet,path iptables e sottoreti
#-------------------------------------------
INT="eth0"
IPT="/sbin/iptables"
NET1="192.168.1.0/24"
NET2="192.168.2.0/24"
#-------------------------------------------
#Moduli del kernel
#-------------------------------------------
modprobe iptable_nat
echo 1 > /proc/sys/net/ipv4/ip_forward
echo 1 > /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses
echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
#-------------------------------------------
#Regole di masquerade
#-------------------------------------------
$IPT -t nat -A POSTROUTING -s $NET1 -o $INT -j MASQUERADE
$IPT -t nat -A POSTROUTING -s $NET2 -o $INT -j MASQUERADE
###########################
#FIREWALL
###########################
#-------------------------------------------
#ComportamentO di default per i pacchetti in entrata, uscita e transito
#-------------------------------------------
$IPT -P INPUT DROP -o $INT
$IPT -P FORWARD DROP -o $INT
$IPT -P OUTPUT ACCEPT -o $INT
#-------------------------------------------
#Transito dei pacchetti richiesti o provenienti dalla rete interna
#-------------------------------------------
$IPT -A FORWARD -s $NET1 -j ACCEPT
$IPT -A FORWARD -s $NET2 -j ACCEPT
$IPT -A FORWARD -m state --state ESTBALISHED,RELATED -j ACCEPT
#-------------------------------------------
#Ping
#-------------------------------------------
$IPT -A INPUT -p icmp -j ACCEPT
#-------------------------------------------
#ssh
#-------------------------------------------
$IPT -A INPUT -i eth0 -p tcp -m tcp --dport 22 -s 5.8.xxx.xx -j ACCEPT


Guardate, mi rispondo da solo, è sbagliato. Mi sto leggendo tutta la guida, credo che fonderò, ma se così non fosse mi farò risentire :-)
a presto (spero)

--
www.debianizzati.org

Per favore non mandarmi allegati Word o PowerPoint.
Puoi utilizzare formati come pdf, html o testo semplice.
Per maggiori informazioni visita:http://www.fsf.org/philosophy/no-word-attachments.it.html

                                -----

Please avoid sending me Word or PowerPoint attachments.
You can use formats like pdf, html or plain text
For more information see:http://www.fsf.org/philosophy/no-word-attachments.html



Reply to: