Get IP based on Mac address
I'm on a small network using DHCP - so as machines connect there's no telling what the IP address will be. The machines connecting are both PC and Mac. The server is FreeBSD (don't know the version, but it's recent).
From the server, I'd like to be able to tell who is logged in and what IP address has been assigned to them. I can get the Mac address per machine to try to figure this out. Can I parse out the results of netstat somehow? Can I assume that the MAC address will always be the same per machine? Thanks for the help! |
Welcome to LQ.
The MAC address is unique to each card. You should be able to find the IP address with: arp -n |
On the FreeBSD computer issue this command,,
cat /var/db/dhcpd.leases That file will show the IP that has been leased. To what MAC address it has been leased to, and the lease times. |
You want arping
|
keep in mind that it is possible to FAKE a mac adress, especially in Linux :P
if you are a network admin that want to give an eye on users, keep in mind troublemaker could change their mac adress ;) I did this sometime at university lol :D |
All times are GMT -5. The time now is 01:25 AM. |