Jump to content

Recommended Posts

Posted

Editaremos el kernel, escribimos esto en consola:

ee /usr/src/sys/i386/conf/GENERIC
vamos al final y escribimos esto:

#PF Firewall
device		  pf					 
device		  pflog				  
device		  pfsync
options    IPFIREWALL
options    IPFIREWALL_VERBOSE
options    IPFIREWALL_VERBOSE_LIMIT=1000
options    IPDIVERT
options IPFIREWALL_DEFAULT_TO_ACCEPT
options    ALTQ
options    ALTQ_CBQ
options    ALTQ_RED
options    ALTQ_RIO
options    ALTQ_HFSC
options    ALTQ_PRIQ
options    ALTQ_NOPCC

ahora compilaremos kernel, escriben esto:

cd /usr/src
make buildkernel KERNCONF=GENERIC
cuando les permita escribir denuevo ponene esto
cd /usr/src
make installkernel KERNCONF=GENERIC

ahora vamos a editar el rc.conf, en la maquina ponemos:

ee /etc/rc.conf
vamos al final y colocamos esto:

pf_enable="YES"  
pflogd_enable="YES"
pflog_logfile="/var/log/pflog"
pf_rules="/etc/pf.conf"
gateway_enable="YES"
firewall_enable="YES"
firewall_script="/etc/firewall.rules"
ahora apretan esc y teclian dos veses para guardar cambios

 

 

 

ahora creamos en etc un archivo llamado firewall.rules y colocamos esto:

IPF="ipfw -q add"
ipfw -q -f flush
##Custom-Rules
#P2P Ports
$IPF 4 allow all from me to any 14000
$IPF 5 allow all from 127.0.0.0/8 to any 14000
$IPF 6 deny all from any to me 14000
$IPF 7 allow all from me to any 14001
$IPF 8 allow all from 127.0.0.0/8 to any 14001
$IPF 9 deny all from any to me 14001
$IPF 10 allow all from me to any 14099
$IPF 11 allow all from 127.0.0.0/8 to any 14099
$IPF 12 deny all from any to me 14099
$IPF 13 allow all from me to any 12000
$IPF 14 allow all from 127.0.0.0/8 to any 12000
$IPF 15 deny all from any to me 12000
#Game Ports
$IPF 16 allow all form any to me 11002
$IPF 17 allow all from any to me 13000
$IPF 18 allow all from any to me 13001
$IPF 19 allow all from any to me 13099
#Dienste
$IPF 20 allow all from any to me 3306
$IPF 21 allow all from any to me 80
$IPF 22 allow all from any to me 21
##Standart Regeln
$IPF 10000 allow all from any to any via lo0
$IPF 20000 deny all from any to 127.0.0.0/8
$IPF 30000 deny all from 127.0.0.0/8 to any
$IPF 40000 allow all from any to any

ahora creamos uno llamado pc.conf y metemos esto

### INTERFACES ###
if = "{ em0 }"
#Intra
table <intranet> { 127.0.0.1 }
pass in quick from <intranet> to any keep state
#Network
table <network> persist
block quick from <network>
pass in on $if proto tcp from any to any \
keep state (max-src-conn 100, max-src-conn-rate 15/1, \
overload <network> flush global)

ahora para cargarlos hacemos lo siguiente

pfctl -f /etc/pf.conf

en /var/log/ crean un archivo llamado pflog (sin extension) y en var/db/ un archivo llamado blacklist

 

Listo dan reboot y todo andando :) saludos y espero que les sirva!

Posted

Apuesto que nadie habia notado un error en la syntasis jejeje bueno aqui les dejo el error y su correxion

 

$IPF 16 allow all form any to me 11002

form lo cambiamos a from

 

y la verdad si usan hamachi o no ip mal configurado no se los recomiendo es una cagazon que el firewall les blockee y tengan que reiniciar a cada rato experiencia propia

esta guia si funciona el del packet filter no es bueno no se los recomiendo usen el de shotgun combinado con esto uff los hacker no entraran con apitool pero buena guia men santo

 

cuando aigan empacketado todo el firewaall con estota regla les debe de desir firewall loader si no dise no esta bien intalado

Posted

He mirado más detenidamente y la guia tiene varios errores

 

Editaremos el kernel, escribimos esto en consola:

ee /usr/src/sys/i386/conf/GENERIC

 

Esta ruta varía según tu versión además de que compilar el kernel con ALTQ es innecesario.

 

en /var/log/ crean un archivo llamado pflog (sin extension) y en var/db/ un archivo llamado blacklist

 

blacklist? para que?

 

 

 

Más errores, no activas el antispoof ni la normalización de paquetes y divides las reglas entre ipfw y pf.conf además de que tus límites de conexión son altísimos (100 conexiones por IP?)

 

Sinceramente no recomiendo esta configuración, si vasa tocar el kernel activa el Device Polling, eso si es útil.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

This site uses cookies to enhance your browsing experience and provide relevant content. By continuing to browse, you agree to our We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. and Terms of Use. For more information on how we protect your data, please check our Privacy Policy.