Hi Hal,
Thank you for your offer of help. I really appreciate it! I'm not too
strong on the scripting languages and tools involved. Apologies, but
this reply is quite long...
Hal Burgiss wrote:
> On Sat, 28 Apr 2001 18:27:03 GMT, Malcolm Ferguson <Malcolm_Fergu...@yahoo.com> wrote:
> >Dean Thompson wrote:
> >> > I have a domain name and DNS service with easydns.ca. I have a
> >> > Debian server running behind my Netgear router. Easydns.com
> >> > officially supports "ez-ipupdate", but this only seems to work off
> >> > the eth?
> >Perhaps I'm not understanding the documentation properly. However, it
> >seems that ez-ipupdate can only determine IP addresses directly from a
> >network interface. This is no good for me as it will always detect
> >the private IP 192.168.0.34. It updates easydns.ca just fine with that
> >IP address, but that address is no good! I'm not quite sure what your
> >point about NAT is: I don't see how that is relevant.
> [hal@feenix hal]$ ez-ipupdate --help
> usage: ez-ipupdate [options]
> Options are:
> -a, --address <ip address> string to send as your ip address <------
> -b, --cache-file <file> file to use for caching the ipaddress
> -c, --config-file <file> configuration file, almost all arguments
> can be given with: <name>[=<value>]
> [...]
> You can specify an IP address via the command line, or if using the
> config file, in there too. See the examples.
That is an excellent idea.
> I gather your problem is that the router holds the routable IP from your
> ISP? OK, what you need to do is write a short script to pull this out.
> Most of these have a mini web server. Does this one? If so, you can do
> this with a oneliner:
You are correct on both scores. The WAN port of my router has the IP
from ISP. I use NAT to forward port 80 to my web server. The router
has a web server.
> MY_IP=`lynx -dump http://192.168.1.1/<path>/some.html |grep IP |sed 's/IP:\ //``
The web server requires authentication which the perl script in
ddnclient did as a base64-encoded HTTP request header. I finally
figured out that I can do it in one, although it will show up
(insecurely?) on the command line, e.g.:
http://user:passw...@192.168.0.1/mtenSysStatus.html
or, in the case of Lynx:
lynx -dump -auth=user:password http://192.168.0.1/mtenSysStatus.html
I like your suggestion of using Lynx in this way. I tried modifying the
Perl script from ddnclient, but Perl isn't my Forte, and I found I was
spending a lot of time just trying to trim out all the bits that I don't
need via trail-and-error (time consuming). Memory is tight on my
server, and I suspect that Lynx will have a bigger impact on the system
than Perl: inittab get's the cut and it won't spawning so many consoles
anymore.
> Just an example. If you'll send me the URL to the page, and the page
> itself, I'll do it for you (if you don't know how). Then you can do
> something like:
> /usr/local/bin/ez-ipupdate -S easydns -u hal:XXXXXX -R hal -h $HOST \
> -m $MX -a $MY_IP
> You can also use that one liner in a cron job to see when/if your IP
> changes.
> while true; do
> MY_IP=`lynx -dump http://192.168.1.1/<path>/some.html |grep IP |sed 's/IP:\ //``
> if ! [ "$OLD_IP" = "MY_IP" ]; then
> /usr/local/bin/ez-ipupdate -S easydns -u hal:XXXXXX -R hal -h $HOST \
> -m $MX -a $MY_IP
> OLD_IP=$MY_IP
> fi
> sleep $INTERVAL
> done
Okay, here it is. I mentioned the page above, but I'll repeat it here
to avoid scrolling (BTW, are the authentication details always hidden
from the ps command?):
lynx -dump -auth=user:password http://192.168.0.1/mtenSysStatus.html
And here's the HTML. For such a small page, it's quite long winded.
The interesting bit is under WAN port, where IP Address : 64.228.131.68.
<HTML><head>
<meta http-equiv='content-type' content='text/html;charset=iso-8859-1'>
<META NAME="generator" CONTENT="GoLive CyberStudio 3">
<script language="JavaScript">
function doSubmit()
{
top.buttom.location="ack.html";
}
function doLoad()
{
top.buttom.location="buttom.html";
}
function doEdit()
{
window.location="AddrEdit.html"
}
var szHelp="mtenHelp_1.html";
function doHelp()
{
window.open(szHelp, 'HELP',
'width=450,height=250,scrollbars=yes,resizable=yes');
}
</script>
</HEAD>
<BODY bgcolor="#000067" marginwidth="0" marginheight="0"
onload="doLoad();"
LINK=#000000 VLINK=#000000 ALINK=#000000 -->
<FORM METHOD="POST" ACTION="/Forms/mtenSysStatus">
<table WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0"
HEIGHT="25">
<TR>
<TD><DIV ALIGN=right>
<A HREF="#" onClick="doHelp()">
<IMG SRC="images/help.gif" WIDTH="55" HEIGHT="24" BORDER="0">
</A></DIV>
</TD>
</TR>
</TABLE>
<table WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0"
bgcolor="#FFFFFF">
<TR>
<TD><IMG SRC="images/deco_up.gif" WIDTH="30" HEIGHT="28">
</TD>
</TR>
</TABLE>
<table WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0"
bgcolor="#FFFFFF">
<TR>
<td WIDTH="3%">?</TD>
<td WIDTH="97%"><font face="Arial, Helvetica, sans-serif"><B><FONT
SIZE="5" color="#C0C0C0">
SYSTEM STATUS
</FONT></B></FONT></TD>
</TR>
</TABLE>
<table WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0"
bgcolor="#FFFFFF" HEIGHT="20">
<TR>
<TD>?</TD>
</TR>
</TABLE>
<table WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0"
bgcolor="#ffffff" HEIGHT="70%">
<TR>
<TD><DIV ALIGN=center>
<table WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0"
bgcolor="#ffffff" HEIGHT="70%">
<TR>
<TD><DIV ALIGN=center>
<table WIDTH="100%" BORDER="0" CELLSPACING="0"
CELLPADDING="0" bgcolor="#FFFFFF">
<TR>
<td WIDTH="10%">?</TD>
<TD>?</TD>
<td WIDTH="10%">?</TD>
</TR>
<TR>
<td WIDTH="10%">?</TD>
<td bgcolor="#ffbf3b">
<DIV ALIGN=center>
<table WIDTH="500" BORDER="0" CELLSPACING="0"
CELLPADDING="0">
<TR>
<TD>?</TD>
</TR>
<TR>
<TD><HR>
</TD>
</TR>
<TR>
<TD><font face="Arial, Helvetica,
sans-serif" size="2">
System Name : <B>
frontdoor </B></FONT></TD>
</TR>
<TR>
<TD><FONT SIZE="2" face="Arial, Helvetica,
sans-serif">
Firmware Version: <B>
V3.24(CA.0) | 2/8/2001 </B></FONT></TD>
</TR>
<TR>
<TD><FONT SIZE="2" face="Arial, Helvetica,
sans-serif">
<B>
</B></FONT></TD>
</TR>
<TR>
<TD>?</TD>
</TR>
<TR>
<TD><font face="Arial, Helvetica,
sans-serif" font size="3"><B>
WAN Port : </B></FONT></TD>
</TR>
</TABLE>
<table WIDTH="480" BORDER="0" CELLSPACING="0" CELLPADDING="0">
<TR>
<td WIDTH="260" COLSPAN="13"><font
face="Arial, Helvetica, sans-serif" size="2">
IP Address : <B>
64.228.131.68 </B></FONT></TD>
<td WIDTH="20">?</TD>
<td WIDTH="180" COLSPAN="9"><font face="Arial, Helvetica, sans-serif"
size="2">DHCP
: <B>
None </B></FONT></TD>
<td WIDTH="20">?</TD>
</TR>
<TR>
<td WIDTH="480" COLSPAN="24"><font
face="Arial, Helvetica, sans-serif" size="2">
IP Subnet Mask : <B>
255.255.255.255 </B></FONT></TD>
</TR>
</TABLE>
<table WIDTH="480" BORDER="0" CELLSPACING="0" CELLPADDING="0">
<TR>
<TD>?</TD>
</TR>
</TABLE>
<table WIDTH="500" BORDER="0" CELLSPACING="0" CELLPADDING="0">
<TR>
<TD><font face="Arial, Helvetica,
sans-serif" size="3"><B>
LAN Port : </B></FONT></TD>
</TR>
</TABLE>
<table WIDTH="480" BORDER="0" CELLSPACING="0" CELLPADDING="0">
<TR>
<td WIDTH="260" COLSPAN="13"><font
face="Arial, Helvetica, sans-serif" size="2">
IP Address : <B>
192.168.0.1 </B></FONT></TD>
<td WIDTH="20">?</TD>
<td WIDTH="180" COLSPAN="9"><font face="Arial, Helvetica, sans-serif"
size="2">DHCP
: <B>
Server </B></FONT></TD>
<td WIDTH="20">?</TD>
</TR>
<TR>
<td WIDTH="480" COLSPAN="24"><font
face="Arial, Helvetica, sans-serif" size="2">
IP Subnet Mask : <B>
255.255.255.0 </B></FONT></TD>
</TR>
</TABLE>
<table WIDTH="500" BORDER="0" CELLSPACING="0" CELLPADDING="0">
<TR>
<TD><HR>
<font face="Arial, Helvetica, sans-serif" size="2"><B></B></FONT></TD>
</TR>
</TABLE>
<table WIDTH="500" BORDER="0" CELLSPACING="0" CELLPADDING="0">
<TR>
<TD><DIV ALIGN=center>
<INPUT TYPE=BUTTON VALUE="Show Statistics"
onClick="window.open('mtenSystStatusFrame.html', '',
'width=720,height=250,status=yes');">
</DIV>
</TD>
</TR>
<TR>
...
read more »