How can I set a static MAC address on boot?

asked 2018-02-13 06:54:00 +0000

bob323 gravatar image

updated 2018-02-14 05:28:30 +0000

I use software that ties a license number to the network adapter's MAC address. In my case, it's my wireless network adapter's address. With each reboot, the MAC address of both my wireless adapter and my ethernet adapter are changed, probably for security reasons. The problem with this is that the software thinks I'm trying to use it on another computer and makes me reactivate the license every time I reboot. I would like to set my wireless adapter to have a single MAC address every time the computer starts, but I haven't been able to find a way to do that.

I know it's possible to set the ethernet adapter to have a static MAC address by doing the following: sudo vi /etc/sysconfig/network-scripts/ifcfg-enp0s25, add MACADDR=$foo, and exit. However, while there are ifcfg files for the ethernet and loopback network devices, there is not one for the wireless network adapter. How can I accomplish the same thing with the wireless adapter?

Update: I have added the following to /etc/NetworkManager/NetworkManager.conf:

[device]
match-device=interface-name:wlp3s0
managed=1
wifi.scan-rand-mac-address=no

[connection]
wifi.cloned-mac-address=preserve

Still no luck. I thought for sure this would fix the problem. I am referring to the official documentation found here. Any help?

edit retag flag offensive close merge delete

Comments

Try to use wifi.mac-address-randomization=1 in the [connection] section and make sure to restart NetworkManger daemon afterwards. A value of 1 means never randomize....

thomaswood ( 2018-02-17 10:46:52 +0000 )edit