Multiple MiSTers on The Same Network

Kernel, Main, Utilities & Applications, Miscellaneous Devices.
elJonnyRage
Posts: 10
Joined: Mon May 25, 2020 6:46 pm
Has thanked: 1 time

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: 298
Joined: Sun May 24, 2020 6:57 pm
Has thanked: 301 times
Been thanked: 51 times

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
Core Developer
Posts: 51
Joined: Mon May 25, 2020 9:55 am
Has thanked: 1 time
Been thanked: 8 times

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: 298
Joined: Sun May 24, 2020 6:57 pm
Has thanked: 301 times
Been thanked: 51 times

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: 10
Joined: Mon May 25, 2020 6:46 pm
Has thanked: 1 time

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: 298
Joined: Sun May 24, 2020 6:57 pm
Has thanked: 301 times
Been thanked: 51 times

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
Core Developer
Posts: 51
Joined: Mon May 25, 2020 9:55 am
Has thanked: 1 time
Been thanked: 8 times

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: 890
Joined: Thu May 21, 2020 9:49 pm
Has thanked: 2 times
Been thanked: 214 times

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
Core Developer
Posts: 51
Joined: Mon May 25, 2020 9:55 am
Has thanked: 1 time
Been thanked: 8 times

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: 138
Joined: Fri Jun 19, 2020 12:52 am
Been thanked: 23 times

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: 890
Joined: Thu May 21, 2020 9:49 pm
Has thanked: 2 times
Been thanked: 214 times

Re: Multiple MiSTers on The Same Network

Unread post by Sorgelig »

de10-nano has no built-in MAC address.
sofakng
Posts: 138
Joined: Fri Jun 19, 2020 12:52 am
Been thanked: 23 times

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: 88
Joined: Sun May 24, 2020 10:45 pm
Has thanked: 18 times
Been thanked: 3 times

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: 138
Joined: Fri Jun 19, 2020 12:52 am
Been thanked: 23 times

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: 88
Joined: Sun May 24, 2020 10:45 pm
Has thanked: 18 times
Been thanked: 3 times

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: 237
Joined: Tue May 26, 2020 6:20 pm
Has thanked: 62 times
Been thanked: 28 times

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: 298
Joined: Sun May 24, 2020 6:57 pm
Has thanked: 301 times
Been thanked: 51 times

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
gordonfish
Posts: 9
Joined: Thu Nov 19, 2020 1:04 am
Has thanked: 21 times
Been thanked: 2 times

Re: Multiple MiSTers on The Same Network

Unread post 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.
lroby74
Posts: 118
Joined: Tue May 26, 2020 2:59 pm
Has thanked: 137 times
Been thanked: 16 times

Re: Multiple MiSTers on The Same Network

Unread post 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 :)
User avatar
Mellified
Posts: 145
Joined: Sat Aug 22, 2020 8:38 pm
Been thanked: 51 times

Re: Multiple MiSTers on The Same Network

Unread post 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.
Missus
Posts: 183
Joined: Fri Jan 27, 2023 12:45 am
Has thanked: 48 times
Been thanked: 43 times

Re: Multiple MiSTers on The Same Network

Unread post 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.

gordonfish
Posts: 9
Joined: Thu Nov 19, 2020 1:04 am
Has thanked: 21 times
Been thanked: 2 times

Re: Multiple MiSTers on The Same Network

Unread post 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.

Post Reply