Algunas páginas que puedes leer y que te recomiendo
http://es.tldp.org/Manuales-LuCAS/doc-iptables-firewall/doc-iptables-firewall-html/
http://dns.bdat.net/documentos/cortafuegos/t1.html
http://iptables-tutorial.frozentux.net/spanish/
buena suerte... :P
From: [email protected]
To: [email protected]
Date: Thu, 30 Jul 2009 11:56:33 -0400
Subject: [l-plug] opinion sobre mi configuracion de iptables para squid
(funciona)
Hola.
Quisiera que me pudieran ayudar comentándome las líneas que
tengo en el iptables ya que no las entiendo. (las copie de una pagina para
poder hacer funcionar mi Proxy transparente y hasta el momento todo ok) pero
quisiera entender un poco mas que hace cada regla.
Se los agradecería en el alma.
#IP del servidor Squid
SQUID_SERVER="192.168.1.1"
#Tarejeta conectada a internet
INTERNET="eth1"
#Tarjeta wifi
LAN_IN="eth0"
#Tarjeta red laboratorio
LAN_IN_2="eth2"
#Puerto del Squid
SQUID_PORT="3128"
#Limpiar reglas firewall
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
#habilitar bit de
forwarding
echo 1 >
/proc/sys/net/ipv4/ip_forward
# Definir reglas por defecto
iptables -P INPUT DROP
iptables -P OUTPUT ACCEPT
# Acceso ilimitado para interfaz de
loop back
iptables -A INPUT -i lo
-j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
#Permitir UDP, DNS
iptables -A INPUT -i
$INTERNET -m state --state ESTABLISHED,RELATED -j ACCEPT
# Definir el proxy como gateway para
las redes
iptables --table nat
--append POSTROUTING --out-interface $INTERNET -j MASQUERADE
iptables --append FORWARD
--in-interface $LAN_IN -j ACCEPT "
iptables --append FORWARD
--in-interface $LAN_IN_2 -j ACCEPT
# Acceso ilimitado a las
redes
iptables -A INPUT -i
$LAN_IN -j ACCEPT
iptables -A INPUT -i
$LAN_IN_2 -j ACCEPT
# Cualquier petición hacia el puerto
80 (servicio HTTP) hecha desde la red local hacia el exterior, se
re-direccionará hacia el puerto 3128 del servidor.(Reglas para las dos redes)
iptables -t nat -A
PREROUTING -i $LAN_IN -p tcp --dport 80 -j DNAT --to $SQUID_SERVER:$SQUID_PORT
iptables -t nat -A
PREROUTING -i $LAN_IN_2 -p tcp --dport 80 -j DNAT --to
$SQUID_SERVER:$SQUID_PORT
# Rechazar el resto y crear log
iptables -A INPUT -j LOG
iptables -A INPUT -j DROP
_________________________________________________________________
Invite your mail contacts to join your friends list with Windows Live Spaces.
It's easy!
http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us
_______________________________________________
Lista de correo Linux-plug
Temática: Discusión general sobre Linux
Peruvian Linux User Group (http://www.linux.org.pe)
Participa suscribiéndote y escribiendo a: [email protected]
Para darte de alta, de baja o hacer ajustes a tu suscripción visita:
http://listas.linux.org.pe/mailman/listinfo/linux-plug
IMPORTANTE: Reglas y recomendaciones
http://www.linux.org.pe/listas/reglas.php
http://www.linux.org.pe/listas/comportamiento.php
http://www.linux.org.pe/listas/recomendaciones.php