Hello,
i think theres an easy way: http://www.bluetack.co.uk/converter/index.php
With this you can create a script with the desired adresses(adware,spyware, antip2p...). It could look like this:
#!/bin/bash
# Create special MLDONKEY chain
iptables -t filter -N MLDONKEY
iptables -t filter -F MLDONKEY
# Create the logdrop chain to log & drop a packet
iptables -t filter -N MLDONKEY_LOGDROP
iptables -t filter -F MLDONKEY_LOGDROP
iptables -t filter -A MLDONKEY_LOGDROP -j LOG --log-prefix "MLDONKEY"
iptables -t filter -A MLDONKEY_LOGDROP -j DROP
# Jump to the special MLD chain at the end of the INPUT chain (commented out)
#iptables -t nat -A INPUT -j MLDONKEY
# List of ip ranges to ban
iptables -t filter -I INPUT 1 -s 4.18.162.102 -j MLDONKEY_LOGDROP
iptables -A OUTPUT -o eth0 -d 4.18.162.102 -j REJECTiptables -t filter -I INPUT 1 -s 4.36.44.3 -j MLDONKEY_LOGDROP
iptables -A OUTPUT -o eth0 -d 4.36.44.3 -j REJECTiptables -t filter -I INPUT 1 -s 4.38.98.140 -j MLDONKEY_LOGDROP
iptables -A OUTPUT -o eth0 -d 4.38.98.140 -j REJECTiptables -t filter -I INPUT 1 -s 4.65.105.109 -j MLDONKEY_LOGDROP
iptables -A OUTPUT -o eth0 -d 4.65.105.109 -j REJECTiptables -t filter -I INPUT 1 -s 12.3.249.0/24 -j MLDONKEY_LOGDROP
iptables -A OUTPUT -o eth0 -d 12.3.249.0/24 -j REJECTiptables -t filter -I INPUT 1 -s 12.14.172.204 -j MLDONKEY_LOGDROP
.... and so on
I think the iptables way is better because some sites are loading the ads from IP-adresses + iptables should be faster.
It would be great if someone makes a package with autoupdate functionality and stuff like that. I havent tried the way i mentioned above so i cant tell if its any good from experience but it looks like it would do the job.