PeerGuardian and PeerGuardian 2 are free and open source programs developed by Phoenix Labs. They are capable of blocking incoming and outgoing connections based on IP blocklists. The system is also capable of blocking advertising, spyware, government and educational ranges, depending upon user preferences.
PeerGuardian 2 is Open Source, meaning the program code is available online for anyone who wants it. Not only does this allow you to make modifications or even branch off into your own project, but it encourages peer review of the code making sure any bugs are eliminated swiftly. Because PeerGuardian 2 is Open Source, you can rest assured there are no backdoors or spyware included.