I am trying to use dhcpdump to recognize people logging onto my home network and give them a tailor made greeting using a credential file.
I cannot get the mac address out of the results of dhcpdump. The machine I am running the script is not the DHCP server.
dhcpdump results :
TIME: 2015-09-02 22:42:48.909
IP: 0.0.0.0 (xx:xx:xx:xx:xx:xx) > 255.255.255.255 (ff:ff:ff:ff:ff:ff)
OP: 1 (BOOTPREQUEST)
HTYPE: 1 (Ethernet)
HLEN: 6
The command I'm trying is:
dhcpdump -i eth0 | grep IP: | cut -d"(" -f2 | cut -d")" -f1
but it just won't work. Suggestions?