# yum install gcc gcc-c++ make automake unzip zip xz kernel-devel-`uname -r` iptables-devel perl-Text-CSV_XS3. 安装xtables-addons
# wget http://sourceforge.net/projects/xtables-addons/files/Xtables-addons/2.3/xtables-addons-2.3.tar.xz/download# xz -d xtables-addons-2.3.tar.xz # tar xvf xtables-addons-2.3.tar # cd xtables-addons-2.3# ./configure# make# make install4. geoip相关套件
# cd geoip# ./xt_geoip_dl# ./xt_geoip_build GeoIPCountryWhois.csv# mkdir -p /usr/share/xt_geoip/# cp -rp {BE,LE} /usr/share/xt_geoip/5. 编写iptables规则。如拒绝台湾地区IP
# iptables -I INPUT -m geoip --src-cc TW -j DROP如需转载请注明出处:www.ttlsa.com