• 0

Getting a MAC address from an IP


Question

CustardFD

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 post
Share on other sites

19 answers to this question

Recommended Posts

  • 0
lazydesert

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 post
Share on other sites
  • 0
CustardFD

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 post
Share on other sites
  • 0
lazydesert

you want a command line... command. for example, (this doesnt work btw)

getthemac 169.152.0

?

Link to post
Share on other sites
  • 0
CustardFD

yup, something along the lines of

C:>getthemac 192.168.110.1

host 192.168.110.1 [svr]

MAC address = AA:AA:AA:AA:AA:AA

Link to post
Share on other sites
  • 0
me101

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 post
Share on other sites
  • 0
lazydesert

i'll try to find something.. i cant think of anything off the top of my head..

Link to post
Share on other sites
  • 0
Intelligen

what you want is an arp request. ip > mac

if you want an ip from a mac, you want an rarp request

type c:arp /? for more information

Link to post
Share on other sites
  • 0
Intelligen

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 post
Share on other sites
  • 0
CustardFD

Thanks guys. I'm now a happer person because of this :ponder:

Link to post
Share on other sites
  • 0
me101

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 post
Share on other sites
  • 0
Intelligen

ya that

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

is a nice way... tried it and works like a beauty

Link to post
Share on other sites
  • 0
lazydesert

is getmac limited to people on the same subnet ?

i hope i have my terminology correct.

Link to post
Share on other sites
  • 0
Intelligen

yes it is.....

Link to post
Share on other sites
  • 0
lazydesert

damn, so that doesnt help too much on our network..

Link to post
Share on other sites
  • 0
Intelligen

What do you mean? Are you in a college network or big business with multiple subnets?

Link to post
Share on other sites
  • 0
lazydesert

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 post
Share on other sites
  • 0
Vlad

and the point of getting the mac address is...?

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.