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.
058e7950efdf8b9539ab79eb145de7be60d6cb7b92c0c011edda37e70135024c