What keeps changing my MAC Address on reboot ?

Kernel, Main, Utilities & Applications, Miscellaneous Devices.
gibs
Posts: 66
Joined: Sun May 09, 2021 11:04 pm
Has thanked: 8 times
Been thanked: 14 times

What keeps changing my MAC Address on reboot ?

Unread post by gibs »

Hi,

Since 1 week I have noticed that my Mister Mac Address change each reboot.

I haven't modified anything (hardware of software).

I have decided to rollback to the latest linux.img from 2022 and I don't have this issue anymore.

How to fix that issue so I can continu to update my mister ?

My USB adapter is the : Bus 001 Device 004: ID 0bda:a811 Realtek Semiconductor Corp. RTL8811AU 802.11a/b/g/n/ac WLAN Adapter

Regards
gibs

User avatar
RealLarry
Top Contributor
Posts: 883
Joined: Mon May 25, 2020 4:04 am
Location: San Junipero/DE/Earth
Has thanked: 120 times
Been thanked: 386 times

Re: What keeps changing my MAC Address on reboot ?

Unread post by RealLarry »

Can't give an answer yet, but have a look at this thread regarding MiSTer's MAC address and how to set a fixed MAC address (see (my) last post in this thread).

Contributor of tty2oled, author of tty2tft, tty2rpi and update_tty2xxx
gibs
Posts: 66
Joined: Sun May 09, 2021 11:04 pm
Has thanked: 8 times
Been thanked: 14 times

Re: What keeps changing my MAC Address on reboot ?

Unread post by gibs »

RealLarry wrote: Wed May 17, 2023 10:22 am

Can't give an answer yet, but have a look at this thread regarding MiSTer's MAC address and how to set a fixed MAC address (see (my) last post in this thread).

Thanks, I tried that before posting but did not work in my case.
I have created /media/fat/linux/u-boot.txt with the mac address in it but did not changed anything.

User avatar
RealLarry
Top Contributor
Posts: 883
Joined: Mon May 25, 2020 4:04 am
Location: San Junipero/DE/Earth
Has thanked: 120 times
Been thanked: 386 times

Re: What keeps changing my MAC Address on reboot ?

Unread post by RealLarry »

gibs wrote: Wed May 17, 2023 12:12 pm
RealLarry wrote: Wed May 17, 2023 10:22 am

Can't give an answer yet, but have a look at this thread regarding MiSTer's MAC address and how to set a fixed MAC address (see (my) last post in this thread).

Thanks, I tried that before posting but did not work in my case.
I have created /media/fat/linux/u-boot.txt with the mac address in it but did not changed anything.

It isn't??? but it has to! I'm wondering about your both issues: A changing MAC on reboot and defining a fixed MAC isn't working. "Impossible".
What about backing up your SD and creating a fresh one?

Contributor of tty2oled, author of tty2tft, tty2rpi and update_tty2xxx
Stupid Dufus
Posts: 157
Joined: Sun Aug 30, 2020 12:04 am
Has thanked: 98 times
Been thanked: 46 times

Re: What keeps changing my MAC Address on reboot ?

Unread post by Stupid Dufus »

I had the problem too after the latest linux update. I found that using the script here fixed the problem for me. I imagine I'll have to run it again after the next linux update though

viewtopic.php?f=27&p=49700#p49700

gibs
Posts: 66
Joined: Sun May 09, 2021 11:04 pm
Has thanked: 8 times
Been thanked: 14 times

Re: What keeps changing my MAC Address on reboot ?

Unread post by gibs »

RealLarry wrote: Wed May 17, 2023 1:13 pm
gibs wrote: Wed May 17, 2023 12:12 pm
RealLarry wrote: Wed May 17, 2023 10:22 am

Can't give an answer yet, but have a look at this thread regarding MiSTer's MAC address and how to set a fixed MAC address (see (my) last post in this thread).

Thanks, I tried that before posting but did not work in my case.
I have created /media/fat/linux/u-boot.txt with the mac address in it but did not changed anything.

It isn't??? but it has to! I'm wondering about your both issues: A changing MAC on reboot and defining a fixed MAC isn't working. "Impossible".
What about backing up your SD and creating a fresh one?

I confirm again, it isn't event if it has to :)

/root# cd /media/fat/linux/
/media/fat/linux# cat u-boot.txt
ethaddr=16:88:11:C3:71:7D

Then I reboot and I get this mac address : 00:E0:4C:77:20:78

16:88:11:C3:71:7D is the real mac address and the one that were reserved in my router for years. This is also the mac address that show up when I replace the linux.img with the lastest from 2022.

gibs
Posts: 66
Joined: Sun May 09, 2021 11:04 pm
Has thanked: 8 times
Been thanked: 14 times

Re: What keeps changing my MAC Address on reboot ?

Unread post by gibs »

Stupid Dufus wrote: Wed May 17, 2023 2:13 pm

I had the problem too after the latest linux update. I found that using the script here fixed the problem for me. I imagine I'll have to run it again after the next linux update though

viewtopic.php?f=27&p=49700#p49700

Thanks but from what I see, it set-up the mac address for eth0.
my issue is on wlan0.

I did the change in u-boot.txt manualy and it did not work.

User avatar
RealLarry
Top Contributor
Posts: 883
Joined: Mon May 25, 2020 4:04 am
Location: San Junipero/DE/Earth
Has thanked: 120 times
Been thanked: 386 times

Re: What keeps changing my MAC Address on reboot ?

Unread post by RealLarry »

gibs wrote: Wed May 17, 2023 5:50 pm

Thanks but from what I see, it set-up the mac address for eth0.
my issue is on wlan0.
I did the change in u-boot.txt manualy and it did not work.

Ah! I thought you meant eth0; that is what the parameter in u-boot.txt is for.
But the MAC of your WiFi adapter should be statically defined in it's firmware. I'll have a look at this strange issues tomorrow...
Meanwhile please post the name/brand and USB ID of your WiFi adapter (by starting lsusb in MiSTer's shell/ssh connection)

Contributor of tty2oled, author of tty2tft, tty2rpi and update_tty2xxx
gibs
Posts: 66
Joined: Sun May 09, 2021 11:04 pm
Has thanked: 8 times
Been thanked: 14 times

Re: What keeps changing my MAC Address on reboot ?

Unread post by gibs »

RealLarry wrote: Wed May 17, 2023 5:56 pm

Meanwhile please post the name/brand and USB ID of your WiFi adapter (by starting lsusb in MiSTer's shell/ssh connection)

This is what I did in my initial message ;)

Stupid Dufus
Posts: 157
Joined: Sun Aug 30, 2020 12:04 am
Has thanked: 98 times
Been thanked: 46 times

Re: What keeps changing my MAC Address on reboot ?

Unread post by Stupid Dufus »

gibs wrote: Wed May 17, 2023 5:50 pm
Stupid Dufus wrote: Wed May 17, 2023 2:13 pm

I had the problem too after the latest linux update. I found that using the script here fixed the problem for me. I imagine I'll have to run it again after the next linux update though

viewtopic.php?f=27&p=49700#p49700

Thanks but from what I see, it set-up the mac address for eth0.
my issue is on wlan0.

I did the change in u-boot.txt manualy and it did not work.

There is a file in the zip in the post I linked for wlan0 as well.

User avatar
RealLarry
Top Contributor
Posts: 883
Joined: Mon May 25, 2020 4:04 am
Location: San Junipero/DE/Earth
Has thanked: 120 times
Been thanked: 386 times

Re: What keeps changing my MAC Address on reboot ?

Unread post by RealLarry »

I can't find a satisfactory answer for what is happening here. Best would be to open an issue about that here
A solution meanwhile worth to try could be to edit the file /etc/udev/rules.d/70-persistent-net.rules and to edit the first "SUBSYSTEM==" line to

Code: Select all

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="16:88:11:c3:71:7d", NAME="wlan0", RUN+="/sbin/ifup -a"
Contributor of tty2oled, author of tty2tft, tty2rpi and update_tty2xxx
gibs
Posts: 66
Joined: Sun May 09, 2021 11:04 pm
Has thanked: 8 times
Been thanked: 14 times

Re: What keeps changing my MAC Address on reboot ?

Unread post by gibs »

Thanks, will try and let you know.

shark800
Core Developer
Posts: 25
Joined: Sun Jan 03, 2021 11:17 am
Has thanked: 3 times
Been thanked: 46 times

Re: What keeps changing my MAC Address on reboot ?

Unread post by shark800 »

I had same issue - each reboot different MAC and therefore DHCP server assigned different IP. After some investigation I found this shell script

Code: Select all

/media/fat/Scripts/mac_address_change.sh

and as I was not sure if I can delete it I "improved" it with single line of code - exit 0

Code: Select all

# Version 1.0 - 2019-05-13 - First commit

exit 0

========= OPTIONS ==================
MAC_ADDRESS=""

Since then it behaves well again :D

Petr

Post Reply