看门狗功能肯定是ping一个存在的ip,ping不到意味着前端的设备无响应。通常如果你有linux像ddwrt之类的路由你可以通过cron任务在每天的6点30分禁止来自192.168.10.243的icmp回应,那么后端的设备自然就会相应的重启。没玩过UBNT,不知道它设备项在哪里。
30 6 * * * root /tmp/bicmp_dato.sh
iptables -I INPUT -p icmp –icmp-type 8 -s 192.168.10.243 -j DROP
看老外的这帖cron实现,如果你熟悉linux操作系统这应该是最简单的实现。只是偶在unifi ap下重启以后需要ssh每次执行一次
crond for airos 5
http://community.ubnt.com/t5/airOS-Software-Configuration/crond-for-airos-5/td-p/350458
BusyBox v1.11.2 (2013-10-08 11:33:06 PDT) built-in shell (ash)
Enter ‘help’ for a list of built-in commands.
BZ.v2.4.6# ls
cfg etc kick_dato.sh rb_dato.sh rc_dato.sh
cplog_dato.shfile.txt log rc.prestart unifi.tar
BZ.v2.4.6# cat rb_dato.sh
#!/bin/sh
if ! ping -c 1 192.168.10.253 /dev/null;then
echo `(date + %m/%d/%Y %T )` reboot_ /etc/persistent/log;
cfgmtd -w -p /etc/;/etc/rc.d/rc restart
fiBZ.v2.4.6# cat rc_dato.sh
#!/bin/sh
/etc/rc.d/rc restart
echo `(date + %m/%d/%Y %T )` rc restart_ /etc/persistent/log
BZ.v2.4.6# crontab -l
#
# /etc/persistent/etc/crontabs/ubnt
# This is the ubnt user’s crontab
#
# File Format field values
# +———————————– minute 0-59
# | +—————————— hour 0-23
# | | +————————- day of month 1-31
# | | | +——————– month 1-12
# | | | | +————— weekday 0-6
# | | | | | +———- command
# | | | | | |
# */5* * * * /do/something/here
#1 4 * * * /etc/persistent/cplog_dato.sh
*/5 9-17 * * * /etc/persistent/rb_dato.sh
1 5 * * 1 rm /etc/persistent/log
1 7 * * * /etc/persistent/rc_dato.sh
*/10 9-17 * * * /etc/persistent/kick_dato.shBZ.v2.4.6#