09
2022
10

RouterOS使用IP地址列表分流,分流给旁路由

https://www.truenasscale.com/2022/04/23/1011.html

curl -s https://raw.githubusercontent.com/17mon/china_ip_list/master/china_ip_list.txt |sed -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'>cnip.rsc
www.truenasscale.com/cnip.rsc
/tool fetch mode=http url="https://www.truenasscale.com/cnip.rsc" \
dst-path=cnip.rsc
/im file=cnip.rsc
/file remove [find name="cnip.rsc"]
:log info ("update done")

ros 7的脚本

/tool fetch mode=http url="https://www.truenasscale.com/cnip.rsc" \
/im file=cnip.rsc
/file remove [find name="cnip.rsc"]
:log info ("update done")

ros 6的脚本


图片.png

/tool fetch mode=http url="https://www.truenasscale.com/cnip.rsc"
/im file=cnip.rsc
/file remove [find name="cnip.rsc"]
/ip firewall address-list add list="CNIP" address="192.168.88.0/24"
:log info ("update done")


« 上一篇 下一篇 »