Page 1 of 1

Multiple MiSTers on The Same Network

Posted: Thu Jun 11, 2020 4:42 pm
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

Re: Multiple MiSTers on The Same Network

Posted: Thu Jun 11, 2020 5:35 pm
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

Re: Multiple MiSTers on The Same Network

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

Regards.

Locutus73

Re: Multiple MiSTers on The Same Network

Posted: Thu Jun 11, 2020 7:24 pm
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?

Re: Multiple MiSTers on The Same Network

Posted: Thu Jun 11, 2020 7:34 pm
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?

Re: Multiple MiSTers on The Same Network

Posted: Thu Jun 11, 2020 8:52 pm
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.

Re: Multiple MiSTers on The Same Network

Posted: Fri Jun 12, 2020 6:50 am
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

Re: Multiple MiSTers on The Same Network

Posted: Sun Jun 14, 2020 10:58 pm
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.

Re: Multiple MiSTers on The Same Network

Posted: Mon Jun 15, 2020 6:48 am
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

Re: Multiple MiSTers on The Same Network

Posted: Wed Jul 15, 2020 7:00 pm
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?

Re: Multiple MiSTers on The Same Network

Posted: Sat Jul 18, 2020 10:17 pm
by Sorgelig
de10-nano has no built-in MAC address.

Re: Multiple MiSTers on The Same Network

Posted: Sun Jul 19, 2020 12:02 am
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).

Re: Multiple MiSTers on The Same Network

Posted: Sun Jul 26, 2020 9:15 pm
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.

Re: Multiple MiSTers on The Same Network

Posted: Sun Jul 26, 2020 10:30 pm
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?

Re: Multiple MiSTers on The Same Network

Posted: Mon Jul 27, 2020 3:32 pm
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.

Re: Multiple MiSTers on The Same Network

Posted: Sun Sep 27, 2020 3:32 pm
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?

Re: Multiple MiSTers on The Same Network

Posted: Sun Sep 27, 2020 4:08 pm
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

Re: Multiple MiSTers on The Same Network

Posted: Wed Dec 16, 2020 5:49 am
by gordonfish
A router, and rest of the network, will see MAC addresses over WiFi just as they would via wired connectivity. Wired or wifi, you don't want duplicate MAC addresses, as that upsets switches and arp tables.

Re: Multiple MiSTers on The Same Network

Posted: Fri Dec 18, 2020 7:17 am
by lroby74
I have 2 Misters and use them from Windows using their IP addresses (reserved into router so they can't change) :
192.168.1.3 and 192.168.1.4 :)

Re: Multiple MiSTers on The Same Network

Posted: Sat Mar 20, 2021 7:22 pm
by Mellified
Worth noting that if you change /etc/hostname you should update the 127.0.0.1 entry in /etc/hosts. Without this ftpd won't work at a minimum.

Re: Multiple MiSTers on The Same Network

Posted: Wed Dec 20, 2023 9:56 pm
by Missus
gordonfish wrote: Wed Dec 16, 2020 5:49 am

A router, and rest of the network, will see MAC addresses over WiFi just as they would via wired connectivity. Wired or wifi, you don't want duplicate MAC addresses, as that upsets switches and arp tables.

While true, an off the shelf wifi adapter will have its own unique MAC burned, so you wouldn't need to set the MAC in this case.


Re: Multiple MiSTers on The Same Network

Posted: Thu Jan 11, 2024 10:19 pm
by gordonfish
Missus wrote: Wed Dec 20, 2023 9:56 pm
gordonfish wrote: Wed Dec 16, 2020 5:49 am

A router, and rest of the network, will see MAC addresses over WiFi just as they would via wired connectivity. Wired or wifi, you don't want duplicate MAC addresses, as that upsets switches and arp tables.

While true, an off the shelf wifi adapter will have its own unique MAC burned, so you wouldn't need to set the MAC in this case.

True, since that would be a separate network interface. You could also use a USB wired network adapter too for the same effect.