How to get the local mac address?

Jorge Godoy godoy at ieee.org
Thu Dec 15 06:36:05 EST 2005


Steve Holden <steve at holdenweb.com> writes:

> bonono at gmail.com wrote:
> > Steve Holden wrote:
> >
> >>Why should you want to associate a MAC address with a socket? Each
> >>interface has an IP address, and it's that you should be using.
> > Say for example I want to find out the MAC if a particular interface in
> > python.
> >
> When you are asked "why would you want to do something" it isn't normally
> considered sufficient to reply "suppose I want to do something". I'm still
> trying to find out what use case (apart from curiosity) drives this need to
> know.

One thing that I've seen more than once is restricting the use of the software
to one machine.  There you can use the MAC address as an item of assurance
that you're on the authorized machine.

Of course, MAC addresses can be cloned, changed, etc.  But this is one use
case for knowing the MAC address and not using it with networking.

-- 
Jorge Godoy      <godoy at ieee.org>



More information about the Python-list mailing list