O endereço MAC continua mudando

1

Estou usando o NetworkManager no CentOS7. Toda vez que eu reinicio o NetworkManager, o ifconfig mostra o endereço MAC como outra coisa para a placa wireless. Eu estou especificando o MAC em ifcfg-AP_NAME que nunca funciona porque toda vez que ele muda. Isso é o que recebo do 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]# 
    
por Dovid Bender 20.04.2018 / 21:22

1 resposta

1

Como você está descrevendo, provavelmente é NetworkManager fazendo isso

Existem algumas configurações para isso, conforme descrito no blog. O melhor que você deve fazer provavelmente seria:

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

que restauraria o endereço MAC permanente do cartão antes de abrir a interface, sem ainda expor o MAC enquanto apenas detectasse redes.

De acordo com o blog e o comentário, você também pode desativar toda a aleatoriedade de endereço durante a verificação com isso em NetworkManager. conf :

[device]
wifi.scan-rand-mac-address=no
    
por 20.04.2018 / 21:50