Re: dynamic IP questions?
From: charlie derr (cderr_at_simons-rock.edu)
Date: 01/20/04
- Previous message: Jan Minar: "Re: Programs with colourful, moving, images???"
- In reply to: Vikki Roemer: "Re: dynamic IP questions?"
- Next in thread: Pigeon: "Re: dynamic IP questions?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 20 Jan 2004 14:22:42 -0500 To: debian-user@lists.debian.org
Vikki Roemer wrote:
> On Sat, Jan 10, 2004 at 09:13:55AM -0500, 0debian user wrote:
>
>>Also I wanted to run my own web server and mail server but my machine is
>>not always online so how can I do it?
>
>
> Go to http://www.dyndns.org/ and sign up there. They give you up to 5
> hostnames for free, you just have to update the IP address every time you
> redial. That's who I get my 3 hostnames through, and I'm happy with them. :)
> I recommend ipcheck.py (apt-get install ipcheck) to update the addy.
> However, don't ask me how to *automate* the update script, because I'm still
> trying to figure that out myself.
>
> HTH.
>
Here's the entry in /etc/crontab on my gateway/router machine (that
connects via pppoe to my adsl provider) for those interested in
automating this sort of thing.
0-55/5 * * * * root /root/radscripz/reconnector.py
And the contents of reconnector.py (with my personal details replaced
with <something>).
<file>
#!/usr/bin/env python
import os, string, sys, time, smtplib
fi,fo = os.popen2('/sbin/ifconfig','t')
sss = fo.read()
fi.close()
fo.close()
if string.find(sss,"ppp0") > -1:
sys.exit(0)
ei, eo = os.popen2('/usr/local/bin/start-pppoe', 't')
ei.close()
eo.close()
time.sleep(10)
os.chdir('/root/dyndns')
gi, go = os.popen2('/usr/bin/python /root/dyndns/ipcheck.py -l -i ppp0
<dyndns-username> <dyndns-password> <dyndns-hostname>','t')
gi.close()
res = go.read()
go.close()
mailcon = smtplib.SMTP('<mailserver>', port=25)
recips = ['<address1>', '<address2>']
mailcon.sendmail('connexor@<machine-name>', recips, res)
mailcon.quit()
sys.exit(0)
</file>
Basically, it runs every five minutes and if the connection has died, it
reconnects, then updates the dyndns stuff and also emails me at several
addresses with the new IP (which is probably redundant, but it does have
the added benefit of providing me with a record of how often I've been
disconnected).
good luck,
~c
-- This is not a democracy; it's a cheerocracy. -Torrance Shipman -- To UNSUBSCRIBE, email to debian-user-request@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
- Previous message: Jan Minar: "Re: Programs with colourful, moving, images???"
- In reply to: Vikki Roemer: "Re: dynamic IP questions?"
- Next in thread: Pigeon: "Re: dynamic IP questions?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|