Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Re: how to detect MAC address

Reply
Thread Tools

Re: how to detect MAC address

 
 
Jon A. Cruz
Guest
Posts: n/a
 
      06-27-2003
Amey Samant wrote:
> Sudsy <(E-Mail Removed)> wrote in message
> but i dont
> understand if java provides a class NetworkInterface that gives the
> name of the interface card then why did they not make provision for
> mac address ???? if u can reach the card why not exploit it to get
> full details possible....


Ummm....

How do you know that they're even on a card that has a MAC address???

You don't.


I know that when I was using a dial-up connection, my PC would get an IP
address, but definitely had no MAC address.


Since MAC address is not universal to all devices and platforms, it's
not in Java. Just like environment variable access was deprecated around
the time they first ported Java to the Macintosh.

 
Reply With Quote
 
 
 
 
David Zimmerman
Guest
Posts: n/a
 
      06-27-2003


Jon A. Cruz wrote:
> Amey Samant wrote:
>
>> Sudsy <(E-Mail Removed)> wrote in message but i dont
>> understand if java provides a class NetworkInterface that gives the
>> name of the interface card then why did they not make provision for
>> mac address ???? if u can reach the card why not exploit it to get
>> full details possible....

>
>
> Ummm....
>
> How do you know that they're even on a card that has a MAC address???
>
> You don't.
>
>
> I know that when I was using a dial-up connection, my PC would get an IP
> address, but definitely had no MAC address.
>
>
> Since MAC address is not universal to all devices and platforms, it's
> not in Java. Just like environment variable access was deprecated around
> the time they first ported Java to the Macintosh.
>


I thought that MAC addresses were part of the Ethernet standard, so if
you are networking over ethernet, you have a MAC address. Networks that
aren't ethernet are few are very far between (EG IBM tokenring).

 
Reply With Quote
 
 
 
 
David Zimmerman
Guest
Posts: n/a
 
      06-27-2003


David Zimmerman wrote:
>
>
> Jon A. Cruz wrote:
>
>> Amey Samant wrote:
>>
>>> Sudsy <(E-Mail Removed)> wrote in message but i dont
>>> understand if java provides a class NetworkInterface that gives the
>>> name of the interface card then why did they not make provision for
>>> mac address ???? if u can reach the card why not exploit it to get
>>> full details possible....

>>
>>
>>
>> Ummm....
>>
>> How do you know that they're even on a card that has a MAC address???
>>
>> You don't.
>>
>>
>> I know that when I was using a dial-up connection, my PC would get an
>> IP address, but definitely had no MAC address.
>>
>>
>> Since MAC address is not universal to all devices and platforms, it's
>> not in Java. Just like environment variable access was deprecated
>> around the time they first ported Java to the Macintosh.
>>

>
> I thought that MAC addresses were part of the Ethernet standard, so if
> you are networking over ethernet, you have a MAC address. Networks that
> aren't ethernet are few are very far between (EG IBM tokenring).
>


You said "modem"! Of course a modem doesn't have a MAC address, it
isn't ethernet.

 
Reply With Quote
 
Jon A. Cruz
Guest
Posts: n/a
 
      06-27-2003
David Zimmerman wrote:
>
>>

>
> You said "modem"! Of course a modem doesn't have a MAC address, it
> isn't ethernet.
>



Bingo!!!

Exactly.

Java deals with "networking". IIRC, it does not deal at all with
"ethernet" (or at least not 'till recently).

At the time Java was released, I was still dealing with appletalk over
PhoneNet ($30 a piece instead of $130 for ethernet, and no need for a
$200+ hub). And even some PC's with arcnet cards. Microsoft Windows
still had no networking standard (remember Trumpet Winsock?), just about
every online provider had it's own way of communicating, geeks and
researchers were about the only ones on the Internet, and it was just
being opened for commercial ues.


MAC addresses are part of ethernet, not TCP/IP. An IP address is a
32-bit or 128-bit dynamically assignable number that lives in software.
A MAC address is a 48 bit number that lives on ethernet hardware (and is
sometimes changeable, but that's a little rare).



Anyway...

There are many different ways to do networking, and especially so in
devices (remember, Java was 'originally' designed for devices,
appliances, etc.)

Given all this, it's not suprising that Java does not expose the details
of ethernet, but instead only common concepts that are more cross-platform.

 
Reply With Quote
 
Keeger
Guest
Posts: n/a
 
      06-28-2003
Just out of curiosity....have you investigated an alternate
programming language for your needs? Maybe PHP provides the MAC
addy...

Java isn't the only solution for developing software, if it doesn't
have something you need, move on and find what does.
 
Reply With Quote
 
Rene
Guest
Posts: n/a
 
      06-28-2003
"Jon A. Cruz" <(E-Mail Removed)> wrote:
> How do you know that they're even on a card that has a MAC address???
>
> You don't.
>
> I know that when I was using a dial-up connection, my PC would get an IP
> address, but definitely had no MAC address.


Right, when doing PPP dialup (Point to Point Protocol), there are no MAC
addresses. Some software emulates or displayes 00:00:00:00:00:00 or some
arbitrary value instead.

MAC addresses is a concept of ethernet. A modem or an ISDN TA don't have
nor need any.

CU

Rene

--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service New Rate! $9.95/Month 50GB
 
Reply With Quote
 
Rene
Guest
Posts: n/a
 
      06-28-2003
"Jon A. Cruz" <(E-Mail Removed)> wrote:
> still had no networking standard (remember Trumpet Winsock?), just about


Argh, the early versions were a nightmare to set up !

> MAC addresses are part of ethernet, not TCP/IP. An IP address is a
> 32-bit or 128-bit dynamically assignable number that lives in software.
> A MAC address is a 48 bit number that lives on ethernet hardware (and is
> sometimes changeable, but that's a little rare).


No its not rare, about every single one allows this. (Not in hardware, but
in software, since it is the OS that puts the data together, not the card)

If you are under linux, just enter (as root)

ifconfig eth0 hw ether 12:23:34:45:56:67 up

and your network card has that mac address.

Under windows, just venture into the "extended" tab on the option dialog of
your network card and you should find the place to enter your value as
"network address" or something like that. If it isn't there, you can always
change it directly by creating the correct registry key.

Then reboot and your NIC has a "new" MAC address.

Its really easy to do, its just that not a lot of people know about it.

> There are many different ways to do networking, and especially so in
> devices (remember, Java was 'originally' designed for devices,
> appliances, etc.)


I doubt cellphones have a MAC either...

> Given all this, it's not suprising that Java does not expose the details
> of ethernet, but instead only common concepts that are more
> cross-platform.


Its very low level anyhow.

--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service New Rate! $9.95/Month 50GB
 
Reply With Quote
 
Jon A. Cruz
Guest
Posts: n/a
 
      06-29-2003
Rene wrote:
>
> No its not rare, about every single one allows this. (Not in hardware, but
> in software, since it is the OS that puts the data together, not the card)
>
> If you are under linux, just enter (as root)
>
> ifconfig eth0 hw ether 12:23:34:45:56:67 up
>
> and your network card has that mac address.
>


Ahhh.. but then that's something different. That's "lying about your
hardware's assigned identifier".


But I was meaning more that it happens rarely.

 
Reply With Quote
 
Sudsy
Guest
Posts: n/a
 
      06-30-2003
Rene wrote:
> "Jon A. Cruz" <(E-Mail Removed)> wrote:
>
>>Rene wrote:
>>
>>>and your network card has that mac address.
>>>

>>
>>Ahhh.. but then that's something different. That's "lying about your
>>hardware's assigned identifier".
>>
>>But I was meaning more that it happens rarely.

>
>
> Well lying is a bit strong Its just overriding the default one.
>
> Yeah it is done rarely, but that's because it is needed seldom and because
> few people know it is that easy to do (or even possible)
>
> CU
>
> Rene
>


Why is it lying at all? Are you trying to "force" people to use
their originally-assigned MAC address on their interface card?
It's kind of like suggesting that people are "stealing" satellite
signals beamed directly at them.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Differnce between setting mac address port security under theinterface vs. the mac address-table global command ttripp Cisco 5 02-05-2010 10:49 PM
Detect MAC address on (remote) NIC ? Dutch Treat Computer Support 0 03-06-2004 08:34 PM
Re: how to detect MAC address Roedy Green Java 16 07-05-2003 04:32 PM
Re: how to detect MAC address Roedy Green Java 0 07-01-2003 05:29 PM
Re: how to detect MAC address Rene Java 0 06-28-2003 07:31 PM



Advertisments