plipbox
plipbox copied to clipboard
Where to change the MAC address ?
Hello - I was looking through your sources, but did not find the line where the static MAC address is defined. Could you please point me to the correct line of code? I would be very thankful for a quick response. Thanks a lot!
Actually, you can already change the MAC address via the SANA-II interface with S2_CONFIGINTERFACE from your TCP/IP stack.
Amiga side: device.c:228 server.c:501
AVR Side: param.c:46 bridge.c:82
Could you please explain the procedure a little more detailed? Do I have to use S2_CONFIGINTERFACE as command in the Amiga Shell/CLI in order to change the MAC address? Is the newly configured MAC address afterwards persistently stored on the Arduino?
I would also be interested in this topic, because I have two Plipoxes and the DHCP fails to assign an IP address to both of them. I guess I need so change the MAC address somehow. Any ideas?
I guess that S2_CONFIGINTERFACE is part of a C API. MiamiDX and Roadshow do implement it, compare to the Amiga installation guide here. Unfortunately I didn't found a possibility to change the MAC address by using AmiTCP or Genesis, is that correct?
Correct, the S2_CONFIGINTERFACE is the SANA II C API for a network driver to accept a MAC address. AmiTCP indeed does not seem to support it. At least a quick scan through the 3.0b2 source code does lead to this assumption.
However, you can alter the mac address via a serial terminal directly at your plipbox device.
With the m 00:11:22:33:44:55
command you set the new address and with ps
you store it in EEPROM.
See the manual for details.
Thanks for your answer. In your intro.md you write the following:
It has to have the same value as it is used in the plipbox.device driver. The address will be automatically transferred by the driver to the firmware on startup. By default both use the mac address 1a:11:a1:a0:47:11.
Isn't the MAC address overwritten again by the plipbox.device
on startup if the MAC address is changed on the Arduino only?
I can confirm AmiTCP 3 changes the mac address back to the default despite changing the mac address on the plipbox and saving to NV ram, and confirming the change was saved by unplugging and reconnecting to plipbox. This makes the m command basically useless on an Amiga.
I found a TCPIP Stack agnostic solution. Use a HEX editor on plipbox.device. I used FileX-68K available on aminet - did a hex search (i.e. unclicked the "string search" button), searched for 1A11AFA04711 and replaced it with 1A11AFA04712 and now my A1200 has a MAC address of 1a:11:Af:A0:47:12 and my A1000 has the default, and both plipboxes exist happily on the same network.
Thanks for sharing! Works very fine after rebooting the Amiga.
No need to hex edit the driver.
All TCP/IP stacks on the Amiga has the functionality to specify/override the default MAC address stored on the card.
For example in Roadshow you use the hardwareaddress
parameter in the NetInterfaces/Plipbox file and in AmiTCP you use the ADDRESS
parameter for the plipbox line in AmiTCP:db/interfaces file.
The Roadshow part is already detailed in the documentation: https://github.com/cnvogelg/plipbox/blob/master/doc/src/amiga.md#25-roadshow
All TCP/IP stacks on the Amiga has the functionality to specify/override the default MAC address stored on the card.
Scratch AmiTCP3.0b2 from that statement 😓. The ADDRESS
parameter feature to set the MAC address was added in AmiTCP4.0.
My guess is that the Sana-II specs provide the interface to change the MAC adress, but the question is if the plipbox.device driver implements this interface 🤔 Not sure about this, maybe Christian can answer.
It works fine when I test it with Roadshow at least. The MAC address change is visible in the serial terminal if you are in verbose mode:
000014.4846 pio: init: enc28j60: ok! mac=1A:11:AF:A0:47:33 flags=04 rev=07
The funny thing is that this new MAC address is saved in the plipbox - if I cut the power and restart it, it will print the new address at the welcome message:
Welcome to plipbox 0.6 20190105
by lallafa (http://www.lallafa.de/blog)
m: mac address 1A:11:AF:A0:47:33
fd: full duplex 00
fc: flow control 00
tl: packet len 05EA
tt: packet type FFFD
ti: ip address 192.168.002.222
tp: udp port 1A90
tm: test mode 00
Press <return> to enter command mode or <?> for key help
free stack:010E
However, if plipbox.device is used without the hardwareaddress override, it will revert back to the default :11 address, so its like plipbox.device does not care which address is saved in the plipbox, which it reasonably should - it would have been a highly useful feature to be able keep the MAC-address in the plipbox, like it is on a normal network card.
The MAC address can also be saved in the plipbox via the command mode as mentioned above:
- enter
- m xx:yy:zz:gg:hh:ii
- ps
However, as plipbox.device does not care about what is saved, it is not useful.