HarryMuscle
Senior Member
Is it possible in a script to get the IP address of a device on the network if you know its MAC address?
Thanks,
Harry
Thanks,
Harry
Parse the content of /proc/net/arp .Is it possible in a script to get the IP address of a device on the network if you know its MAC address?
Is it possible in a script to get the IP address of a device on the network if you know its MAC address?
If choosing this method, keep in mind that in the script you'll have to filter out any ARP cache entries that have the flag=0x0 (3rd entry from the left) which indicates that the entry is currently "incomplete" (i.e. it should be ignored).Parse the content of /proc/net/arp .
grep -i "AA:BB:CC:DD:EE:FF" /proc/net/arp | awk -F ' ' '{if ($3 != "0x0") {print $1,$4}}'
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!