I'm going to mention ProtoWall, as I think it's better because it uses less resources. PeerGuardian works fine, but when I tried it last it was a bit of a resource hog. I haven't tried PeerGuardian for a while, maybe they reworked it.
PeerGuardian and ProtoWall are both IP blockers that prevent "undesirable" IP addresses from connecting to your computer. These IP addresses come from a list in a file named guarding.p2p. Both programs use this file. The file should be regularly updated for maximum protection. Note that this is not 100% protection.
Whereas ProtoWall may be better, you may not be able to use it unless you have administrator rights on the computer you are using. ProtoWall requires the manual installation of a "driver" service in the TCP/IP properties for the internet connection. ProtoWall will only work on Windows XP, 2000, and 2003 Server operating systems.
Should you want to try ProtoWall, it is available free here:
http://www.bluetack.co.uk/pw.html
Be sure to get the FAQ too, as it has the necessary instructions to install the driver.