Difference between revisions of "PeerGuardian BlockList Filter for HG"

From NAS-Central Buffalo - The Linkstation Wiki
Jump to: navigation, search
(Thx)
(Use)
Line 63: Line 63:
 
= Use =
 
= Use =
  
Moblock only filter packet that are queue with NQUEUE interface. See readme for more information. We will use Moblock default startup script.
+
Moblock only filters packet that are queued with the NQUEUE interface. See the Moblock readme for more information. We will use Moblock default startup script.
  
Just copu MoBlock-nfq.sh in /usr/bin
+
Just copy MoBlock-nfq.sh to /usr/bin
 
  cp Moblock-nfq.sh /usr/bin
 
  cp Moblock-nfq.sh /usr/bin
  
Edit the script for put moblock binary path list path and log path.
+
Edit the script for thet moblock binary path, the blocklist path and the log path.
 
  vi /usr/bin/Moblock-nfq.sh
 
  vi /usr/bin/Moblock-nfq.sh
 
  # Here you can change block list and log files
 
  # Here you can change block list and log files
Line 77: Line 77:
  
 
Moblock is now operational :
 
Moblock is now operational :
* For To stop it:
+
* To stop it:
 
  kill -TERM <MoBlockPid>
 
  kill -TERM <MoBlockPid>
 
* For update log/stats
 
* For update log/stats
Line 84: Line 84:
 
* Reload the list
 
* Reload the list
 
  kill -HUP <MoBlockPid> # reloads blocklist and resets stats
 
  kill -HUP <MoBlockPid> # reloads blocklist and resets stats
 +
 +
You can also use this script to download new blocklists (borrowed from the Ubuntu x86 moblock package:
 +
[http://www.users.tpg.com.au/flicktom/files/moblock-update.sh]
  
 
= Thx =
 
= Thx =
 
To Sylver, for his work and his help :)
 
To Sylver, for his work and his help :)

Revision as of 11:27, 21 April 2007

Contents

Moblock for Silver KuroboxHG

Moblock is the official Linux Peerguardian client. It load peerguardian file ( .p2p, .p2b, .dat) into iptables filter.

Installation

Requiered

Install Kernel Update

Dowload new kernel ( working only for kuroboxhg ). Put the archive on the root directory and untar

tar xvf kernel-2.6.18-mh3_kurobox_hg-20060929.tar.gz

Edit /etc/init.d/bootnewos for change the kernel. At the underlast line :

 /sbin/insmod /boot/loader.o kernel=/boot/vmlinux.bin

Reboot, the fist line in your shell should now be :

Linux (none) 2.6.18-mh3_kurobox_hg #1 Tue Sep 26 16:19:42 CEST 2006 ppc unknown unknown GNU/Linux

Install Library

Extract and compil libnfnetlink

bzip2 -d libnfnetlink-0.0.16.tar.bz2
tar xvf libnfnetlink-0.0.16.tar
./configure
make
make install

Extact and compil libnetfilter_queue

bzip2 -d libnetfilter_queue-0.0.12.tar.bz2
tar xvf libnetfilter_queue-0.0.12.tar
./configure
make
make install

Update library link

ldconfig

Install Moblock

Extact and compile Moblock. You must before edit the makefile for remove arch information :

tar xvf  MoBlock-0.8-i586.tar
cd Moblock-0.8
vi Makefile

remove :

 -march=i586 -mtune=i686

now we can compile

make
make install

Use

Moblock only filters packet that are queued with the NQUEUE interface. See the Moblock readme for more information. We will use Moblock default startup script.

Just copy MoBlock-nfq.sh to /usr/bin

cp Moblock-nfq.sh /usr/bin

Edit the script for thet moblock binary path, the blocklist path and the log path.

vi /usr/bin/Moblock-nfq.sh
# Here you can change block list and log files
moblock -p /etc/guarding.p2p /var/log/moblock.log

Now just run

Moblock-nfq.sh &

Moblock is now operational :

  • To stop it:
kill -TERM <MoBlockPid>
  • For update log/stats
kill -USR1 <MoBlockPid>	# write stats to logfile
kill -USR2 <MoBlockPid>      # write stats to /var/log/MoBlock.stats
  • Reload the list
kill -HUP <MoBlockPid>	# reloads blocklist and resets stats

You can also use this script to download new blocklists (borrowed from the Ubuntu x86 moblock package: [1]

Thx

To Sylver, for his work and his help :)