[WLANware] cron.minutely + DynGW, unerreichbare ips

tetzlav tetzlav at leipzig.freifunk.net
Thu Dec 20 19:33:30 CET 2007


Ufo schrieb:
> lorenz schori schrieb:
>   
>> Wir beobachten bei unseren Uplinks ab und zu mal dass gewisse Server aus 
>> der Liste der IPs von cron.minutely nicht erreichbar sind mit der Folge, 
>> dass regelmässig die das HNA-Announcement ins Internet rausfliegen. 
>>     

deßhalb bin ich dabei die CHKIPs im nvram konfigurierbar zu machen:
-------------
nvram set
ff_dyngw_iplist='198.41.0.4;192.33.4.12;128.8.10.90;192.5.5.241;192.36.148.17;192.58.128.30;193.0.14.129;198.32.64.12;202.12.27.33'
commit

IPLIST=$(nvram get ff_dyngw_iplist)
IFS=\;
set $IPLIST
unset IFS

rand="$(dd if=/dev/urandom bs=2 count=1 2>&- | hexdump | if read line;
then echo 0x${line#* }; fi)"
eval $(echo  ip=\$$(($(( $rand % 9 )) + 1)))
[ -z $ip ] && exit

eval $(traceroute -f 3 -w 5 -m 5 -n $ip 2>&- | sed -ne '/^ \+[0-9]\+
\+[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+ /{s/.*/ok=$(( $ok + 1));/;p}')

if [ $ok -ge 2 ]; then ...
-------------

so ist das script wesentlich flexibler...


> also mit deinem "-t2"-aparameter ist bei meinem testgerät niemand 
> erreichbar. 

busybox-ping kennt den -t(imeout)-Parameter nicht, und für meine bash
ist das -W

for ip in 198.41.0.4 192.33.4.12 128.8.10.90 192.5.5.241 192.36.148.17 \
192.58.128.30 193.0.14.129 198.32.64.12 202.12.27.33; do
ping -c1 -W2 $ip && echo "=== HOST $ip is OK ===" || \
echo "=== HOST $ip is UNREACHABLE ==="; echo; done



Gruß
tetzlav



More information about the WLANware mailing list