Tema:
Para quienes cuentan con escaso ancho de banda y usuarios que se divierten descargando "cosas", bloquear programas p2p se vuelve un dolor de cabeza. Gracias a IPP2P podemos bloquear aplicaciones que saturan nuestra salida a Internet.
Instalamos dependencias:
aptitude install linux-headers-$(uname -r) iptables-dev
Instalamos los fuentes de iptables:
apt-get source iptables
Copiamos compiler.h desde el fuente de linux hacia el fuente de iptables:
cd /usr/src
cp /usr/src/linux-headers-`uname -r`/include/linux/compiler.h /usr/src/iptables-1.4.2/include/linux/
Descargamos ipp2p:
wget http://www.ipp2p.org/downloads/ipp2p-0.8.2.tar.gz
tar zvxf ipp2p-0.8.2
cd ipp2p-0.8.2
Según el README ipp2p funciona con iptables 1.3, para que trabaje con la versión 1.4 debemos descargar y mas adelante aplicar los siguientes parches:
http://sources.gentoo.org/viewcvs.py/*checkout*/gentoo-x86/net-firewall/ipp2p/files/ipp2p-0.8.2-kernel-2.6.22.patch
http://sources.gentoo.org/viewcvs.py/*checkout*/gentoo-x86/net-firewall/ipp2p/files/ipp2p-0.8.2-iptables-1.4.1.patch
patch -p1 < ipp2p-0.8.2-kernel-2.6.22.patch
patch -p1 < ipp2p-0.8.2-iptables-1.4.1.patch
Compilamos:
make
Copiamos los módulos recien compilados:
cp libipt_ipp2p.so /lib/iptables/
cp ipt_ipp2p.ko /lib/modules/`uname -r`/kernel/net/netfilter
depmod -a
modprobe ipt_ipp2p
Y listo, ya tenemos instalado ipp2p, podemos obtener una ayuda rápida de su funcionamiento con el comando:
iptables -m ipp2p --help
ipp2p bloquea los siguientes programas:
AppleJuice
Ares
AresLite
BitTorrent
Direct Connect
eDonkey
eMule
Gnutella
KaZaA
Mute
SoulSeek
WinMX
Waste
XDCC (envio de archivos via IRC)
Por ejemplo, para bloquear ARES ejecutamos:
iptables -I FORWARD -p udp -m ipp2p --ares -j DROP
Quienes esten usando testing o unstable pueden reemplazar el procedimiento de instalacion de esta manera:
aptitude install xtables-addons-common
Comentarios
Raza lo instalo en debian
Raza lo instalo en debian segun lo que dice y bajo directamente el source desde http://www.ipp2p.org/downloads/ipp2p-0.8.2.tar.gz
There are only 10 types people in the world:
Those who understand binary and those who don't
Error al instalar ipp2p
Hola Raza,
tengo debian lenny con kernel 2.6.26-2, iptables 1.4.2. Hice todo lo que comentas y al aplicar el parche (patch -p1 < ipp2p-0.8.2-iptables-1.4.1.patch), muestra el siguiente error:
patching file libipt_ipp2p.c
Hunk #2 succeeded at 376 (offset 3 lines).
Hunk #3 succeeded at 397 (offset 3 lines).
Además, al compilar muestra los siguientes warnings:
CC [M] /usr/src/ipp2p-0.8.2/ipt_ipp2p.o
Building modules, stage 2.
MODPOST 1 modules
CC /usr/src/ipp2p-0.8.2/ipt_ipp2p.mod.o
LD [M] /usr/src/ipp2p-0.8.2/ipt_ipp2p.ko
make[1]: Leaving directory `/usr/src/linux-headers-2.6.26-2-686'
gcc -O3 -Wall -DIPTABLES_VERSION=\"1.4.2\" -I/usr/src/iptables-1.4.2/include -fPIC -c libipt_ipp2p.c
libipt_ipp2p.c:388: warning: initialization from incompatible pointer type
libipt_ipp2p.c:389: warning: initialization from incompatible pointer type
libipt_ipp2p.c:391: warning: initialization from incompatible pointer type
libipt_ipp2p.c:392: warning: initialization from incompatible pointer type
gcc -shared -o libipt_ipp2p.so libipt_ipp2p.o
Por último, al tratar de ejecutar el módulo muestra el siguiente error:
iptables -m ipp2p --help
Segmentation fault
No sé que está pasando, alguna sugerencia?
Gracias
Cita: patching file
[quote]
patching file libipt_ipp2p.c
Hunk #2 succeeded at 376 (offset 3 lines).
Hunk #3 succeeded at 397 (offset 3 lines).
[/quote]
Eso no es un error, indica el parche fué aplicado exitosamente.
[quote]
gcc -O3 -Wall -DIPTABLES_VERSION=\"1.4.2\" -I/usr/src/iptables-1.4.2/include -fPIC -c libipt_ipp2p.c
libipt_ipp2p.c:388: warning: initialization from incompatible pointer type
libipt_ipp2p.c:389: warning: initialization from incompatible pointer type
libipt_ipp2p.c:391: warning: initialization from incompatible pointer type
libipt_ipp2p.c:392: warning: initialization from incompatible pointer type
gcc -shared -o libipt_ipp2p.so libipt_ipp2p.o
[/quote]
El warning no afectó la compilación, pero ese error de segmentation fault al ejecutar el módulo no sabría decirte porqué sucede :(
Sale lo mismo si ejecutas algún otro comando con iptables?
-----
Visita este [url=http://www.sindominio.net/ayuda/preguntas-inteligentes.html]link[/url] :evil:
[img]http://www.bbspot.com/Images/News_Features/2003/01/os_quiz/debian.jpg[/img]
(adsbygoogle = window.adsbygoogle || []).push({});
Gracias. El iptables si
Gracias.
El iptables si funciona correctamente.
Páginas