文档下载 文档下载导航
设为首页 | 加入收藏
搜索 请输入内容:  
 导航当前位置: 文档下载 > 所有分类 > IT/计算机 > ADSL双线Nth负载+DDNS自动更新+网银
侵权投诉

ADSL双线Nth负载+DDNS自动更新+网银

脚本名称:ADSL双线Nth负载+DDNS自动更新+网 # #运行环境:RouterOS 3x系列版本

=LAN connection-state=new nth=2,2 action=mark-connection new-connection-mark=ADSL_02_Conn passthrough=yes comment="ADSL_02_Nth" disabled=no
/ip firewall mangle add chain=prerouting action=mark-packet connection-mark=ADSL_02_Conn new-packet-mark=ADSL_02 passthrough=yes disabled=no
/ip firewall mangle add chain=prerouting in-interface=LAN connection-mark=ADSL_02_Conn action=mark-routing new-routing-mark=ADSL_02 passthrough=no disabled=no

#---------------------------------第五步(IP-Net转发、DNS、MSS)-------------#
/ip firewall nat add chain=srcnat action=masquerade src-address=192.168.88.0/255.255.0.0 comment="IP转发"
/ip dns set primary-dns=202.96.134.133 secondary-dns=202.96.128.68
/ip firewall mangle add chain=forward protocol=tcp tcp-flags=syn action=change-mss new-mss=1440 comment="设置MSS值等于1440"


#--------------------------------------第六步------------------------------#
#-------------------------------自动刷新网关-------------------------------#
:global assign
:global new
:global status
:global x
:global link
:set x 2
:set link 3
:for i from=1 to=$x do={
:set status [/interface get [/interface find name=("ADSL_0" . $i)] running]
:if ($status=true) do={
:set new [/ip address get [/ip address find dynamic=yes interface=("ADSL_0" . $i)] address]
:set new [:pick $new 0 ([:len $new] -3)]
:set assign [/ip address get [/ip address find dynamic=no interface=("ADSL_0" . $i)] address]
:set assign [:pick $assign 0 ([:len $assign] -3)]
:if ($assign != $new) do={ /ip address set [/ip address find comment=$i] address=$new network=$new broadcast=$new
/ip route set [/ip route find comment=$i] gateway=$new
:if ($i=1) do={/ip route set [/ip route find comment=$link] gateway=$new}
}
}
}


#--------------------------------------第七步------------------------------#
#-------------------------------Ros_DDNS-----------------------------------#
#-----------------申请地址:doc.guandang.net
:global ddnsuser "gzmickey" #-----------------------------------------用户名
:global ddnspass "mickeywan"#-----------------------------------------密 码
:global ddnshost "mickey.zyns.com" #----------------------------------域 名
:global ddnsip
:global ddnsipfn
:global ddnslastip [:tostr [:resolve $ddnshost] ]
:if ([ :typeof $ddnslastip ] = nil ) do={ :global ddnslastip "0" }
:global ddnsinterface "ADSL_01" #----------------这里的ADSL_01为拨号网卡名称
:global ddnssystem ("mt-" . [/system package get system version] )
:local int
:local ddnsipfn [ /ip address get [/ip address find interface=$ddnsinterface ] address ]
:global ddnsip [:pick $ddnsipfn 0 [:find $ddnsipfn "/" ] ]

:if ([ :typeof $ddnsip ] = nil ) do={
:log info ("DDNS: No ip address present on " . $ddnsinterface . ", please check.")
} else={
:if ($ddnsip != $ddnslastip) do={
:log info "DDNS: Sending UPDATE!"
:log inf

上一页第2页

你可能喜欢

热门文档

相关文档

站点地图 | 文档上传 | 侵权投诉 | 手机版
本站所有资源均来自互联网,本站只负责收集和整理,均不承担任何法律责任,如有侵权等其它行为请联系我们.
文档下载 Copyright 2013 doc.guandang.net All Rights Reserved.  -  email