• Sign in to Neowin Faster!

    Create an account on Neowin to contribute and support the site.

  • 0
Sign in to follow this  

Getting a MAC address from an IP

Question

CustardFD    0

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.

Share this post


Link to post
Share on other sites

19 answers to this question

Recommended Posts

  • 0
lazydesert    0

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 ;)

Share this post


Link to post
Share on other sites
  • 0
CustardFD    0

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

Share this post


Link to post
Share on other sites
  • 0
lazydesert    0

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

getthemac 169.152.0

?

Share this post


Link to post
Share on other sites
  • 0
CustardFD    0

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

Share this post


Link to post
Share on other sites
  • 0
me101    0

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.

Share this post


Link to post
Share on other sites
  • 0
lazydesert    0

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

Share this post


Link to post
Share on other sites
  • 0
Intelligen    4

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

Share this post


Link to post
Share on other sites
  • 0
lazydesert    0

well.. there you go :)

Share this post


Link to post
Share on other sites
  • 0
Intelligen    4

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

Share this post


Link to post
Share on other sites
  • 0
CustardFD    0

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

Share this post


Link to post
Share on other sites
  • 0
me101    0

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.

Share this post


Link to post
Share on other sites
  • 0
Intelligen    4

ya that

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

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

Share this post


Link to post
Share on other sites
  • 0
lazydesert    0

is getmac limited to people on the same subnet ?

i hope i have my terminology correct.

Share this post


Link to post
Share on other sites
  • 0
Intelligen    4

yes it is.....

Share this post


Link to post
Share on other sites
  • 0
lazydesert    0

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

Share this post


Link to post
Share on other sites
  • 0
Intelligen    4

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

Share this post


Link to post
Share on other sites
  • 0
lazydesert    0

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 :)

Share this post


Link to post
Share on other sites
  • 0
Vlad    12

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

Share this post


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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.