2

How can I clone the mac address on my linux system using the nmcli command such that it's cloned for all wifi connections?

I'm having issues with Network Manager overriding the mac address that I set with macchanger. I found documentation online with how to define a mac address using nmcli on a per-connection (ie: specific SSID connection), but the documentation is strikingly absent for how to set the mac address globally for all connections.

Please tell me how I define the mac address for a given wifi interface using nmcli globally, such that all subsequent wifi connections use the given mac address.

1 Answer 1

4

Defaults can be specified in /etc/NetworkManager/NetworkManager.conf, see NetworkManager.conf(5).

[connection]
ethernet.cloned-mac-address=<addr>
wifi.cloned-mac-address=<addr>

Note that some defaults only apply to newly created connection profiles. For existing profiles, you'll have to set the address manually (via nmcli or by editing the "connection" files under /etc).

this doesn't answer the question of how to set the global default with the nmcli command

You cannot set the global default with nmcli.

As documented in the manual page, if you want to automatically manage this configuration, you can have it as a separate file /etc/NetworkManager/conf.d/<name>.conf. As it is dedicated to your bash script, you can simply overwrite it instead of carefully editing.

1
  • thank you, but this doesn't answer the question of how to set the global default with the nmcli command. Using the command is much more robust pragmatically. Dealing with files is a far more complex approach for a BASH script than executing an nmcli command. Is it possible to do this with nmcli without modifying config files? Commented Jun 3, 2019 at 4:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .