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.
7987bb8de1b0490b32084ab72165ae53038e497a96ab9940920280d8068629b0