今天群友有这个需求就写了个脚本,不过也是有很久没更新文章了,哈哈。

#映射命令
ip firewall nat add chain=dstnat action=dst-nat to-addresses=修改为自己的服务IP to-ports=80 protocol=tcp src-address-list=Client-ip dst-port=80  disabled=yes
#设置强制跳转时间
ip firewall mangle add chain=prerouting action=add-src-to-address-list protocol=tcp src-address-list=!Client-ip_2 address-list=Client-ip address-list-timeout=5s dst-port=80  disabled=yes
#设置刷新间隔
ip firewall mangle add chain=prerouting action=add-src-to-address-list protocol=tcp src-address-list=Client-ip address-list=Client-ip_2 address-list-timeout=5m dst-port=80 disabled=yes

来自Routeos入门

Last modification:February 16, 2019
If you think my article is useful to you, please feel free to appreciate