查看: 178|回复: 0

[Mikrotik Ros] RouterOS 导入 USTC IP 黑名单

[复制链接]

124

主题

0

回帖

508

积分

管理员

积分
508
发表于 7 天前 | 显示全部楼层 |阅读模式
将 中科大 USTC IP Blacklist 转换成 RouterOS 格式并导入。
黑名单列表介绍:
https://blackip.ustc.edu.cn/
使用方法:
访问 https://gateway.vsean.net/ustc_blackip/routeros.php 下载脚本并导入即可。

导入脚本时会先清空同名列表里的现有列表项。如有自定义需求建议建立多个地址列表。
默认 address-list 的列表名为 black_ip

如需自定义列表名,只需要在 url 后面跟上 ?list_name=[your list name]
例如: https://gateway.vsean.net/ustc_blackip/routeros.php?list_name=Block
也可以使用脚本的方式自动导入:
  1. <font face="Tahoma"># 黑名单列表名称
  2. :local listName "black_ip";
  3. :local url ("https://gateway.vsean.net/ustc_blackip/routeros.php?list_name=" . $listName);
  4. /tool fetch url=$url mode=https output=file dst-path="black_ip.rsc";
  5. import file=black_ip.rsc</font>
复制代码
示例防火墙脚本
  1. <font face="Tahoma">/ip firewall filter
  2. add action=reject chain=input comment="reject blocked" connection-state=new reject-with=icmp-network-unreachable \
  3.     src-address-list=black_ip
  4. add action=reject chain=forward comment="reject blocked" connection-state=new reject-with=icmp-network-unreachable \
  5.     src-address-list=black_ip

  6. /ipv6 firewall filter
  7. add action=reject chain=input comment="reject blocked" connection-state=new reject-with=icmp-address-unreachable \
  8.     src-address-list=black_ip
  9. add action=reject chain=forward comment="reject blocked" connection-state=new reject-with=icmp-address-unreachable \
  10.     src-address-list=black_ip</font>
复制代码


您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关注公众号

相关侵权、举报、投诉及建议等,请发 E-mail:admin@discuz.vip

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.|蜀ICP备17024538号-6

在本版发帖
关注公众号
QQ客服返回顶部