Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

shell script to check a dynamic ip 1

Status
Not open for further replies.

wlf

Technical User
Sep 25, 2002
47
0
0
US
Hi, I need a shell script to check a dynamic ip(from cable company), it will send the ip to my email if the ip changes. The Solaris box is behind the router with a static ip (internal), the router connected with a cable modem for internet connection. The problem is the cable company assigned you a dynamic ip, and it changes sometime. When that happens, I can't not access my Solaris box outside my home. On the local box I can know my current external ip through the How can I write that in a script to send the ip to my email if it changes? I'm using C shell. Thanks.
 
Sorry, Bourne shell not C shell.
 
Hi there,

I had this problem also and found that no-ip.org offers a script for any OS that takes care of this cumbersome problem. I'm currently running it for some months now without restarting it or the server.
You create a no-ip.org redirector (free) that updates the DNS root servers everytime your WAN IP changes.
The script just checks every n (you choose) minutes if your wan ip didn't change, if it did it updates the no-ip.org dns record and eventually it gets updated worldwide.
I also found that tracerouting makes the DNS update go faster in case you try to connect at the same time your dynamic IP changes, but in general its pretty fast, never had a problem accessing my internal lan sun box using the no-ip.org redictor URL.

Hope that helps,
Igaduma
 
Thanks so much, and it works greate. -wolf
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top