so i change my MAC address with macchanger -A wlp68s0b1 at boot with crontab,
here is what happens when i disconnect and reconnect :
while connecting after boot :
<a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="9fedfef7f2fef1dffbfafdf6fef1">[email protected]</a>:~$ macchanger -s wlp68s0b1 Current MAC: 00:22:31:c6:38:45 (SMT&C Co., Ltd.) Permanent MAC: 00:00:00:00:00:00 (FAKE CORPORATION)
after disconnecting :
<a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="95e7f4fdf8f4fbd5f1f0f7fcf4fb">[email protected]</a>:~$ macchanger -s wlp68s0b1 Current MAC: 16:7b:e7:3c:d3:cd (unknown) Permanent MAC: 00:00:00:00:00:00 (FAKE CORPORATION)
after reconnecting :
<a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b4c6d5dcd9d5daf4d0d1d6ddd5da">[email protected]</a>:~$ macchanger -s wlp68s0b1 Current MAC: 00:00:00:00:00:00 (FAKE CORPORATION) Permanent MAC: 00:00:00:00:00:00 (FAKE CORPORATION)
and so on, and with every disconnect i get a different random MAC address which fades on reconnecting giving me my real MAC address , what causes that and how to stop it ?
some outputs :
<a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="84f6e5ece9e5eac4e0e1e6ede5ea">[email protected]</a>:~$ lspci -nn |grep 14e4
44:00.0 Network controller [0280]: Broadcom Limited BCM4313 802.11bgn Wireless Network Adapter [14e4:4727] (rev 01)
<a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1466757c79757a547071767d757a">[email protected]</a>:~$ uname -a
Linux debian 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u5 (2017-09-19) x86_64 GNU/Linux
<a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="087a6960656966486c6d6a616966">[email protected]</a>:~$ sudo ifconfig
enp0s25: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether 00:24:c0:7b:a8:8b 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
device interrupt 20 memory 0xd4800000-d4820000
enp0s25:avahi: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 169.254.9.109 netmask 255.255.0.0 broadcast 169.254.255.255
ether 00:24:c0:7b:a8:8b txqueuelen 1000 (Ethernet)
device interrupt 20 memory 0xd4800000-d4820000
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1 (Local Loopback)
RX packets 9436 bytes 6584515 (6.2 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 9436 bytes 6584515 (6.2 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlp68s0b1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.5 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::6711:9875:eb78:24fc prefixlen 64 scopeid 0x20<link>
inet6 fd9c:c172:b03b:ce00:f1e0:695e:7da0:91a prefixlen 64 scopeid 0x0<global>
ether 00:00:00:00:00:00 txqueuelen 1000 (Ethernet)
RX packets 484346 bytes 641850809 (612.1 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 368394 bytes 44259668 (42.2 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
<a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="abd9cac3c6cac5ebcfcec9c2cac5">[email protected]</a>:~$ sudo iwconfig
lo no wireless extensions.
enp0s25 no wireless extensions.
wlp68s0b1 IEEE 802.11 ESSID:"3bdo"
Mode:Managed Frequency:2.447 GHz Access Point: 9C:C1:72:B0:3B:D4
Bit Rate=65 Mb/s Tx-Power=30 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality=54/70 Signal level=-56 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:4 Invalid misc:183 Missed beacon:0
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
Network-Manager will reset your mac address during the wifi scanning.
To permanently change your mac address:
Edit your /etc/NetworkManager/NetworkManager.conf as follows:
[main] plugins=ifupdown,keyfile [ifupdown] managed=false [device] wifi.scan-rand-mac-address=no [keyfile]
Edit your /etc/network/interfaces by adding the following line:
pre-up ifconfig wlp68s0b1 hw ether xx:xx:xx:yy:yy:yy
The xx:xx:xx:yy:yy:yy is the new mac address obtained from the output of macchanger -A wlp68s0b1.
Reboot and verify your settings.
Arch-linux wiki : Configuring MAC Address Randomization
Randomization during Wi-Fi scanning is enabled by default, but it may be disabled by adding the following lines to
/etc/NetworkManager/NetworkManager.confor a dedicated configuration file under/etc/NetworkManager/conf.d.
[device] wifi.scan-rand-mac-address=no
Setting it to yes results in a randomly generated MAC address being used when probing for wireless networks.
Method 2
If other methods cannot solve the problem, you can try to edit /etc/NetworkManager/conf.d/30-randomize-mac-address.conf
[connection-mac-randomization] ethernet.cloned-mac-address=permanent wifi.cloned-mac-address=permanent
and keep wifi.scan-rand-mac-address=no.
The options are:
- permanent: use the hardware MAC
- preserve: don’t change the MAC address of the device upon activation.
- random: generate a randomized value upon each connect.
- stable: generate a stable, hashed MAC address.
Method 3
macchanger when first installed gives you the option of automatically changing MAC address with every new connection. since I don’t see the option on the –help page I would suggest uninstall and reinstall. The Yes/No option will crop up asking if you want it to randomize etc etc. Just select ‘No’, you should have smooth sailing from there.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0