Mostrando entradas con la etiqueta pfsense. Mostrar todas las entradas
Mostrando entradas con la etiqueta pfsense. Mostrar todas las entradas

jueves, 20 de junio de 2013

Pfsense: Monitorear Squid via SNMP

Para monitoria Squid vía snmp en Pfsense es escenario realizar lo siguiente:

En Services > Proxy Server > General.

Agregar en Custom Options:


acl aclname snmp_community public 
snmp_access allow aclname

Luego de Reiniciar Squid el monitoreo deberá realizarse hacia el puerto 3401.

Los datos que se pueden obtener son los siguientes:


      <!-- Squid MIB OIDs -->
      <group name="squidCacheScalars" ifType="ignore">
        <mibObj oid=".1.3.6.1.4.1.3495.1.1.1"        instance="0"  alias="cacheSysVMsize"       type="Integer32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.1.2"        instance="0"  alias="cacheSysStorage"      type="Integer32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.1.3"        instance="0"  alias="cacheUptime"          type="TimeTicks" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.2.5.1"      instance="0"  alias="cacheMemMaxSize"      type="Integer32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.2.5.2"      instance="0"  alias="cacheSwapMaxSize"     type="Integer32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.2.5.3"      instance="0"  alias="cacheSwapHighWM"      type="Integer32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.2.5.4"      instance="0"  alias="cacheSwapLowWM"       type="Integer32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.3.1.1"      instance="0"  alias="cacheSysPageFaults"   type="Counter32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.3.1.2"      instance="0"  alias="cacheSysNumReads"     type="Counter32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.3.1.3"      instance="0"  alias="cacheMemUsage"        type="Integer32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.3.1.4"      instance="0"  alias="cacheCpuTime"         type="Integer32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.3.1.5"      instance="0"  alias="cacheCpuUsage"        type="Integer32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.3.1.6"      instance="0"  alias="cacheMaxResSize"      type="Integer32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.3.1.7"      instance="0"  alias="cacheNumObjCount"     type="Gauge32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.3.1.8"      instance="0"  alias="cacheCurrLRUExp"      type="TimeTicks" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.3.1.9"      instance="0"  alias="cacheCurrUnlinkReq"   type="Counter32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.3.1.10"     instance="0"  alias="cacheCurrUnusedFD"    type="Gauge32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.3.1.11"     instance="0"  alias="cacheCurrResFD"       type="Gauge32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.3.2.1.1"    instance="0"  alias="cacheClientHttpReq"   type="Counter32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.3.2.1.2"    instance="0"  alias="cacheHttpHits"        type="Counter32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.3.2.1.3"    instance="0"  alias="cacheHttpErrors"      type="Counter32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.3.2.1.4"    instance="0"  alias="cacheHttpInKb"        type="Counter32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.3.2.1.5"    instance="0"  alias="cacheHttpOutKb"       type="Counter32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.3.2.1.6"    instance="0"  alias="cacheIcpPktsSent"     type="Counter32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.3.2.1.7"    instance="0"  alias="cacheIcpPktsRecv"     type="Counter32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.3.2.1.8"    instance="0"  alias="cacheIcpKbSent"       type="Counter32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.3.2.1.9"    instance="0"  alias="cacheIcpKbRecv"       type="Counter32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.3.2.1.10"   instance="0"  alias="cacheServerRequests"  type="Integer32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.3.2.1.11"   instance="0"  alias="cacheServerErrors"    type="Integer32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.3.2.1.12"   instance="0"  alias="cacheServerInKb"      type="Counter32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.3.2.1.13"   instance="0"  alias="cacheServerOutKb"     type="Counter32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.3.2.1.14"   instance="0"  alias="cacheCurrentSwapSz"   type="Gauge32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.3.2.1.15"   instance="0"  alias="cacheClients"         type="Gauge32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.4.1.1"      instance="0"  alias="cacheEntries"         type="Gauge32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.4.1.2"      instance="0"  alias="cacheRequests"        type="Counter32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.4.1.3"      instance="0"  alias="cacheHits"            type="Counter32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.4.1.4"      instance="0"  alias="cachePendingHits"     type="Gauge32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.4.1.5"      instance="0"  alias="cacheNegativeHits"    type="Counter32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.4.1.6"      instance="0"  alias="cacheMisses"          type="Counter32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.4.1.7"      instance="0"  alias="cacheBlockGtHByName"  type="Counter32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.4.1.8"      instance="0"  alias="cacheAttRelLockEntr"  type="Counter32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.4.2.1"      instance="0"  alias="cacheFqdnEntries"     type="Gauge32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.4.2.2"      instance="0"  alias="cacheFqdnRequests"    type="Counter32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.4.2.3"      instance="0"  alias="cacheFqdnHits"        type="Counter32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.4.2.4"      instance="0"  alias="cacheFqdnPendHits"    type="Gauge32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.4.2.5"      instance="0"  alias="cacheFqdnNegHits"     type="Counter32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.4.2.6"      instance="0"  alias="cacheFqdnMisses"      type="Counter32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.4.2.7"      instance="0"  alias="cacheBlockGtHByAddr"  type="Counter32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.4.3.1"      instance="0"  alias="cacheDnsRequests"     type="Counter32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.4.3.2"      instance="0"  alias="cacheDnsReplies"      type="Counter32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.4.3.3"      instance="0"  alias="cacheDnsNumberServs"  type="Counter32" />
      </group>
      <group name="squidCacheMedianSvcTable" ifType="all">
        <mibObj oid=".1.3.6.1.4.1.3495.1.3.2.2.1.2"  instance="cacheMedianSvcTable" alias="cacheHttpAllSvcTm"   type="Integer32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.3.2.2.1.3"  instance="cacheMedianSvcTable" alias="cacheHttpMisSvcTm"   type="Integer32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.3.2.2.1.4"  instance="cacheMedianSvcTable" alias="cacheHttpNmSvcTm"    type="Integer32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.3.2.2.1.5"  instance="cacheMedianSvcTable" alias="cacheHttpHitSvcTm"   type="Integer32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.3.2.2.1.6"  instance="cacheMedianSvcTable" alias="cacheIcpQrySvcTm"    type="Integer32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.3.2.2.1.7"  instance="cacheMedianSvcTable" alias="cacheIcpRepSvcTm"    type="Integer32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.3.2.2.1.8"  instance="cacheMedianSvcTable" alias="cacheDnsSvcTime"     type="Integer32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.3.2.2.1.9"  instance="cacheMedianSvcTable" alias="cacheReqHitRatio"    type="Integer32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.3.2.2.1.10" instance="cacheMedianSvcTable" alias="cacheReqByteRatio"   type="Integer32" />
      </group>
      <group name="squidCacheCachePeerTable" ifType="all">
        <mibObj oid=".1.3.6.1.4.1.3495.1.5.1.1.1"    instance="cachePeerTable"    alias="cachePeerName"      type="String" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.5.1.1.2"    instance="cachePeerTable"    alias="cachePeerAddr"      type="String" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.5.1.1.3"    instance="cachePeerTable"    alias="cachePeerPortHttp"  type="Integer32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.5.1.1.4"    instance="cachePeerTable"    alias="cachePeerPortIcp"   type="Integer32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.5.1.1.5"    instance="cachePeerTable"    alias="cachePeerType"      type="Integer32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.5.1.1.6"    instance="cachePeerTable"    alias="cachePeerState"     type="Integer32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.5.1.1.7"    instance="cachePeerTable"    alias="cachePeerPingsSnt"  type="Counter32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.5.1.1.8"    instance="cachePeerTable"    alias="cachePeerPingsAck"  type="Counter32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.5.1.1.9"    instance="cachePeerTable"    alias="cachePeerFetches"   type="Counter32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.5.1.1.10"   instance="cachePeerTable"    alias="cachePeerRtt"       type="Integer32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.5.1.1.11"   instance="cachePeerTable"    alias="cachePeerIgnored"   type="Counter32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.5.1.1.12"   instance="cachePeerTable"    alias="cachePeerKeepAlSnt" type="Counter32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.5.1.1.13"   instance="cachePeerTable"    alias="cachePeerKeepAlRcv" type="Counter32" />
      </group>

      <!-- The cacheClientTable is very resource intensive.
      <group name="squidCacheCacheClientTable" ifType="all">
        <mibObj oid=".1.3.6.1.4.1.3495.1.5.2.1.1"    instance="cacheClientTable"  alias="cacheClientAddr"    type="String" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.5.2.1.2"    instance="cacheClientTable"  alias="cacheClientHttpReq" type="Counter32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.5.2.1.3"    instance="cacheClientTable"  alias="cacheClientHttpKb"  type="Counter32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.5.2.1.4"    instance="cacheClientTable"  alias="cacheClientHttpHit" type="Counter32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.5.2.1.5"    instance="cacheClientTable"  alias="cacheClientHttpHKb" type="Counter32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.5.2.1.6"    instance="cacheClientTable"  alias="cacheClientIcpReq"  type="Counter32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.5.2.1.7"    instance="cacheClientTable"  alias="cacheClientIcpKb"   type="Counter32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.5.2.1.8"    instance="cacheClientTable"  alias="cacheClientIcpHit"  type="Counter32" />
        <mibObj oid=".1.3.6.1.4.1.3495.1.5.2.1.9"    instance="cacheClientTable"  alias="cacheClientIcpHKb"  type="Counter32" />
      </group>
      -->

Fuente

lunes, 17 de junio de 2013

Block Facebook Network




Las redes que usa facebook son las siguientes:


66.220.144.0 - 66.220.159.255
69.63.176.0 - 69.63.191.255
69.171.224.0 - 69.171.255.255
204.15.20.0 - 204.15.23.255

Redes adicionales:


65.201.208.24/29
65.204.104.128/28
66.92.180.48/28
66.93.78.176/29
66.199.37.136/29
67.200.105.48/30
74.119.76.0/22
173.252.64.0/18

Si bloqueamos todos estos puestos le diremos adiós a Facebook.

lunes, 6 de mayo de 2013

Solucion Sarg Report en PfSense 2.0.1


En la Pestaña Schedule una tarea con la Siguiente configuracion:

    Descripcion : Nombre que ustedes decidan
    Sarg arg: -d `date +%d/%m/%Y`-`date +%d/%m/%Y`
    Frecuency: 15m

Luego lo guardan y se van a la pestaña general
Seleccionan:

user graphics
remove temporary files
generate the main index
generate the index tree
overwrite report
use comma instead pint in reports
show de downloaded volume ond date/time reports


En la sección REPORT TO GENERATE se seleccionan todos

Se guarda la configuracion y vamos de nuevo a la pestaña de schedule abrimos la tarea y damos en el boton

FORCE UPDATE NOW

Esperamos a que ejecute la tarea y por ultumo vamos al la pestaña donde vemos el reporte!!!!

miércoles, 6 de febrero de 2013

Ultimas vulnerabilidades en pfsense 2.0.1




Navegando por la web me encontré con un interesante articulo sobre las ultimas vulnerabilidades que afectan a nuestro firewall favorito.

Como el Articulo no es mio dejare el link para que lo revisen en la pagina del autor.


lunes, 4 de junio de 2012

PFSense: Monitoreando el trafico de la red.

Hoy googleando me encontré con una muy buena forma de saber quien se lleva todo el trafico de nuestra red. Usando rate vía linea de shell podemos ver detalladamente el trafico en tiempo real y hacernos una idea de lo que pasa en nuestra red.

El comando a ejecutar es el siguiente:

/usr/local/bin/rate -i sk0 -r 5 -Aa 10 -lc 192.168.0.0/24


-i Interfase a monotorizar
-r Repetir cada X segundos (5 en el ejemplo)
-A Modo de detección de abusos
-a Número de nodos a listar (10 en el ejemplo)
-l  Salida line buffered. Dice que es útil por si se quiere emplear rate en una shell que envíe a fichero.
-c Nodos de la subred especificada

Espero que les sirva.

viernes, 20 de abril de 2012

Tips squid, squidguard y lightsquid en pfsense


Instalación del paquete Squid en pfSense

En el menú System: Package Manager buscamos el paquete SQUID, y pulsamos en el boton de añadir:



pfsense se descargará el paquete y sus dependencias y lo instalará. No debemos hacer nada hasta ver el mensaje de instalación completada.



Ficheros de configuración de Squid en pfSense:
/usr/local/etc/squid
/usr/local/libexec/squid
/usr/local/sbin/squid
/usr/local/share/doc/squid
/usr/local/share/examples/squid
/usr/local/squid
/var/mail/squid
/var/squid

Para configurar Squid utilizamos el menú Services: Proxy server donde observamos varias pestañas:

General Settings
: Opciones generales de configuración


Cache management: Configuración del caché del Proxy

SquidGuard

Enlaces de interés

http://diskatel.narod.ru/sgquick.htm
http://www.squidguard.org

SquidGuard es un filtro de contenidos web utilizando el proxy Squid. Es importante precisar que squidGuard es un filtro de IP o URL, ya que en realidad no analiza el contenido de la dirección destino sino su URL/IP. Cuando un cliente solicita acceder a una determinada dirección squidGuardla compara con la lista de su base de datos y si no está permitido su acceso entonces realiza tareas como redireccionar a una página de error, no hacer nada, etc.

Ficheros de configuración de SquidGuard en pfSense:

/usr/local/bin/squidGuard
/usr/local/etc/squidGuard
/usr/local/share/doc/squidGuard
/var/db/squidGuard
/var/squidGuard

Blacklist URL:
http://www.shallalist.de/Downloads/shallalist.tar.gz

Error:
http://forum.pfsense.org/index.php/topic,9632.0.html

LightSquid

http://lightsquid.sourceforge.net/ 
Es una herramienta de informes de uso, un analizador rápido y ligero para el proxy Squid.
En el menú System: Package Manager buscamos el paquete LightSQUID, y pulsamos en el boton de añadir:
Directorios de LightSquid en pfSense:
/usr/local/etc/lightsquid
/usr/local/libexec/lightsquid
/usr/local/share/doc/lightsquid
/usr/local/share/lightsquid
/usr/local/www/lightsquid
/var/lightsquid
/var/lightsquid/report
Ficheros de configuración de LightSquid en pfSense:
/usr/local/etc/lightsquid/lightsquid.cfg
Para aumentar el aviso de "oversize" modifica la variable para aumentar de 10MB por usuario:
#user maximum size per day limit (oversize)
$perusertrafficlimit = 10*1024*1024;
but this change to firts webgui change.
For forever change see and modify '/usr/local/etc/lightsquid/lightsquid.cfg.dist' (webgui take this as source)
This option used only for reporting, but nothing to limit user quota
/usr/local/etc/lightsquid/realname.cfg
192.168.1.2     Sergey Erokhin
192.168.1.1     Jon Doe
192.168.1.3     Tech Good
/usr/local/etc/lightsquid/group.cfg
esl     01 SysAdmin
karlos  01 SysAdmin
thy     01 SysAdmin
Ivanov  02 Developer
Ivanov2 02 Developer
Petrov  03 Commerial
Petrova 03 Commerial
vasyav  04 room 312
petyava 04 room 312
/usr/local/etc/lightsquid/skipuser.cfg
#No registra estas IPs
192.168.0.129
192.168.0.57
Fuente : https://sites.google.com/a/terminuspro.com/internet/manuales/squid

lunes, 28 de noviembre de 2011

Limpiar cache Squid en PFSense 1.2.3

un tema bien común dentro de lo que es PFSense es el hecho de que cada cierto tiempo se nos llene la cache del Squid. Los síntomas suelen ser que repentinamente se pierda la navegación de toda la red, pero los servicios como MSN, Skype u otros sigan trabajando sin problemas.


La siguiente la solución exprés:


1) Ingresar via Web y en Status > Services y revisar que Squid y Squidguard esten abajo.
2) Ingresar via ssh al router.
3) Entrar a la ruta /var/squid/cache/ y dentro de esta realizar un #rm -r *
4)Reiniciar PFSense

Con lo siguiente iniciaremos una cache desde 0 y no deberiamos tener este problema en un buen tiempo mas dependiendo de la capacidad del disco.

Si necesitan mas información pueden ingresar al siguiente link. Squid Package Tuningng