1、命令安装
yum install ipset
yum install iptables
ipset create whitelist hash:net
ipset create blacklist hash:net
> 开启黑白名单
iptables -P INPUT DROP
iptables -A INPUT -m set --match-set whitelist src -j ACCEPT
> 开启黑名单
iptables -P INPUT ACCEPT
iptables -A INPUT -m set --match-set blacklist src -j DROP