glug: Ancora sul firewall
- FrA -
jango@despammed.com
Ven 3 Giu 2005 13:39:52 CEST
ho cercato di aggiungere al mio file /etc/init.d/firewall le regole date
da takke sul wiki.
questo č il risultato che, tuttavia, non funziona:
#Firewall
#-------------------------------------------
#interfaccia internet,path iptables e sottoreti
#-------------------------------------------
EXT_INT="eth0"
IPTABLES="/sbin/iptables"
INTERNAL_NET1="192.168.1.0/24"
INTERNAL_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
#-------------------------------------------
$IPTABLES -t nat -A POSTROUTING -s $INTERNAL_NET1 -o $EXT_INT -j MASQUERADE
$IPTABLES -t nat -A POSTROUTING -s $INTERNAL_NET2 -o $EXT_INT -j MASQUERADE
#-------------------------------------------
#Comportamento di default per i pacchetti in entrata, uscita e transito
#-------------------------------------------
$IPTABLES -P INPUT DROP
$IPTABLES -P FORWARD DROP
$IPTABLES -P OUTPUT ACCEPT
#-------------------------------------------
#Transito dei pacchetti richiesti o provenienti dalla rete interna
#-------------------------------------------
$IPTABLES -A FORWARD -s $INTERNAL_NET1 -j ACCEPT
$IPTABLES -A FORWARD -s $INTERNAL_NET1 -j ACCEPT
$IPTABLES -A FORWARD -m state --state ESTALISHED,RELATED -j ACCEPT
#-------------------------------------------
#Ping
#-------------------------------------------
$IPTABLES -A INPUT -i lo -p icmp -j ACCEPT
$IPTABLES -A INPUT -i eth0 -p icmp -j ACCEPT
$IPTABLES -A INPUT -i eth1 -p icmp -j ACCEPT
$IPTABLES -A INPUT -i eth2 -p icmp -j ACCEPT
#-------------------------------------------
#ssh
#-------------------------------------------
$IPTABLES -A INPUT -i eth0 -p tcp -m tcp --dport 22 -s 5.8.xxx.xx -j ACCEPT
$IPTABLES -A INPUT -i eth1 -p tcp -m tcp --dport 22 -j ACCEPT
$IPTABLES -A INPUT -i eth2 -p tcp -m tcp --dport 22 -j ACCEPT
ssh funziona, ma sia i client che il "GW" non riescono a pingare in
internet => navigare etc.
in pių non ho capito perchč, in queste ultime 2 righe, suggerisse
l'opzione -s ip0/24. dato che sono le schede della rete interna non sono
sicure per definizione?
Grazie e scusate il martellamento...
--
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
Maggiori informazioni sulla lista
glug