Public bug reported:

network-manager 1.2.6-0ubuntu0.16.04.2

I'm using a script in /etc/NetworkManager/dispatcher.d/pre-up.d to
assign a pseudorandom mac address using the cloned-mac-address setting
(via this command):

> nmcli connection modify <connection uuid> wifi.cloned-mac-address
<mac>

(Specifically, I'm using this script:
https://gist.github.com/paulfurley/46e0547ce5c5ea7eabeaef50dbacef3f)


This works a treat for existing connections - ifconfig shows that the MAC 
address has been assigned correctly (as denoted by the leading 02):

```
$ ifconfig wlp6s0
wlp6s0    Link encap:Ethernet  HWaddr 02:2a:8b:4e:ca:ef
```

However if I delete that connection from Network Manager and add it
again, the interface comes, leaking its real hardware mac address:

```
$ ifconfig wlp6s0
wlp6s0    Link encap:Ethernet  HWaddr b0:35:9f:XX:XX:XX
```

Theory 1: Maybe pre-up.d hooks don't run for new connections? Nope - I
can see from the logs that the script definitely runs when I connect to
the wifi for the first time.

Theory 2: Maybe the Network Manager connection doesn't exist yet, so the
script can't see it via its initial `nmcli connection show` command?
Nope - at the top of the log is the command `nmcli connection modify
<uuid of the new connection> wifi.cloned-mac-address 02:34:ae:08:7d:5f`

So, in summary, setting wifi.cloned-mac-address from a pre-up.d hook
works great for *existing* connections but appears to fail silently for
*new* connections.

Thanks!

** Affects: network-manager (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1747085

Title:
  NetworkManager: setting wifi.cloned-mac-address from pre-up.d fails
  silently for new connections

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1747085/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to