首先,安装IP地址段查询工具Ripe-dbase-client-v3:
下载软件包:
复制代码 代码示例:
shell# wget http://ftp.apnic.net/apnic/dbase/tools/ripe-dbase-client-v3.tar.gz
安装软件包
复制代码 代码示例:
shell# tar -zxvf ripe-dbase-client-v3.tar.gz
shell# ./configure
shell# make
shell# make install
接下来设置下配置文件:
设置网通IP列表ACL文件cnc_acl.conf:
复制代码 代码示例:
shell# whois3 -h whois.apnic.net -l -i mb MAINT-CNCGROUP | grep "descr" | grep "Reverse" |
linuxjishu/13830.html target=_blank class=infotextkey>awk -F "for" '{if ($2!="") print $2}'| sort -n | awk 'BEGIN{print "acl "CNC" '{'"}{print $1";"}END{print "'}';"}' > cnc_acl.conf
设置电信IP列表ACL文件telecom_acl.conf:
复制代码 代码示例:
shell# whois3 -h whois.apnic.net -l -i mb MAINT-CHINANET | grep "descr" | grep "Reverse" | awk -F "for" '{if ($2!="") print $2}'| sort -n | awk 'BEGIN{print "acl "TELECOM" '{'"}{print $1";"}END{print "'}';"}' > telecom_acl.conf
设置移动IP列表ACL文件cmss_acl.conf:
复制代码 代码示例:
shell# whois3 -h whois.apnic.net -l -i mb MAINT-CN-CMCC | grep "descr" | grep "Reverse" | awk -F "for" '{if ($2!="") print $2}'| sort -n | awk 'BEGIN{print "acl "CMSS" '{'"}{print $1";"}END{print "'}';"}' > cmss_acl.conf
设置铁通IP列表ACL文件crtc_acl.conf:
复制代码 代码示例:
shell# whois3 -h whois.apnic.net -l -i mb MAINT-CN-CRTC | grep "descr" | grep "Reverse" | awk -F "for" '{if ($2!="") print $2}'| sort -n | awk 'BEGIN{print "acl "CRTC" '{'"}{print $1";"}END{print "'}';"}' > crtc_acl.conf