Multiple MiSTers on The Same Network

Kernel, Main, Utilities & Apps, Misc Devices
elJonnyRage
Posts: 5
Joined: Mon May 25, 2020 6:46 pm

Multiple MiSTers on The Same Network

Unread post by elJonnyRage »

Does anyone know how to change the MiSTer machine name to something else, like MiSTer-2 for example? The reason is I would like to pickup a second MiSTer and they would both be on the same network. I want to be able to access them both by name with the Windows Samba share.

Thanks
User avatar
NML32
Posts: 127
Joined: Sun May 24, 2020 6:57 pm

Re: Multiple MiSTers on The Same Network

Unread post by NML32 »

You can change the hostname from MiSTer.
Press F9 and log in

Login: root
Password: 1

Edit etc/hostname
open vim (Text editor)

vim /etc/hostname
press i to enter insert mode
press esc to exit insert mode
press :wq to save and quit
Locutus73
Posts: 46
Joined: Mon May 25, 2020 9:55 am

Re: Multiple MiSTers on The Same Network

Unread post by Locutus73 »

Probably you have to change the MAC address too if you use Ethernet. There’s a script for that.

Regards.

Locutus73
User avatar
NML32
Posts: 127
Joined: Sun May 24, 2020 6:57 pm

Re: Multiple MiSTers on The Same Network

Unread post by NML32 »

Locutus73 wrote: Thu Jun 11, 2020 7:14 pm Probably you have to change the MAC address too if you use Ethernet. There’s a script for that.

Regards.

Locutus73
you can also place a text file in the Linux folder on your SD card called u-boot.txt
Place the following line in the u-boot.txt (Use whatever Mac Address you like).
ethaddr=02:03:04:05:06:01

@Locutus73, does the script create a u-boot.txt file?
elJonnyRage
Posts: 5
Joined: Mon May 25, 2020 6:46 pm

Re: Multiple MiSTers on The Same Network

Unread post by elJonnyRage »

NML32 wrote: Thu Jun 11, 2020 7:24 pm
Locutus73 wrote: Thu Jun 11, 2020 7:14 pm Probably you have to change the MAC address too if you use Ethernet. There’s a script for that.

Regards.

Locutus73
you can also place a text file in the Linux folder on your SD card called u-boot.txt
Place the following line in the u-boot.txt (Use whatever Mac Address you like).
ethaddr=02:03:04:05:06:01
Thanks for the reply Locutus73, I'm not sure where the script you are referring to is located. Is it in the main MiSTer repo? Do you have a link?

NML32, thank you for your suggestion. I'm guessing a script is not necessary if I follow your steps. So if I create a txt file named 'u-boot.txt' with the new mac address (ethaddr=myNewMacAddress) and edit the hosts file as mentioned in the reply above, that should be everything I need to have two MiSTer's happily coexisting on the same network?
User avatar
NML32
Posts: 127
Joined: Sun May 24, 2020 6:57 pm

Re: Multiple MiSTers on The Same Network

Unread post by NML32 »

@elJonnyRage, that is correct, I have three MiSTers on the same network.
You will have to update the hostname anytime there is a Linux update.
Locutus73
Posts: 46
Joined: Mon May 25, 2020 9:55 am

Re: Multiple MiSTers on The Same Network

Unread post by Locutus73 »

NML32 wrote: Thu Jun 11, 2020 7:24 pm
Locutus73 wrote: Thu Jun 11, 2020 7:14 pm Probably you have to change the MAC address too if you use Ethernet. There’s a script for that.

Regards.

Locutus73
you can also place a text file in the Linux folder on your SD card called u-boot.txt
Place the following line in the u-boot.txt (Use whatever Mac Address you like).
ethaddr=02:03:04:05:06:01

@Locutus73, does the script create a u-boot.txt file?
Exactly
https://github.com/MiSTer-devel/Scripts ... _change.sh
will do that generating a random valid local/private MAC address (not using something universal corresponding to a public brand).
Pay attention: the script is quite old and will overwrite u-boot.txt... you will have to apply again USB polling options.

Regards.

Locutus73
User avatar
Sorgelig
Site Admin
Posts: 419
Joined: Thu May 21, 2020 9:49 pm

Re: Multiple MiSTers on The Same Network

Unread post by Sorgelig »

it's better to use random numbers only for last 6 digits. First 6 is better to keep static. They not only mean some brand ID but also have flags such as multicast, broadcast.
Locutus73
Posts: 46
Joined: Mon May 25, 2020 9:55 am

Re: Multiple MiSTers on The Same Network

Unread post by Locutus73 »

Sorgelig wrote: Sun Jun 14, 2020 10:58 pm it's better to use random numbers only for last 6 digits. First 6 is better to keep static. They not only mean some brand ID but also have flags such as multicast, broadcast.
The script will assure all the flags are set correctly.
Alternatively you can launch

Code: Select all

echo "$(printf "%012X" $(( 0x$(hexdump -n6 -e '/1 "%02X"' /dev/random) & 0xFEFFFFFFFFFF | 0x020000000000 )) | sed 's/.\{2\}/&:/g' | sed s/:$//g)"
and you get a valid random MAC you can manually put it in the u-boot.txt file.

Regards.

Locutus73
sofakng
Posts: 63
Joined: Fri Jun 19, 2020 12:52 am

Re: Multiple MiSTers on The Same Network

Unread post by sofakng »

I'm glad I found this thread as I just received my second MiSTer today and connected it to the network. I was surprised to see it receive the same IP as my other MiSTer but this explains it.

I'm a little confused though... it looks like the default MiSTer MAC address is: 02-03-04-05-06-07 (obviously this appears fake and to confirm, 02-03-04 isn't a registered OUI either).

Should we change the MAC even on a single-device setup to ensure the flags are set?

EDIT: Also, we can set a different host-name with u-boot.txt?
User avatar
Sorgelig
Site Admin
Posts: 419
Joined: Thu May 21, 2020 9:49 pm

Re: Multiple MiSTers on The Same Network

Unread post by Sorgelig »

de10-nano has no built-in MAC address.
sofakng
Posts: 63
Joined: Fri Jun 19, 2020 12:52 am

Re: Multiple MiSTers on The Same Network

Unread post by sofakng »

Ahhh, that explains it. Thanks!

Is it possible to set the hostname using the u-boot.txt? I know the hostname isn't nearly as important as the MAC address but it would still be nice to set it (and persist over Linux system upgrades).
Lisko
Posts: 74
Joined: Sun May 24, 2020 10:45 pm

Re: Multiple MiSTers on The Same Network

Unread post by Lisko »

Be careful changing hostname that some scripts rely on it for checking if they are running in mister environment and may stop working. Obviously the problem should be corrected on the scripts themselves as this is a really ugly way to check if running on mister.
sofakng
Posts: 63
Joined: Fri Jun 19, 2020 12:52 am

Re: Multiple MiSTers on The Same Network

Unread post by sofakng »

Ahh, OK. That's good to know - thanks!

I don't think there is a problem having two MiSTer's with the same hostname, right? As long as they both have different MAC addresses (and IP addresses of course), right?
Lisko
Posts: 74
Joined: Sun May 24, 2020 10:45 pm

Re: Multiple MiSTers on The Same Network

Unread post by Lisko »

Yes and no. While shouldn't be a problem in most use cases some problems could arise network-wise and it's not the right way to do it. Change the hostname and if some scripts refuse to work simply edit it with notepad++ or nano via ssh and remove the 3 lines that check the hostname.
ash2fpga
Posts: 79
Joined: Tue May 26, 2020 6:20 pm

Re: Multiple MiSTers on The Same Network

Unread post by ash2fpga »

If I am only using WiFi on my misters, is only changing the hostname sufficient? The ethaddr should not apply in that case?
User avatar
NML32
Posts: 127
Joined: Sun May 24, 2020 6:57 pm

Re: Multiple MiSTers on The Same Network

Unread post by NML32 »

ash2fpga wrote: Sun Sep 27, 2020 3:32 pm If I am only using WiFi on my misters, is only changing the hostname sufficient? The ethaddr should not apply in that case?
Correct
Post Reply