How I can read out IP addresses from file and then ban in iptables.
Simple, direct, one line solution:
This will block any communication from the ip addresses on any protocol or port.
But maybe you should think about doing a proper firewall script using
EDIT: The same line, verbose:
Or using a separate chain
you could also use module ipset ( http://ipset.netfilter.org/ ). When list of ip addresses gets long, matching them one by one with individual iptables rules will lead to degraded performance. Ipset should perform much better. Also, with ipset you can reload addresses at any time without touching your rules.
Even if you dont want to bother with ipset, it is better to drop banned addresses in iptables "raw" table. This way, connection tracking framework will not see them and won't create state records you'll never need. This should also improve performance in case the firewall has to handle lots of traffic.