1

I am using NetworkManager on CentOS7. Every time I restart NetworkManager ifconfig shows the MAC adress as something else for the wireless card. I am specifying the MAC in ifcfg-AP_NAME which never works because every time it changes. This is what I get from the CLI:

[root@blue network-scripts]# ifconfig -a wlp3s0                             
wlp3s0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether f6:4d:4e:2e:01:ea  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@blue network-scripts]# systemctl restart NetworkManager
[root@blue network-scripts]# ifconfig -a wlp3s0              
wlp3s0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 62:25:b9:b6:9b:0b  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@blue network-scripts]# systemctl restart NetworkManager
[root@blue network-scripts]# ifconfig -a wlp3s0              
wlp3s0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether b6:d1:1c:f7:1b:23  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@blue network-scripts]# ip a s
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether 00:01:c0:20:22:14 brd ff:ff:ff:ff:ff:ff
    inet 10.1.2.130/25 brd 10.1.2.255 scope global enp1s0
       valid_lft forever preferred_lft forever
3: enp2s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen 1000
    link/ether 00:01:c0:20:22:2c brd ff:ff:ff:ff:ff:ff
4: wlp3s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN qlen 1000
    link/ether b6:d1:1c:f7:1b:23 brd ff:ff:ff:ff:ff:ff
5: mgmt0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:50:b6:23:0c:8d brd ff:ff:ff:ff:ff:ff
    inet 172.18.1.12/24 brd 172.18.1.255 scope global mgmt0
       valid_lft forever preferred_lft forever
[root@blue network-scripts]# systemctl restart NetworkManager
[root@blue network-scripts]# ip a s
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether 00:01:c0:20:22:14 brd ff:ff:ff:ff:ff:ff
    inet 10.1.2.130/25 brd 10.1.2.255 scope global enp1s0
       valid_lft forever preferred_lft forever
3: enp2s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen 1000
    link/ether 00:01:c0:20:22:2c brd ff:ff:ff:ff:ff:ff
4: wlp3s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN qlen 1000
    link/ether 22:49:ba:1f:fb:3a brd ff:ff:ff:ff:ff:ff
5: mgmt0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:50:b6:23:0c:8d brd ff:ff:ff:ff:ff:ff
    inet 172.18.1.12/24 brd 172.18.1.255 scope global mgmt0
       valid_lft forever preferred_lft forever
[root@blue network-scripts]# 
  • as you said, it's probably NetworkManager doing it (privacy reasons to avoid wifi tracking by the MAC, following Apple's lead) – A.B Apr 20 '18 at 19:37
  • 1
    look for MAC_ADDRESS_RANDOMIZATION at /etc/NetworkManager/NetworkManager.conf – Fabian Apr 20 '18 at 19:45
  • 3
    Seems to be a duplicate of unix.stackexchange.com/questions/395059/… . I will delete the question. – Dovid Bender Apr 20 '18 at 19:49
1

As you're describing, it's probably NetworkManager doing it

There are a few settings for this, as described in the blog. The best you should do would probably be:

nmcli c modify id yourwifiid 802-11-wireless.cloned-mac-address permanent

which would restore the permanent MAC address of the card before bringing up the interface, while still not exposing the MAC while just detecting networks.

As per the blog and comment, you can also disable all address randomization during scan with this in NetworkManager.conf:

[device]
wifi.scan-rand-mac-address=no

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.