dd-wrt自动更新ddns
2018-04-03 13:05
211 查看
准备脚本
添加到路由器启动脚本
通过web接口
通过nvram命令
路由器重启,不能及时更新ip到dns,如何解决,下面方法可以解决。前提是已经注册了ddns网站,获得ddns域名,在dd-wrt路由上正确配置了ddns。ddns通过手动更新可以获得正常域名ip匹配,现在需要自动更新,即设备重启后更新。
http://freedns.afraid.org/dynamic/index.php
提供有wget,curl,cron等脚本示例,根据自己路由器支持程度,选择合适的脚本
添加到路由器启动脚本
通过web接口
通过nvram命令
路由器重启,不能及时更新ip到dns,如何解决,下面方法可以解决。前提是已经注册了ddns网站,获得ddns域名,在dd-wrt路由上正确配置了ddns。ddns通过手动更新可以获得正常域名ip匹配,现在需要自动更新,即设备重启后更新。
准备脚本
提供ddns解析的网站一般提供更新脚本,譬如http://freedns.afraid.org/dynamic/index.php
提供有wget,curl,cron等脚本示例,根据自己路由器支持程度,选择合适的脚本
sleep 36 wget -q -t=400 http://freedns.afraid.org/dynamic/update.php?dksiejlsfkdielakielskjfielakdfie[/code]
每个注册用户的脚本是不同,请复制粘贴自己的脚本。
sleep 是必须的,否则不能正常启动脚本。
下面是花生壳的wanip=$(nvram get wan_ipaddr) wget -q -O /var/log/hsk.log http://用户名:密码@ddns.oray.com/ph/update?hostname=花生壳域名&myip=$wanip >/dev/null 2>&1添加到路由器启动脚本
https://www.dd-wrt.com/wiki/index.php/Startup_Scripts
两个方法通过web接口
Using the Web Interface, goto the Administration tab.
If available, go to the Command subtab, otherwise go to the diagnostics subtab.
Type the commands you wish to run every startup into the Commands: dialog box (place each command on a newline using the enter key, and if the command isn’t something that stops running after a moment, put a ‘&’ after the command)
Click the Save Startup button at the bottom of the page if you’d like the commands to save into the rc_startup variable (you may need to scroll). Save Firewall will save the commands into the rc_firewall variable.通过nvram命令
Login to your router using Telnet/SSH
To set the startup scripts, use the following:nvram set rc_startup=" <command 1> <command 2> ... <command n> "
When you give the commandnvram commit the rc_startup
9e34
variable is saved in flash memory and will remain when you reboot.nvram commit
相关文章推荐
- dd-wrt ddns更新失败由于电信提供的ip不是公网ip
- DD-WRT网站白名单控制续--防火墙脚本自动更新
- Openwrt Attitude Adjustment脚本更新DDNS IP 以Oray花生壳为例子
- RouterOS ADSL设置DDNS 自动更新
- Openwrt Attitude Adjustment脚本更新DDNS IP 以Oray花生壳为例子
- 终极自动更新花生壳动态域名(DDNS)更新方法
- 思科E3200 路由器 DD-WRT 设置花生壳和3322.org动态域名(DDNS)
- Linux架设DDNS服务器之自动更新脚本
- 思科E3200 路由器 DD-WRT 设置花生壳和3322.org动态域名(DDNS)
- 在dd-wrt的路由器系统中实现pppoe空闲自动断线
- 关于SVN限制填写备注和自动更新代码到网站的研究
- Android应用自动更新功能的代码实现
- 使用 .NET 和后台智能传输服务 API 来编写自动更新应用程序。
- Android应用自动更新功能的代码实现
- 使用诺基亚手机自动更新时间功能
- Batch 自动更新替换文件
- mysql更新记录时设置自动更新时间戳
- android之apk自动更新解析包失败问题
- eclipse老是building workspace及自动更新问题,保存就更新