# curl -s https://raw.githubusercontent.com/17mon/china_ip_list/master/china_ip_list.txt |sed -e '/^#.*/d' -e 's/^/add address=/g' -e 's/$/ list=CNIP/g'|sed -e $'1i\\\n/ip firewall address-list' -e $'1i\\\nremove [/ip firewall address-list find list=CNIP]' -e $'1i\\\nadd address=10.0.0.0/8 list=CNIP comment=private-network' -e $'1i\\\nadd address=172.16.0.0/12 list=CNIP comment=private-network' -e $'1i\\\nadd address=192.168.0.0/16 list=CNIP comment=private-network' |sed '$a \/' |sed '$a /file remove cnip.rsc'>cnip.rsc
如果没有代理,访问国内网站也可以
#curl -s https://www.ipdeny.com/ipblocks/data/countries/cn.zone |sed -e '/^#.*/d' -e 's/^/add address=/g' -e 's/$/ list=CNIP/g'|sed -e $'1i\\\n/ip firewall address-list' -e $'1i\\\nremove [/ip firewall address-list find list=CNIP]' -e $'1i\\\nadd address=10.0.0.0/8 list=CNIP comment=private-network' -e $'1i\\\nadd address=172.16.0.0/12 list=CNIP comment=private-network' -e $'1i\\\nadd address=192.168.0.0/16 list=CNIP comment=private-network' |sed '$a \/' |sed '$a /file remove cnip.rsc'>cnip.rsc
直接在winbox或者web页面上传生成的cnip.rsc
在终端界面执行 im cnip.rsc即完成。
文章评论