Networking Forums

Networking Forums > Computer Networking > Linux Networking > Could lease-IP-change trigger event?

Reply
Thread Tools Display Modes

Could lease-IP-change trigger event?

 
 
hiwa
Guest
Posts: n/a

 
      02-22-2004, 09:26 AM
We have a commercial broadband router between an FTTH end and an home
LAN. The broadband router acts as a DHCP/PPPoE client for ISP and as a
DHCP server for the LAN. If I want to write a wrapper program for
invoking a dynamic DNS service client which we want should be
triggered by the ISP leased IP change, how could I intercept the
change from my C or Java code as an event?

Almost all of the existing dynamic DNS service client programs use
polling with a fixed time interval for detecting the lease change. So,
we can't use them at our specific needs, of which description might be
out of context here.
 
Reply With Quote
 
 
 
 
David Efflandt
Guest
Posts: n/a

 
      02-22-2004, 04:18 PM
On 22 Feb 2004 02:26:28 -0800, hiwa <(E-Mail Removed)> wrote:
> We have a commercial broadband router between an FTTH end and an home
> LAN. The broadband router acts as a DHCP/PPPoE client for ISP and as a
> DHCP server for the LAN. If I want to write a wrapper program for
> invoking a dynamic DNS service client which we want should be
> triggered by the ISP leased IP change, how could I intercept the
> change from my C or Java code as an event?
>
> Almost all of the existing dynamic DNS service client programs use
> polling with a fixed time interval for detecting the lease change. So,
> we can't use them at our specific needs, of which description might be
> out of context here.


PPPoE and DHCP are different protocols. PPPoE has no "lease" time and
typically gets a new IP whenever it connects (if dynamic). The DHCP on
the LAN side of your router will not tell you when PPPoE gets a new IP.

If your (undisclosed) router has any sort of remote logging, you could
monitor that (syslog or SNMP), or there are some router specific programs
that can actually log in and grab log info. Impossible for anybody to
answer specifically without knowing what hardware/firmware.

When I was using a Dlink DI-704, it had no remote logging and
frames/JavaScript made it difficult to log in from a script, so I hacked
its firmware (substituting variables for same number of text characters)
on its login screen, and was able to monitor its WAN IP with a Perl LWP
script running as a daemon, without having to login.

I am now running Linux as pppoe/firewall/masq/router, updating DNS from
/etc/ppp/ip-up script (which runs automatically when ppp or pppoe IP
gets an IP).

--
David Efflandt - All spam ignored http://www.de-srv.com/
 
Reply With Quote
 
hiwa
Guest
Posts: n/a

 
      02-23-2004, 12:29 AM
(E-Mail Removed) (David Efflandt) wrote in message news:<(E-Mail Removed)>...
> On 22 Feb 2004 02:26:28 -0800, hiwa <(E-Mail Removed)> wrote:
> > We have a commercial broadband router between an FTTH end and an home
> > LAN. The broadband router acts as a DHCP/PPPoE client for ISP and as a
> > DHCP server for the LAN. If I want to write a wrapper program for
> > invoking a dynamic DNS service client which we want should be
> > triggered by the ISP leased IP change, how could I intercept the
> > change from my C or Java code as an event?
> >
> > Almost all of the existing dynamic DNS service client programs use
> > polling with a fixed time interval for detecting the lease change. So,
> > we can't use them at our specific needs, of which description might be
> > out of context here.

>
> PPPoE and DHCP are different protocols. PPPoE has no "lease" time and
> typically gets a new IP whenever it connects (if dynamic). The DHCP on
> the LAN side of your router will not tell you when PPPoE gets a new IP.
>
> If your (undisclosed) router has any sort of remote logging, you could
> monitor that (syslog or SNMP), or there are some router specific programs
> that can actually log in and grab log info. Impossible for anybody to
> answer specifically without knowing what hardware/firmware.
>
> When I was using a Dlink DI-704, it had no remote logging and
> frames/JavaScript made it difficult to log in from a script, so I hacked
> its firmware (substituting variables for same number of text characters)
> on its login screen, and was able to monitor its WAN IP with a Perl LWP
> script running as a daemon, without having to login.
>
> I am now running Linux as pppoe/firewall/masq/router, updating DNS from
> /etc/ppp/ip-up script (which runs automatically when ppp or pppoe IP
> gets an IP).


Thanks David for your valuable info. As I am downright a newbie for
networking and its management, may I ask couple more question?(which
I'm afraid might be too obvious for you)

> If your (undisclosed) router has any sort of remote logging, you could
> monitor that (syslog or SNMP), or there are some router specific programs
> that can actually log in and grab log info.


(1)My router's config page has an input form:

[log forwarding]
syslog server : ______________________

What should I write in the 'syslog server:' field? In other words,
what should be my syslog server's address?

(2)Currently, output from ps -ax has an entry:

syslogd -m 0

Then, what should be the proper configuration for syslogd program for
getting the log from the router? In other words, what should I write
or do and where?

Thanks a LOT in advance!
 
Reply With Quote
 
David Efflandt
Guest
Posts: n/a

 
      02-24-2004, 05:55 AM
On 22 Feb 2004 17:29:03 -0800, hiwa <(E-Mail Removed)> wrote:
> (E-Mail Removed) (David Efflandt) wrote in message news:<(E-Mail Removed)>...
>> On 22 Feb 2004 02:26:28 -0800, hiwa <(E-Mail Removed)> wrote:
>> > We have a commercial broadband router between an FTTH end and an home
>> > LAN. The broadband router acts as a DHCP/PPPoE client for ISP and as a
>> > DHCP server for the LAN. If I want to write a wrapper program for
>> > invoking a dynamic DNS service client which we want should be
>> > triggered by the ISP leased IP change, how could I intercept the
>> > change from my C or Java code as an event?
>> >
>> > Almost all of the existing dynamic DNS service client programs use
>> > polling with a fixed time interval for detecting the lease change. So,
>> > we can't use them at our specific needs, of which description might be
>> > out of context here.

(snip)
>
> Thanks David for your valuable info. As I am downright a newbie for
> networking and its management, may I ask couple more question?(which
> I'm afraid might be too obvious for you)
>
>> If your (undisclosed) router has any sort of remote logging, you could
>> monitor that (syslog or SNMP), or there are some router specific programs
>> that can actually log in and grab log info.

>
> (1)My router's config page has an input form:
>
> [log forwarding]
> syslog server : ______________________
>
> What should I write in the 'syslog server:' field? In other words,
> what should be my syslog server's address?


Usually the IP of something that accepts remote syslog, hopefully with a
static IP (in same network outside of DHCP assigned range) or that always
gets the same DHCP IP.

> (2)Currently, output from ps -ax has an entry:
>
> syslogd -m 0


Whatever launches syslogd may have to include the -r switch for remote
logging, unless you have an old syslogd before v1.3 (see man syslogd). If
you have a name for IP of router and the entire hostname.domain shows up
in logs, the domain can be stripped with -s domain switch. Since I am
running named chroot (so it cannot access /dev/log directly) and my local
domain is literally 'local', mine shows up in 'ps ax' as:

/sbin/syslogd -r -s local -a /var/lib/named/dev/log

Or it could be possible to write a Perl script that would listen on UDP
port 514 instead of enabling syslogd -r, but I have not tried that and do
not have an example of a udp server.

> Then, what should be the proper configuration for syslogd program for
> getting the log from the router? In other words, what should I write
> or do and where?


I am running SuSE 8.2, so in /etc/sysconfig/syslog I set:

SYSLOGD_PARAMS="-r -s local"

and it may have automatically set:
SYSLOGD_ADDITIONAL_SOCKET_NAMED="/var/lib/named/dev/log"

Make sure that any firewall is NOT blocking UDP port 514 from LAN.

In my case WAP11 (aplink.local) shows up in /var/log/messages like:

Dec 13 16:19:26 aplink Created syslog task. ^M
Dec 13 16:19:26 aplink System ready ... ^M
Dec 13 16:19:26 aplink System started ^M
Dec 13 16:19:26 aplink Wireless PC connected 00-04-E2-63-8B-3A^M

As far as monitoring that, once you figure out what you are looking for in
/var/log/messages, see 'perldoc -q tail'. And once that is working look
for 'daemonize' in 'perldoc perlipc' to fork it into the background.

--
David Efflandt - All spam ignored http://www.de-srv.com/
 
Reply With Quote
 
hiwa
Guest
Posts: n/a

 
      02-25-2004, 09:00 AM
Thank you very much David. This, I hope, should be the final question
regarding router log forwarding.

(E-Mail Removed) (David Efflandt) wrote in message
> > (1)My router's config page has an input form:
> >
> > [log forwarding]
> > syslog server : ______________________
> >
> > What should I write in the 'syslog server:' field? In other words,
> > what should be my syslog server's address?

>
> Usually the IP of something that accepts remote syslog, hopefully with a
> static IP (in same network outside of DHCP assigned range) or that always
> gets the same DHCP IP.

My router LAN address is 192.168.11.1 and eh0 on my machine is
assigned 192.168.11.3. Then, what should be the 'syslog server :'
entry for the router config form?

(1)192.168.11.3
(2)127.0.0.1
(3)localhost.localdomain
(4)localhost
(5)other: __________________
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Lease obtained; lease expires" - can someone explain these? hungerdunger Broadband 27 01-20-2008 09:43 AM
LSASRV Event 40960 and Failure Audit Event 673 since Feb 2007 Drew Govnyak Windows Networking 1 07-25-2007 05:34 AM
Need help resolving Event ID 1054 errors appearing in event log every 5 mins! thelotus99@gmail.com Windows Networking 2 07-16-2007 02:30 PM
Lease Obtained / Lease Expires Problem - Windows 98 - Netgear MA401 Gary Kaucher Wireless Internet 1 04-20-2007 04:21 PM
Event ID1058 & Event ID1030 errors in the application log!!! Herm Windows Networking 2 01-07-2005 07:35 AM



1 2 3 4 5 6 7 8 9 10 11