程序名称:ROS强开首页(类似电信ADSL强开指定首页)

# 程序名称:ROS强开首页(类似电信ADSL强开指定首页)
# 程序版本:测试
# 程序评级:无
# 安装说明:
#     1.本程序只在Ros2.9.27上调试通过,其它版本尚未测试;
#     2.安装前请做好备份,一切后果与kuwin无关;
#     2.Winbox->System->Scripts->按+,贴入程序内容,按OK,再按Run Script.
####################################################################################
#定义变量
#首页所在服务器IP
:local StrToAddress
:set StrToAddress 192.168.120.253

#首页所在服务器端口
:local StrToPort
:set StrToPort 80

#时限1,指定时限内跳到指定首页,设置1-5秒
:local StrTimeOut1
:set StrTimeOut1 2s

#时限2,指定时限内不跳到指定首页,3小时为3h,(测试是否有效可调为1分钟1m)
:local StrTimeOut2
:set StrTimeOut2 3h

ip firewall mangle add chain=prerouting protocol=tcp dst-port=80 src-address-list=!src2 \
        action=add-src-to-address-list address-list=src1 address-list-timeout=$StrTimeOut1 comment=TimeOut1

ip firewall mangle add chain=prerouting protocol=tcp dst-port=80 \
        action=add-src-to-address-list address-list=src2 address-list-timeout=$StrTimeOut2 comment=TimeOut2

ip firewall nat add chain=dstnat protocol=tcp dst-port=80 src-address-list=src1 \
        action=dst-nat to-addresses=$StrToAddress to-ports=$StrToPort comment=ToAddress
######程序结束######################################################################


posted @   shiningrise  阅读(355)  评论(0编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· .NET10 - 预览版1新功能体验(一)
// 侧边栏目录 // https://blog-static.cnblogs.com/files/douzujun/marvin.nav.my1502.css
点击右上角即可分享
微信分享提示