Getting a MAC address from an IP


Recommended Posts

I know its possible becuase when IPs conflict upon Windows startup it tells you the MAC its conflicting with.

What I would like it to be able to tell it using a command on the fly though. I don't have a need at present, apart from the feeling that I ought to know.

Thanks,

Dan.

Link to comment
Share on other sites

i've never had it give me the mac address...

are we using a server os here or something ?

and.

what exactly do you want to do.

put in an ip and get the mac ? where are you putting this in?

/me is confused ;)

Link to comment
Share on other sites

Yup. I want to put in the IP and get a MAC out.

Were talking about any normal OS here. I've had the messages from 95 + 98SE, although thinking about it I've never tried it with NT/2k/XP. I don't normally put in conficting IP addresses deliberately :p

Link to comment
Share on other sites

Gees guys this is easy!!!

You could always do the following... (this works in win95 upwards although the ip method does not work in win95)

nbtstat -a computername-or-ip

This returns a list, and the last line has the MAC address of the computer you inquired about, handy!

There is also a "free" windows 2000 utility, GETMAC (from the Microsoft Windows 2000 Resourse kit) which I have used, which can tell you the mac address of a computer elsewhere on your network. Unfortunatly, it only works in WindowsNT/2k/XP.

getmac computername or getmac 192.168.1.2

I personally use nbtstat, as it's included in windows... Free as in Beer...

Hope this helps.

There are a few other utils that I have used to catalog networks and gather stats like the ip and mac address and the likes, one is pcstat32 , documentation for pcstat32, which produces a nice XML/CVS output of the contents of the PC which this program is run on. which I have used in logon scripts to collect info on remote PC's and then pipe this info to a file or where ever I wish.

Link to comment
Share on other sites

well the getmac idea is nice but the correct format is

getmac /s

anyhow i tried it and it wouldn't even let me get it, just said user denied. So yeah, just use the arp way i described, much easier and works for all os's

Link to comment
Share on other sites

yea, the arp command works great too... nearly forgot about that one...

You could always do the following...

nbtstat -a 192.168.1.2 | find /i "mac address"

This produces the mac address on one neat line, unlike the arp command which splits it up into multiple lines.

Either way, it's good to see everyone being so helpful.

Link to comment
Share on other sites

yeah,

college, each building has a subnet.

the mac address have to be submitted to dhcp for them to get an ip, so if i could just use the command line myself to get the mac, then they wouldnt have to go through the steps.. and then they get all confused and whatnot :)

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.