ipset allows administration of sets of IP addresses/networks, ports, MAC addresses, and interfaces, which are stored in hash or bitmap data structures. These can then be used in conjunction with iptables to do fast presence lookups.
d744016e2550aba61af849519abb791612a6655b7999dbb873fb2c8347af6ee2