wndr4300刷openwrt,因为是双拨,一条是电信,一条线是华数,其中华数的ip外网是无法连接,而且如果直接用wget更新ip就有可能抓到华数的ip,所以想指定电信出口的wan。在网上找了很多帖子和教程都无果。希望诸位大大能帮帮小弟。
WANIF="pppoe-wan2"
MYIP=`ifconfig ${WANIF} |grep \"inet addr\" | cut -d : -f 2 | cut -d'B' -f 1"`
nonceIP=`ifconfig -a|grep -A 1 $INTERFACE|grep inet|awk '{print $2}' |awk -F: '{print $2}'`
usedIP=`cat /tmp/usedIP.txt
if [ "$nonceIP" == "$usedIP" ]; then
echo $nonceIP > /tmp/nonceIP.txt
else
wget -q -O- 'http://nic.ChangeIP.com/nic/update?hostname=******&${WANIF}&u=*****&p=******&cmd=update&offline=0'
echo $nonceIP > /tmp/usedIP.txt
fi
WANIF="pppoe-wan2"
MYIP=`ifconfig ${WANIF} |grep \"inet addr\" | cut -d : -f 2 | cut -d'B' -f 1"`
nonceIP=`ifconfig -a|grep -A 1 $INTERFACE|grep inet|awk '{print $2}' |awk -F: '{print $2}'`
usedIP=`cat /tmp/usedIP.txt
if [ "$nonceIP" == "$usedIP" ]; then
echo $nonceIP > /tmp/nonceIP.txt
else
wget -q -O- 'http://nic.ChangeIP.com/nic/update?hostname=******&${WANIF}&u=*****&p=******&cmd=update&offline=0'
echo $nonceIP > /tmp/usedIP.txt
fi