Monday, April 23, 2012

otomatis interface reconnect pada openwrt

Ive also faced this issue. Ive follow tutorial made by Cezary on Polish website eko.one.pl.
You need to create script which pings external IP (IE google DNS: 8.8.8.8) and if necessary  - restart the connection.
Ive translate tutorial for You to english:
1. create file

Code:

# touch /bin/tester.sh
# chmod 755 /bin/tester.sh
2. put following content in it (modify 3rd line and put your connection name if its not "wan") :

Code:

#!/bin/sh
    if ! ping -q -c 1 -W 10 8.8.8.8 > /dev/null; then
        (ifup wan) &
    fi
3. issue in terminal following commands (stop cron, modify cron, restart cron to apply changes):

Code:

# /etc/init.d/cron stop
# echo "*/2 * * * * /bin/tester.sh" >> /etc/crontabs/root
# /etc/init.d/cron enable
# /etc/init.d/cron start
Cron is configured to run the script every 2 minutes. You can change the value if You need but its good value.
This fixed my problems with 3G modem.
Last edited by janptak (2011-09-08 12:49:50)

WNDR3700. OpenWrt+LuCI. Multiwan with Huawei E372 and E1750.

No comments:

Post a Comment