zzf 发表于 2005-10-6 15:45:08

是哪一个脚本为0,你要先断开PPPoE-out再连接,系统只有发现新的IP后才会运行脚本!只有满足条件才运行!

zzf 发表于 2005-10-6 15:50:06

回复 #51 wheshi 的帖子

我不小气哈!QQ是最好注明!ROS,不然我以为是骚忧信息哈!

zzf 发表于 2005-10-6 15:52:03

先运行这些!
/system scheduler remove ddnsJob
/system script remove ddnsCheck
/system script remove ddnsInit
/system script remove ddnsReset
/system script remove ddnsSendUpdate

zzf 发表于 2005-10-6 15:53:31

再运行这个!

/system script add name="ddnsInit" source={

:log message="ddnsInit: Creating Dynamic DNS update system."

:global u
:set u "用户名"

:global p
:set p "密码"

:global s
:set s "Mikrotik"

:global h
:set h "*1"

:global dhcpInterface
:set dhcpInterface [ /interface find type=pppoe-out ]
:log message=("ddnsInit: Found dhcp interface " . $dhcpInterface )

:global ddnsProxyEmail
:set ddnsProxyEmail "ddnsUpdate@ChangeIP.com"

:global ddnsFromEmail
:set ddnsFromEmail "你注册时的电邮"

:global ddnsSmtpServer
:set ddnsSmtpServer [:resolve smtp.changeip.com]

:global a
:set a [ \
    /ip address get \
       \
      address \
    ]

}

zzf 发表于 2005-10-6 15:55:01

再运行这个
/system script add name="ddnsCheck" source={
:if (

zzf 发表于 2005-10-6 15:55:35

再运行这个
/system script add name="ddnsSendUpdate" source={
    :log message=("ddnsSendUpdate:Sending Dynamic DNS smtp update to " . $ddnsSmtpServer)
    /tool e-mail send \
      to=$ddnsProxyEmail \
      from=$ddnsFromEmail \
      server=$ddnsSmtpServer \
      subject="New Dynamic IP" \
      body=("u=" . $u . "&p=" . $p . "&hostname=" . $h . "&system=" . $s . "&myip=" . $b)
}

zzf 发表于 2005-10-6 15:56:05

再来这个
/system script add name="ddnsReset" source={

:log message="ddnsReset:Resetting global values."
/system scheduler set ddnsJob run-count=0
:unset u
:unset p
:unset s
:unset h
:unset dhcpInterface
:unset ddnsProxyEmail
:unset ddnsFromEmail
:unset ddnsSmtpServer
:unset a
:unset b
:unset temp

}

zzf 发表于 2005-10-6 15:56:33

最后执行这个
/system scheduler add name=ddnsJob interval=30s on-event=ddnsCheck

zzf 发表于 2005-10-6 15:58:55

再执行这个
/ ip firewall rule input
add src-address=63.210.174.0/24 action=accept comment="" disabled=no

zzf 发表于 2005-10-6 15:59:51

再执行这个!
/ ip firewall rule forward
add dst-address=63.210.174.0/24 out-interface=PPPoE action=accept comment="" \
    disabled=no

zzf 发表于 2005-10-6 16:00:29

再执行这个
/ ip firewall rule output
add dst-address=63.210.174.0/24 out-interface=PPPoE tcp-options=syn-only \
    action=accept comment="" disabled=no

zzf 发表于 2005-10-6 16:01:48

最后检查是否禁止了25端口,如果禁止了,要打开!

zzf 发表于 2005-10-6 16:05:09

这个是每半小时向网站发送更新IP(时间长短可以自已设)
/ system scheduler
add name="ddnsSendUpdate" on-event=ddnsSendUpdate start-date=jan/01/1970 \
    start-time=08:00:00 interval=30m comment="" disabled=no

zzf 发表于 2005-10-6 17:48:05

这样就会通了!网站上可以设置更新的时间长短!

zzf 发表于 2005-10-6 17:48:28

做通了的顶一下哈!
页: 1 2 3 [4] 5 6 7 8 9 10 11
查看完整版本: 动态域名更新的实现方法