Welcome to the updated Slickdeals redesign beta. Learn more and give us feedback. Or, return to the classic view.

Search in
Forum Thread

DD-WRT Router (WAN) IP Address Email?

msvista 71 February 18, 2012 at 04:27 PM
I want to access my Router's home page over the internet. I have DSL , hence I get dynamic IP address. Is there a way to get the an email every time IP changes. I don't want to keep the PC on all the time just for this purpose.

Is there a way/script to check your WAN ip for changes (here), and email the new ip-address ?

10 Comments

1

Sign up for a Slickdeals account to remove this ad.

#2
Google dyndns. You can have your router check in there and maybe get an email from dyndns when it changes.

If you setup dyndns you won't need that email, just the url xxxxxx.homeip.net or similar.
Reply Helpful Comment? 0 0
#3
I 2nd beefcake78 its exactly what I do.
Depending on what you are doing be aware you might need to forward the port to the computer, so its also a good idea to reserve the ip in your router so that device always get the same ip.
Reply Helpful Comment? 0 0
L4: Apprentice
71 Reputation
Original Poster
#4
Quote from beefcake78 View Post :
Google dyndns. You can have your router check in there and maybe get an email from dyndns when it changes.

If you setup dyndns you won't need that email, just the url xxxxxx.homeip.net or similar.
dyndns seems a paid access, is there any freeware alternate available?

Quote from mrbobhcrhs View Post :
I 2nd beefcake78 its exactly what I do.
Depending on what you are doing be aware you might need to forward the port to the computer, so its also a good idea to reserve the ip in your router so that device always get the same ip.
I did those two.
Reply Helpful Comment? 0 0
#5
At it's most basic, and there's probably more graceful ways to do it, but run this from cron periodically

Code:
#!/bin/bash

if [ -f n09230945.asp ]; then
  mv n09230945.asp prev_n09230945.asp
  wget -o /tmp/ip.log http://automation.whatismyip.com/n09230945.asp
  PREV=$(cat prev_n09230945.asp)
  CUR=$(cat n09230945.asp)
  if [ $PREV -ne $CUR ]; then
    mailx -s "new IP is $CUR" your.email@domain.com
  fi
else
  wget -o /tmp/ip.log http://automation.whatismyip.com/n09230945.asp
fi

exit 0
edit - enough people have mentioned dyndns :-)
Reply Helpful Comment? 0 0
L4: Apprentice
71 Reputation
Original Poster
#6
Quote from vivahate View Post :
At it's most basic, and there's probably more graceful ways to do it, but run this from cron periodically

Code:
#!/bin/bash

if [ -f n09230945.asp ]; then
  mv n09230945.asp prev_n09230945.asp
  wget -o /tmp/ip.log http://automation.whatismyip.com/n09230945.asp
  PREV=$(cat prev_n09230945.asp)
  CUR=$(cat n09230945.asp)
  if [ $PREV -ne $CUR ]; then
    mailx -s "new IP is $CUR" your.email@domain.com
  fi
fi

exit 0
edit - enough people have mentioned dyndns :-)
Thanks for sharing that script.

How to make use of this script? Where can I store/put this?
Reply Helpful Comment? 0 0
#7
Quote from msvista View Post :
dyndns seems a paid access, is there any freeware alternate available?



I did those two.
Did not realize that they changed. but log in to the router and see what it supports this should be a few:
DynDNS, easyDNS, FreeDNS, No-IP, TZO, ZoneEdit
Reply Helpful Comment? 0 0
L4: Apprentice
71 Reputation
Original Poster
#8
Quote from mrbobhcrhs View Post :
Did not realize that they changed. but log in to the router and see what it supports this should be a few:
DynDNS, easyDNS, FreeDNS, No-IP, TZO, ZoneEdit

In DDNS Drop down I got just 2
DynDNS
TZO
Reply Helpful Comment? 0 0

Sign up for a Slickdeals account to remove this ad.

#9
Quote from msvista View Post :
In DDNS Drop down I got just 2
DynDNS
TZO
maybe this [dd-wrt.com] will help. My ddwrt router is not up and running atm to look my self.
Reply Helpful Comment? 0 0
#10
Quote from msvista View Post :
Thanks for sharing that script.

How to make use of this script? Where can I store/put this?
If you want to go this route you can put the script anywhere you like in the dd-wrt file-system... if does assume wget and mailx are installed (and mailx is working which might not be true)

You just need to make it executable (# chmod 755 /path/to/file.sh) and then run it from cron... for example

30 * * * * /path/to/file.sh

would run it every 30 minutes

I just noticed a lovely flaw in the original code... it would never get the IP from whatismyip.com :-) The extra 'else' statement corrects it.

If it was purely to check IPs I'd probably just use a combination of 'ifconfig' and grep/awk but the benefit of using something like 'whatismyip' is that it's also checking your internet connectivity and you can build stuff upon that
Reply Helpful Comment? 0 0
Helen Reddy, standing by
1,485 Reputation
#11
Reply Helpful Comment? 0 0
Page 1 of 1
1
Join the Conversation
Add a Comment
 
Slickdeals Price Tracker
Saving money just got easier.
Start Tracking Today
Copyright 1999 - 2015. Slickdeals, LLC. All Rights Reserved. Copyright / DMCA Notice  •  Privacy Policy  •  Terms of Service  •  Acceptable Use Policy (Rules)