All the examples I have seen of Ethernet networking hard-code the MAC and IP address into the code.
I would like to offer a setup page so that the MAC and IP and Web Server Port, Workgroup / Domain can be retrieved from the EEPROM.
The details could then be changed via a Web Page and written back to the EEPROM, thus allowing good integration with consumer networks.
Is this viable or does the MAC and IP have to be hard-coded?
Thanks and kind regards,
MACs have to be unique to the (local) network - good candidate for EEPROM
IP address should be obtained by DHCP if possible.
If the MAC is a real MAC, it is hardcoded and never changes.
Could do that with the IP.
Also changing an ip for an internal network, from an external network is quite un-secure ( probably doesn't matter unless there is someone actively trying to give you a bad day. NAT is designed to keep the internal stuff away from the folks outside ) Is DHCP not supported?
Like IPv4, MAC's are limited so many new devices offer the consumer the ability to change the MAC to one that is not being used on their internal network.
As to obtaining a unique MAC for exploitation on the Internet I have as yet no idea, I suspect it costs a bit and is tied up in red-tape.
Reserved IP under DHCP could be a solution, but I would like to offer the ability to set IP, gateway, netmask, DNS etc, once again offering the client more scope.
Indirectly though, your responses have begun to answer my primary question as to whether the MAC and IP had to be hard-coded. I suspect not, as long as the read from EEPROM was called from setup() as a first port of call so to speak.
Thanks though for the swift responses, great forum,