网络状况 18条ADSL线路 PCC+NTH 混合负载模式。 需要PCC+NTH的联系猫哥 地址是 cat-home.org
内网PING 本地外网的18个ip是正常的 外部ping我的外网的18个IP 只有一个是ping得通的,怀疑是ISP的问题。
普通的DDNS脚本在这种环境下就不适用了。请教了猫哥之后,才把多线只通一条的线路的DDNS脚本搞定。
以下是修改后的脚本

#多线DDNS
#DDNS
:global gate [/ip route get [/ip route find static=yes active=yes dynamic=yes] gateway]
:global xxddns {:put [/ip add get [find network=$gate] interface]}
:global ddnsuser "用户账号"
:global ddnspass "用户密码"
:global ddnshost1 "绑定域名1"
:global ddnshost2 "绑定域名2"
:global ddnshost3 "绑定域名3"
:global ddnsinterface $xxddns
:global ddnslastip

:global ddnsip [ /ip address get [/ip address find dynamic=yes interface=$ddnsinterface ] address ]
:if ( [:typeof $ddnslastip]="nothing" ) do={ :global ddnslastip 0.0.0.0/0 }
:if ( [:typeof $ddnsip]="nothing" ) do={
 :log info ("DDNS: No ip address present on " . $ddnsinterface . ", please check.")
} else={
 :if ($ddnsip != $ddnslastip) do={
   :log info "DDNS: Sending UPDATE!"
   :log info [ /tool dns-update name=$ddnshost1 address=[:pick $ddnsip 0 [:find $ddnsip "/"] ] key-name=$ddnsuser key=$ddnspass ]
   :log info [ /tool dns-update name=$ddnshost2 address=[:pick $ddnsip 0 [:find $ddnsip "/"] ] key-name=$ddnsuser key=$ddnspass ]
   :log info [ /tool dns-update name=$ddnshost3 address=[:pick $ddnsip 0 [:find $ddnsip "/"] ] key-name=$ddnsuser key=$ddnspass ]
   :global ddnslastip $ddnsip
 } else={
   :log info "DDNS: No change"
}
}
:log info "DDNS: End"


3322的昨天崩盘了今天还没试过

#多线DDNS
#3322.org
/system scheduler
add comment="3322\B6\AF\CC\AC\D3\F2\C3\FB" disabled=no interval=10m name=\
   3322DNS on-event=":local ednsuser \"用户账号\"\r\
   \n:global gate [/ip route get [/ip route find static=yes active=yes dynamic=yes] gateway]
   \n:global xxddns {:put [/ip add get [find network=$gate] interface]}
   \n:local ednspass \"用户密码\"\r\
   \n:local ednshost \"绑定域名\"\r\
   \n:local ednsinterface $xxddns\r\
   \n:local members \"http://members.3322.org/dyndns/update\?system=dyndns\"\
   \r\
   \n#:local members \"http://members.dyndns.org/nic/update\?\"\r\
   \n:local status\r\
   \n:local status [/interface get [/interface find  name=\$ednsinterface] ru\
   nning]\r\
   \n:if (\$status!=false) do={\r\
   \n:local ednslastip [:resolve \$ednshost]\r\
   \n:if ([ :typeof \$ednslastip ] = nil ) do={ :local ednslastip \"0\" }\r\
   \n:local ednsiph [ /ip address get [/ip address find interface=\$ednsinter\
   face ] address ]\r\
   \n:local ednsip [:pick \$ednsiph 0 [:find \$ednsiph \"/\"]]\r\
   \n:local ednsstr \"&hostname=\$ednshost&myip=\$ednsip\"\r\
   \n:if (\$ednslastip != \$ednsip) do={/tool fetch url=(\$members . \$ednsst\
   r) mode=http user=\$ednsuser password=\$ednspass dst-path=\$ednshost\r\
   \n:delay 2\r\
   \n:local result [/file get \$ednshost contents]\r\
   \n:log info (\$ednshost . \" \" .\$result)\r\
   \n/file remove \$ednshost ;\r\
   \n}\r\
   \n}\r\
   \n" policy=reboot,read,write,policy,test,sniff,sensitive start-date=\
   jan/01/1970 start-time=00:00:00