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?
dhcpdump. :\ – A.B. Sep 03 '15 at 06:11--line-bufferedforgrep– A.B. Sep 03 '15 at 06:38--line-bufferedswitch, however I tested it usingtail -f foo | grep '.'and runningecho bar >> fooin another terminal, so I guess that makes a difference somehow. Thanks – kos Sep 03 '15 at 12:59sudo dhcpdump -i eth0I haveIP: 192.168.20.67 (d8:d3:85:79:ad:aa) > 255.255.255.255 (ff:ff:ff:ff:ff:ff)with some leading spaces. Therefore in my case, the^IP:fails. – A.B. Sep 03 '15 at 13:26