免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1371 | 回复: 0
打印 上一主题 下一主题

Ros强开指定首页 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-11-19 14:56 |只看该作者 |倒序浏览

Ros强开指定首页,类似电信的ADSL强开指定首页,即push功能
许多
网吧
的使用这个ROS2.9.27软路由,本文要
实现
的事Ros强开指定首页,类似电信的ADSL强开指定首页,即push功能.
程序代码
######程序开始######################################################################
# 程序名称:ROS强开首页(类似电信ADSL强开指定首页)
# 程序版本:测试
# 程 序 员:kuwin Email:kuwin@163.com
# 程序版权:免费软件(本程序可自由传播及修改,不必理会原创作者kuwin)
#  Ros版本:Ros2.9.27
# 编写日期:2007-10-17
# 修改日期:2007-10-17
# 测试人员:kuwin
# 程序评级:无
#
安装
说明:
#     1.本程序只在Ros2.9.27上
调试
通过,其它版本尚未测试;
#     2.安装前请做好
备份
,一切后果与kuwin无关;
#     2.Winbox->System->Scripts->按+,贴入程序内容,按OK,再按Run Script.
####################################################################################
#定义变量
#首页所在服务器IP
:local StrToAddress
:set StrToAddress 192.168.0.1
#首页所在服务器端口
: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
######程序结束######################################################################
原文地址
http://www.bsdlover.cn/html/49/n-1749.html



本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/18630/showart_1423959.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP