Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get a stable MAC address for PC?

Tags:

licensing

nic

We are using MAC addresses to identify PCs as licensed to run software. (Don't care about MAC spoofing; licenses are hard to get :) PCs may have multiple Ethernet controllers (we also don't worry about the case where there isn't one; we haven't met such a machine in 5 years), and so there's a problem with reliably choosing a stable one.

I thought we had this nailed but apparantly not. We use GetAdaptersInfo from the Microsoft SDK iphlpapi module, and walk down the list. We use the last adapter in the as presumably it is the motherboard Ethernet controller. Alas, we've run into a Thinkpad that appears to change which controller is last depending on whether it is docked or not.

Is there a way to reliably find the MAC address for the motherboard Ethernet controller on a system, if it exists? And for those motherboards that have 2 or more, choose one of them that is stable? [If I knew that a set were motherboard-based, I can easily pick the lowest address MAC].

like image 593
Ira Baxter Avatar asked Aug 29 '09 11:08

Ira Baxter


People also ask

How do I make my MAC address static?

Add Static MAC Address. Navigate to Switch -> Port Security -> Port Security -> Port Security Interface Config. You can manually enter single MAC addresses one port at a time, or convert all "learned" addresses to static.

How do I set a static MAC address in Windows 10?

Select the Advanced tab. Within the Property box, scroll down, select Locally Administered Address, and select the Value radio box; there, you will see your adapters MAC address. Click in the Value box, clear its contents, and enter a new address to edit the address.

How do I get a new MAC address on my PC?

In the selected network connection's Properties window, press the Configure button. In the Properties window of the network adapter, go to the Advanced tab. Locate and select Network Address in the Property list and type the new MAC address Value you want on the right side. Once you're done, press the OK button.


2 Answers

It's a muddy issue. How do you deal with virtualization? On my machine I have several Ethernet adapters, only one of which is actually hardware-based. And my virtual machines all have software-generated MAC addresses. And, if I really want to, I can set up multiple VMs on different computers with the same MAC address (not on the same network, of course).

like image 117
Vinay Sajip Avatar answered Oct 13 '22 08:10

Vinay Sajip


No - there is no reliable way to do this. USB dongles are cheap and easy - use them.

I have had the "pleasure" of using MAC locked software before and all I can say is don't do it.

like image 26
teambob Avatar answered Oct 13 '22 08:10

teambob