Firewall Linux
ESCENARIO 1: Una sola maquina conectada como cliente a Internet.
Las reglas a Implantar son:
1. Elimine todas las reglas de todas las cadenas:
# iptables -F
# iptables-F -t nat
2. Cambie la política por defecto a DENEGAR :
# iptables -P INPUT DROP
# iptables -P OUTPUT DROP
# iptables -P FORWARD DROP
Verificamos los cambias en la política:
# iptables –LChain INPUT (policy DROP)
target prot opt source
destination
Chain FORWARD (policy DROP)
target prot opt source
destination
Chain OUTPUT (policy DROP)
target prot opt source
destination Comprobamos si tenemos acceso a Internet a través de un navegador.
3. Permita todo el trafico saliente desde el localhost:
# iptables -A OUTPUT -o lo -d 127.0.0.1 -j ACCEPT
4. Permita todo eltráfico saliente originado en el Firewall (“Nro. IP HOST”) a cualquier lugar
de la Internet:
# iptables -A OUTPUT -o eth0 -s {IP-SERVIDOR} -d 0/0 -j ACCEPT
.
Verificamos:
# iptables –L
Página 1de 5
Profesor: JUAN HUAPAYA VASQUEZ
Gestión de Servidores
Chain INPUT (policy DROP)
target prot opt source
destination
Chain FORWARD (policy DROP)
target prot opt sourcedestination
Chain OUTPUT (policy DROP)
target prot opt source
destination
ACCEPT all -- anywhere
127.0.0.1
ACCEPT all -- {IP-SERVIDOR} anywhere
5. Permita todo el tráfico entrante relacionado con algunaconexión establecida.
# iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
Verificamos:
# iptables -L
Chain INPUT (policy DROP)
target prot opt source
ACCEPT all -- anywheredestination
anywhere
state RELATED,ESTABLISHED
Chain FORWARD (policy DROP)
target prot opt source
destination
Chain OUTPUT (policy DROP)
target prot opt source
destination
ACCEPT all --anywhere
127.0.0.1
ACCEPT all -- IP-SERVIDOR} anywhere
6. Lanzar el navegador y comprobar el acceso a Internet.
ELABORACION DE SCRIPT AUTOMATICO
Un script, es un archivo que permite guardar...
Regístrate para leer el documento completo.