Skip to content

Commit 186ee9d

Browse files
authored
Merge pull request #76 from Lethja/mac-address
MAC address configuration
2 parents 38f53d9 + 6f0296d commit 186ee9d

File tree

1 file changed

+46
-7
lines changed

1 file changed

+46
-7
lines changed

docs/advanced/network.md

Lines changed: 46 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,46 @@ too many to be discussed here.
148148
Instead, will cover the most likely reasons you would want to modify the way `dhcpcd` behaves on a MiSTer.
149149
For full documentation read [dhcpcd.conf (5)](https://man.archlinux.org/man/dhcpcd.conf.5){target=blank}.
150150

151+
### MAC address configuration
152+
A MAC address (medium access control address) is a network address assigned
153+
to the hardware of every network interface.
154+
It allows network switches to learn where traffic should be routed to.
155+
It can be thought of like an IP address but statically assigned to hardware and only relevant within your local network.
156+
157+
Much like IP addresses, MAC addresses have to be unique for the network to function properly,
158+
but unlike IP addresses, they cannot be dynamically assigned by a DHCP server, MAC addresses are static by design.
159+
160+
Some installers like [Mr Fusion](../setup/software.md#flash-mr-fusion-to-your-microsd)
161+
will randomize the MiSTers MAC address during setup, but others will use the same MAC address everytime.
162+
Therefore, it is common that two or more MiSTers will have the exact same MAC address on their onboard ethernet port.
163+
164+
If two MiSTers with the same MAC address are on the same network at the same time,
165+
the network switches may start sending packets to the wrong MiSTer and cause connections to fail.
166+
Fortunately, if this is the case, it's possible to override the default MAC address.
167+
168+
#### Login to Linux terminal on the MiSTer
169+
From the MiSTers startup menu, press ++F9++ to get a Linux terminal then
170+
login as root (see [Network Access](#network-access) for the default credentials).
171+
172+
#### Change MAC address
173+
Open u-boot.txt file for editing by running the command `nano /media/fat/linux/u-boot.txt`
174+
by typing it and pressing ++Enter++.
175+
The file should contain a line that looks somewhat like this:
176+
```
177+
ethaddr=EA:C8:21:56:E3:43
178+
```
179+
180+
Edit the MAC address so that no MiSTers on your network share the same address.
181+
MAC addresses are made up of six sets of two characters that range between `00`-`FF` and are seperated by `:`.
182+
When changing the MAC address, avoid these addresses that have special meaning:
183+
184+
* Any address that start's with `00`, `01`, `02`, `03`, `06` or `0A`
185+
* Broadcast (`FF:FF:FF:FF:FF:FF`)
186+
* All zeros (`00:00:00:00:00:00`)
187+
188+
Once done, press ++Ctrl+o++ to make `nano` save `u-boot.txt` then ++Ctrl+x++ to exit `nano` then
189+
run the command `reboot` to restart the MiSTer back to the startup menu with the new MAC address applied.
190+
151191
### Hostname configuration
152192
`dhcpcd` can be configured so that MiSTer offers its preferred name to your DHCP server, but it's disabled by default.
153193
Enabling it will allow you to connect to your MiSTer by a designated name
@@ -164,7 +204,7 @@ This is recommended if possible as you will be able to copy and paste the comman
164204
Before enabling this feature, you should be sure
165205
that your network router supports top-level domains (TLDs) in the local network.
166206

167-
To do this, run the command `dhcpcd -U | less` and press ++Enter++
207+
To do this, run the command `dhcpcd -U | less` by typing it and pressing ++Enter++
168208
then use the ++Down++ and ++Up++ keys to search for at least one `domain_name` entry that looks somewhat like this:
169209
```
170210
domain_name=lan
@@ -174,9 +214,9 @@ If you find more than one `domain_name` value, remember them all.
174214
If you have no `domain_name` value in the results then your network router is not offering a top level domain
175215
and there's no point in proceeding.
176216

177-
Alternatively, you can run this command:
217+
Alternatively, you can run this more complex command:
178218
```bash
179-
dhcpcd -U | 2>/dev/null | grep domain_name= | cut -c13-
219+
dhcpcd -U 2>/dev/null | grep domain_name= | cut -c13-
180220
```
181221
...which will find and filter `domain_name` values for you.
182222
The result of which would look like this instead:
@@ -185,8 +225,8 @@ lan
185225
```
186226

187227
#### Enable sending preferred name to DHCP server
188-
Open dhcpcd configuration file for editing by running the command `nano /etc/dhcpcd.conf`
189-
(or `vi /etc/dhcpcd.conf` if you know what that is and prefer it) and press ++Enter++.
228+
Open dhcpcd configuration file for editing by running the command `nano /etc/dhcpcd.conf`
229+
by typing it and pressing ++Enter++.
190230

191231
Press ++Down++ until you find this text:
192232
```
@@ -284,8 +324,7 @@ The interface names are case-sensitive.
284324
Replace these values with the network interface name you got in the previous step
285325
and the IP address you want to set it to.
286326

287-
Open dhcpcd configuration file for editing by running the command `nano /etc/dhcpcd.conf`
288-
(or `vi /etc/dhcpcd.conf` if you know what that is and prefer it).
327+
Open dhcpcd configuration file for editing by running the command `nano /etc/dhcpcd.conf`.
289328
Press ++Down++ until you're at the bottom of the file then type the following:
290329
```
291330
interface eth0

0 commit comments

Comments
 (0)