RouterOS打开网页强制跳转到指定服务器


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

[php]
#映射命令
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
[/php]

2016.06.03

发表评论