14 December, 2007

Ericsson W25 Dynamic DNS

Dynamic DNS is a technology used to have a permanent address even if your ip address is changing all the time. To do this you have to register at one of the Dynamic DNS providers (I have used no-ip.com), select a nice web address for yoursef (e.g. kiki.no-ip.info) update your ip address and access your computer on this new address (kiki.no-ip.info).

The update of your ip address can be done automatically by this simple script. The script checks your IP address and if it is changed it simply request the https page defined for updating your ip address. You can find this address for other DynDNS providers in their developer documentation. When requesting the update, you even don't have to include your IP address as the server will see it from the request.


#!bin/sh
IP=`ifconfig ppp0 |grep "inet addr" |awk '{print $2}' |awk -F: '{print $2}'`;
if [ ! -e /var/tmp/oldip ] ; then
OLDIP="1";
else
OLDIP=`cat /var/tmp/oldip`;
fi;
if [ $IP = $OLDIP ] ; then
echo "equal"; > /dev/null
else
wget -O /dev/null --http-user=your@email.address --http-passwd=yourpassword https://dynupdate.no-ip.com/nic/update?hostname=kiki.no-ip.info
fi;

echo $IP > /var/tmp/oldip
Save this script as dyndnsupdate to the /root direcftory and add the following to your /root/custominit:

echo "* * * * * /root/dyndnsupdate" >>/var/spool/cron/crontabs/root
sevice crond restart

1 comment:

Anonymous said...

I would like to use DDNS with my W25. Exactly how do I upload the script. Whick program etc. I am new to this.
Cheers
Maggno