[Gllug] Triggering an action on DHCPDISCOVER

John Hearns hearnsj at googlemail.com
Thu Feb 19 16:46:19 UTC 2009


2009/2/19 John Winters <john at sinodun.org.uk>:
>>
> Now I can think of various cludgy ways to detect the arrival of a client
> (e.g. tail -f on /var/log/syslog and search for "DHCPDISCOVER") but I'm
> sure there must be a better (read, cleaner) way.
>

I have thought about this one, for HPC cluster node discovery in the past.
How about using 'arpwatch' ?

Actually, it wouldn't be appropriate for your task, and it would only
warn about MAC addresses it sees for the first time. But it might
help.

The other way to do it is to run tcpdump on your ethernet interface,
and check for those DHCP packets.
Six and half a dozen between that and grepping in /var/log/messages


There is a Perl script from CERN which basically does the tcpdump
thing - you could base your method on that.
It may take me a bit of time to dig it out.
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list