diseño de un firewall con herramientas de software libre

45
FIREWALL CON SOFTWARE LIBRE (DHCP, IPTABLES, SQUID, VSFTPD y SELINUX) Remigio Salvador S´ anchez COSIT 2012 [email protected] COSIT 2012 COATZACOALCOS

Upload: remigio-salvador-sanchez

Post on 28-May-2015

442 views

Category:

Education


2 download

DESCRIPTION

Slide del taller "Diseño de un firewall con herramientas de software libre" presentado en el II Congreso Mexicano de la Sociedad de la Información y Conocimiento Libre (COSIT 2012) efectuado en Coatzacoalcos, Veracruz el día 30 de agosto del 2012.

TRANSCRIPT

Page 1: Diseño de un firewall con herramientas de software libre

FIREWALL CON SOFTWARE LIBRE(DHCP, IPTABLES, SQUID, VSFTPD y SELINUX)

Remigio Salvador Sanchez

COSIT 2012

[email protected] COSIT 2012 COATZACOALCOS

Page 2: Diseño de un firewall con herramientas de software libre

”Mensaje”

[email protected] COSIT 2012 COATZACOALCOS

Page 3: Diseño de un firewall con herramientas de software libre

Contenido

1.- Instalacion

2.- Configuracion

3.- IPTABLES

4.- DHCP

5.- SQUID

6.- VSFTPD

7.- SELINUX

8.- Recomendaciones

9.- Preguntas

[email protected] COSIT 2012 COATZACOALCOS

Page 4: Diseño de un firewall con herramientas de software libre

Contenido

1.- Instalacion

2.- Configuracion

3.- IPTABLES

4.- DHCP

5.- SQUID

6.- VSFTPD

7.- SELINUX

8.- Recomendaciones

9.- Preguntas

[email protected] COSIT 2012 COATZACOALCOS

Page 5: Diseño de un firewall con herramientas de software libre

Contenido

1.- Instalacion

2.- Configuracion

3.- IPTABLES

4.- DHCP

5.- SQUID

6.- VSFTPD

7.- SELINUX

8.- Recomendaciones

9.- Preguntas

[email protected] COSIT 2012 COATZACOALCOS

Page 6: Diseño de un firewall con herramientas de software libre

Contenido

1.- Instalacion

2.- Configuracion

3.- IPTABLES

4.- DHCP

5.- SQUID

6.- VSFTPD

7.- SELINUX

8.- Recomendaciones

9.- Preguntas

[email protected] COSIT 2012 COATZACOALCOS

Page 7: Diseño de un firewall con herramientas de software libre

Contenido

1.- Instalacion

2.- Configuracion

3.- IPTABLES

4.- DHCP

5.- SQUID

6.- VSFTPD

7.- SELINUX

8.- Recomendaciones

9.- Preguntas

[email protected] COSIT 2012 COATZACOALCOS

Page 8: Diseño de un firewall con herramientas de software libre

Contenido

1.- Instalacion

2.- Configuracion

3.- IPTABLES

4.- DHCP

5.- SQUID

6.- VSFTPD

7.- SELINUX

8.- Recomendaciones

9.- Preguntas

[email protected] COSIT 2012 COATZACOALCOS

Page 9: Diseño de un firewall con herramientas de software libre

Contenido

1.- Instalacion

2.- Configuracion

3.- IPTABLES

4.- DHCP

5.- SQUID

6.- VSFTPD

7.- SELINUX

8.- Recomendaciones

9.- Preguntas

[email protected] COSIT 2012 COATZACOALCOS

Page 10: Diseño de un firewall con herramientas de software libre

Contenido

1.- Instalacion

2.- Configuracion

3.- IPTABLES

4.- DHCP

5.- SQUID

6.- VSFTPD

7.- SELINUX

8.- Recomendaciones

9.- Preguntas

[email protected] COSIT 2012 COATZACOALCOS

Page 11: Diseño de un firewall con herramientas de software libre

Contenido

1.- Instalacion

2.- Configuracion

3.- IPTABLES

4.- DHCP

5.- SQUID

6.- VSFTPD

7.- SELINUX

8.- Recomendaciones

9.- Preguntas

[email protected] COSIT 2012 COATZACOALCOS

Page 12: Diseño de un firewall con herramientas de software libre

1.- INSTALACION

[email protected] COSIT 2012 COATZACOALCOS

Page 13: Diseño de un firewall con herramientas de software libre

Instalacion

[email protected] COSIT 2012 COATZACOALCOS

Page 14: Diseño de un firewall con herramientas de software libre

Instalacion

images/fedora16.png

[email protected] COSIT 2012 COATZACOALCOS

Page 15: Diseño de un firewall con herramientas de software libre

Instalacion

[email protected] COSIT 2012 COATZACOALCOS

Page 16: Diseño de un firewall con herramientas de software libre

Instalacion

[email protected] COSIT 2012 COATZACOALCOS

Page 17: Diseño de un firewall con herramientas de software libre

2.- CONFIGURACION

[email protected] COSIT 2012 COATZACOALCOS

Page 18: Diseño de un firewall con herramientas de software libre

Configuracion

Deshabilitar Selinux- vi /etc/selinux/config- setenforce 0

Parar servicios innecesarios- chkconfig ip6tables off- chkconfig sendmail off- chkconfig netfs off

Configurar nuestro hostname- vi /etc/sysconfig/network

[email protected] COSIT 2012 COATZACOALCOS

Page 19: Diseño de un firewall con herramientas de software libre

Configuracion

configurar tarjetas de red (eth0 y p1p1)- eth0 (ip dinamica)- pxxx (puente-LAN) (ip estatica 192.168.0.1)

less /etc/sysconfig/network-scripts/ifcfg-INTERNETless /etc/sysconfig/network-scripts/ifcfg-LAN

Habilitar desde el inicio:chkconfig network on

service network (start stop restart status)

[email protected] COSIT 2012 COATZACOALCOS

Page 20: Diseño de un firewall con herramientas de software libre

Configuracion

Activando el bit de forwarding-vi /etc/sysctl.confnet.ipv4.ip forward = 0

Ejecutar sysctl -p para que tome el cambio de inmediato

[email protected] COSIT 2012 COATZACOALCOS

Page 21: Diseño de un firewall con herramientas de software libre

3.- IPTABLES

[email protected] COSIT 2012 COATZACOALCOS

Page 22: Diseño de un firewall con herramientas de software libre

IPTABLES

iptables -Fiptables -t nat -Fiptables -P INPUT ACCEPTiptables -P OUTPUT ACCEPTiptables -P FORWARD ACCEPTiptables -t nat -A POSTROUTING -s 192.168.0.0/24 -jMASQUERADE

service iptables save/usr/libexec/iptables.init save

service iptables (start stop restart status)

chkconfig iptables on

[email protected] COSIT 2012 COATZACOALCOS

Page 23: Diseño de un firewall con herramientas de software libre

4.- DHCP

[email protected] COSIT 2012 COATZACOALCOS

Page 24: Diseño de un firewall con herramientas de software libre

DHCP

yum -y install dhcp

Archivo de configuracion:- vi /etc/dhcp/dhcpd.conf

[email protected] COSIT 2012 COATZACOALCOS

Page 25: Diseño de un firewall con herramientas de software libre

DHCP

/etc/sysconfig/dhcpdDHCPDARGS=”pxxx”

service dhcpd (start stop restart status)

tail -100 /var/log/messages

chkconfig dhcpd on

[email protected] COSIT 2012 COATZACOALCOS

Page 26: Diseño de un firewall con herramientas de software libre

5.- SQUID

[email protected] COSIT 2012 COATZACOALCOS

Page 27: Diseño de un firewall con herramientas de software libre

SQUID

yum -y install squid

vi /etc/squid/squid.conf

vi /etc/squid/PNP

vi /etc/squid/exts

service squid (start stop restart status)

chkconfig squid on

[email protected] COSIT 2012 COATZACOALCOS

Page 28: Diseño de un firewall con herramientas de software libre

3.- IPTABLES

[email protected] COSIT 2012 COATZACOALCOS

Page 29: Diseño de un firewall con herramientas de software libre

IPTABLES

iptables -t nat -A PREROUTING -i pXXX -p tcp –dport 80 -jREDIRECT –to-port 3128

service iptables save/usr/libexec/iptables.init save

service iptables (start stop restart status)

[email protected] COSIT 2012 COATZACOALCOS

Page 30: Diseño de un firewall con herramientas de software libre

5.- SQUID

[email protected] COSIT 2012 COATZACOALCOS

Page 31: Diseño de un firewall con herramientas de software libre

SQUID

tail /var/log/squid/access.logtail /var/log/messages

[email protected] COSIT 2012 COATZACOALCOS

Page 32: Diseño de un firewall con herramientas de software libre

6.- VSFTPD

[email protected] COSIT 2012 COATZACOALCOS

Page 33: Diseño de un firewall con herramientas de software libre

VSFTPD

yum -y install vsftpd

vi /etc/vsftpd/vsftpd.conf

touch /etc/vsftpd/chroot list

service vsftpd (start stop restart status)

chkconfig vsftpd on

[email protected] COSIT 2012 COATZACOALCOS

Page 34: Diseño de un firewall con herramientas de software libre

6.- SELINUX

[email protected] COSIT 2012 COATZACOALCOS

Page 35: Diseño de un firewall con herramientas de software libre

SELINUX

setenforce 1

setsebool -P ftp home dir 1

systemctl

[email protected] COSIT 2012 COATZACOALCOS

Page 36: Diseño de un firewall con herramientas de software libre

Contenido

8.- Recomendaciones

[email protected] COSIT 2012 COATZACOALCOS

Page 37: Diseño de un firewall con herramientas de software libre

RECOMENDACIONES

1.- DHCP

2.- IPTABLES

3.- SQUID

4.- vsFTPD

5.- Esto es solo la punta del Icebergsigue adelante, sigue aprendiendo ;)

[email protected] COSIT 2012 COATZACOALCOS

Page 38: Diseño de un firewall con herramientas de software libre

RECOMENDACIONES

1.- DHCP

2.- IPTABLES

3.- SQUID

4.- vsFTPD

5.- Esto es solo la punta del Icebergsigue adelante, sigue aprendiendo ;)

[email protected] COSIT 2012 COATZACOALCOS

Page 39: Diseño de un firewall con herramientas de software libre

RECOMENDACIONES

1.- DHCP

2.- IPTABLES

3.- SQUID

4.- vsFTPD

5.- Esto es solo la punta del Icebergsigue adelante, sigue aprendiendo ;)

[email protected] COSIT 2012 COATZACOALCOS

Page 40: Diseño de un firewall con herramientas de software libre

RECOMENDACIONES

1.- DHCP

2.- IPTABLES

3.- SQUID

4.- vsFTPD

5.- Esto es solo la punta del Icebergsigue adelante, sigue aprendiendo ;)

[email protected] COSIT 2012 COATZACOALCOS

Page 41: Diseño de un firewall con herramientas de software libre

RECOMENDACIONES

1.- DHCP

2.- IPTABLES

3.- SQUID

4.- vsFTPD

5.- Esto es solo la punta del Icebergsigue adelante, sigue aprendiendo ;)

[email protected] COSIT 2012 COATZACOALCOS

Page 42: Diseño de un firewall con herramientas de software libre

9.- Preguntas

[email protected] COSIT 2012 COATZACOALCOS

Page 43: Diseño de un firewall con herramientas de software libre

Preguntas

PreguntasDudas

Comentarios

[email protected]@remitos

http://vkn-side.blogspot.com

[email protected] COSIT 2012 COATZACOALCOS

Page 44: Diseño de un firewall con herramientas de software libre

Dedicado:A mi familia

yamigos

[email protected] COSIT 2012 COATZACOALCOS

Page 45: Diseño de un firewall con herramientas de software libre

Gracias:A los organizadores por las facilidades

ya ustedes por su atencion

[email protected] COSIT 2012 COATZACOALCOS