Don Gould
2006-Jul-07 13:21 UTC
Hello New MAC / DHCP Request - How to spot the presents of a new MAC address...
Hi All, How do I find out about new new DHCP connections as they appear? I want to write a script that will do some stuff based on a new ip request from a machine on my lan. ie - new user connects to the lan, DHCP server on my Linux (debian) gateway gives them an IP, my script is run automatically to change the firewall rules and start recording their presents, or if it''s an unknown user it will add their MAC to a list of unknown users. More details of the application can be seen here: http://www.tcn.bowenvale.co.nz/component/option,com_wrapper/Itemid,23/ Cheers Don -- Don Gould www.thinkdesignprint.co.nz - www.tcn.bowenvale.co.nz - www.bowenvale.co.nz - SkypeMe: ThinkDesignPrint Upcoming events: Software Freedom Day - 16 September 2006 - www.softwarefreedomday.org _______________________________________________ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
Sheldon Hearn
2006-Jul-08 18:46 UTC
Re: Hello New MAC / DHCP Request - How to spot the presents of a new MAC address...
On Friday 07 July 2006 15:21, Don Gould wrote:> ie - new user connects to the lan, DHCP server on my Linux (debian) > gateway gives them an IP, my script is run automatically to change > the firewall rules and start recording their presents, or if it''s an > unknown user it will add their MAC to a list of unknown users.I''m sure you could engineer something really impressive, but you could probably get away with a lot less effort by simply tailing whatever dhcpd logs to (possibly /var/log/messages). Ciao, Sheldon. -- Sheldon Hearn IT Director Clue Technologies (PTY) Ltd Web: http://www.clue.co.za/ Mail: sheldonh@clue.co.za Office: +27-21-913-8840 Mobile: +27-83-564-3276 Timezone: SAST (+0200) _______________________________________________ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
Don Gould
2006-Jul-31 11:49 UTC
HOWTO: Hello New MAC / DHCP Request - How to spot the presents of a new MAC address...
Sheldon Hearn wrote:> I''m sure you could engineer something really impressive, but you could > probably get away with a lot less effort by simply tailing whatever > dhcpd logs to (possibly /var/log/messages).Yes, that discussion has been had some where... Some research in to dnsmasq and a few emails to the guy who wrote it showed up the answer...> You may not need to make any source changes at all: dnsmasq will call a custom script whenever a DHCP lease is created or destroyed: see the --dhcp-script flag in the manpage for details. The MAC address and IP address and name of the host are passed to the script.-- Don Gould www.thinkdesignprint.co.nz - www.tcn.bowenvale.co.nz - www.bowenvale.co.nz - www.hearingbooks.co.nz - SkypeMe: ThinkDesignPrint