找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 3758|回复: 0

[其它] 关于动态域名更新的问题

[复制链接]
发表于 2008-6-2 22:47:23 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×
本个在changeip.com 成功注册了一个免费的域名,但是安如下的脚本不能自动更新,在ros的日志里看能成功,但是重启动电脑后changeip.com上的IP还是原来的不变,请问大家帮帮我,global domainname "yourdomainname"(此位应填定什么?是changeip.com吗?)
:global domainzone "yourdomainzone"(此位应填定什么?是changeip给我的域名吗如XX.mywww.biz吗)


:if ([/system scheduler get DDNS run-count ]=1) do={
:log info "DDNS: Creating Dynamic DNS update system."
:beep frequency=500
:global username "yourusername"
:global password "yourpassword"
:global domainname "yourdomainname"
:global domainzone "yourdomainzone"
}

:if ([/interface find type=pppoe-out running=yes]="") do={
:beep frequency=500 length=2s
:delay 4
:beep frequency=500 length=2s
:log warning "DDNS: No PPPoE is running."
} else={
:set intLocal [ /interface find type=pppoe-out running=yes ]
:set ipResolve ([:resolve ($domainname . "." . $domainzone)] . "/32")
:set ipLocal [ /ip address get [ /ip address find interface=$intLocal ] address ]
:if ($ipLocal != $ipResolve) do={
:log info ("DDNS: Resolved IP address : " . $ipResolve )
:log info ("DDNS: Local IP address : " . $ipLocal )
:log info ("DDNS: Sending Dynamic DNS update to server")
/tool dns-update zone=$domainzone name=$domainname key=$password key-name=$username address=[:pick $ipLocal 0 ([:len $ipLocal] - 3)]

/ip upnp set enabled=no
:delay 2
/ip upnp interfaces remove [/ip upnp interfaces find type=external ]
/ip upnp interfaces remove [/ip upnp interfaces find type=internal ]
:delay 2
/ip upnp interfaces add interface=[/interface get [/interface pppoe-client find running=yes ] name] type=external
/ip upnp interfaces add interface=LAN type=internal
:delay 2
/ip upnp set enabled=yes
/ip upnp set allow-disable-external-interface=no
/ip upnp set show-dummy-rule=no
:delay 2
/ip fi man set [/ip fi man find comment="flowback"] dst-address=$ipLocal
:beep frequency=500
}
}
routeros
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|软路由 ( 渝ICP备15001194号-1|渝公网安备 50011602500124号 )

GMT+8, 2024-12-23 04:04 , Processed in 0.037729 second(s), 4 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表