Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 06-24-2003, 02:52 PM   #1
LQ Newbie
Registered: May 2003
Posts: 27

Rep: Reputation: 15
Cable modem/server/IP address trick

I just moved into a new place, and hoped beyond hope that I could get DSL. No dice. So, I'm stuck with cable. Anyway, I have a personal chatroom and webcam on my server, and also use it as a Squid gateway from work. All of this functioning is dependent on me having my home IP address.

When I got the server online last week I was thrilled to see that I had a relatively easy-to-memorize IP addie, and I ran with it. Well, midday today for no apparent reason (server certainly wasn't cycled) the IP changed completely to a horrible number. Comcast didn't used to do this to me, and hopefully this is just a freak thing.

In the event that it isn't, I am curious about what sort of options there are out there to get a server (running Mandrake 9.1) to report changes in IP address, either via email or via FTP upload to another address. I don't recall seeing anything out there, and I'm not qualified enough to be able to script up my own little program to do it.

Thanks for any and all feedback you can provide. I suppose I could keep having my wife email me to get the new IP, but I'd like to find something more automated.
Old 06-24-2003, 03:36 PM   #2
Registered: Feb 2001
Location: Colorado Springs, CO
Distribution: Redhat v8.0 (soon to be Fedora? or maybe I will just go back to Slackware)
Posts: 857

Rep: Reputation: 30
I would first suggest monitoring the system to see how often the addy changes. That will help in trying to circumvent this process.

Also, I have a script that I use to collect my IP info and send it up to a web page to the server that hosts my subdomain name:


#Getting my IP addy
export IPADDR=`/sbin/ifconfig eth0 | grep inet | awk -F":" '{print $2}' | awk '
{print $1}' `

#making my html page
echo "
<head><title>Home for</title></head>
<P><center><H1>Welcome to the homepage of MyDomain</H1>
<P><img src=\"MyPicture.jpg\">

<P><a href=\"http://"$IPADDR\""><H1>Click here to enter...</H1></center></

" > /etc/default.html

#sending it into my static server
ncftpput -u MyUsername -p MyPassword / /etc/default.html

Keep in mind that I know next to NOTHING about scripting and HTML coding.. but this is simple enough and it works for me. Anyone with improvments upon the process... feel free to post.

Old 06-24-2003, 03:40 PM   #3
LQ Newbie
Registered: May 2003
Posts: 27

Original Poster
Rep: Reputation: 15
Thumbs up

That looks like a cool start that I'll have to play with tonight after dinner. Thanks for the help, Kevin!
Old 06-24-2003, 04:50 PM   #4
Senior Member
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 47
You might also want to look at - I used to use one of their domains to follow around my dynamic cable modems address. I ran a script that would detect any change in IP address and update DynDNS as necessary.


Old 06-25-2003, 09:24 PM   #5
Registered: Mar 2003
Location: soCal..
Distribution: lfs server.. slackware workstation..
Posts: 58

Rep: Reputation: 15
hello jamie.. i'm just getting started with dyndns on linux.. and was wondering how you got the script set up in your system..

edit: nvm.. i just had to add my domain and multiple sub-domains in the ddclient.conf file..

linux rowx..

Last edited by miguetoo; 06-25-2003 at 10:43 PM.
Old 06-26-2003, 05:41 AM   #6
Senior Member
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 47
I don't use the update script anymore as I've got a static IP now, but I was just running a script from cron even 5 mins or so. I'll have a dig around and see what client I was using.


Old 06-26-2003, 08:49 AM   #7
Registered: Dec 2001
Distribution: LFS, RH, Slack
Posts: 104

Rep: Reputation: 15
On the off chance that you have a Home NAT Router, many of them have builtin support for Dynamic DNS and will report the IP automatically.

I run an FTP/HTTP box behind a NAT router with dynamic IP. I don't have a domain name, so what I did was to register a fortunecities webpage for free, then I wrote a shell script that can automatically check the IP by logging into my router. It then uploads a simple redirect page on the fortunecities website. I run it as a cron job hourly, though my IP doesn't change unless the modem is reset.

Of course, you can get your IP address from the Linux box if it is connected directly to the cable modem and do the same thing.

If you do have a domain addy already, check DynDNS.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Only 1 cable modem will work with my server?! WorldBuilder Linux - Networking 16 08-31-2005 05:38 PM
Web Server on Cable Modem VorlonInfoTech Linux - Networking 12 10-05-2004 09:19 PM
cannot get dhcp address from cable modem, using mandrake 9.0 nanosyche021 Linux - Networking 2 12-06-2003 12:27 AM
DSL/Cable modem router IP address peter72 Linux - Networking 8 02-22-2003 08:49 PM
How do I map registered domain to my cable modem static ip address munisp Linux - Networking 2 11-20-2001 06:32 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:29 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration