I need to set the IP address of a ubuntu device() to be read from an EEPROM. The user has he option to change the IP address as well.
I know the commands to read and write to the EEPROM. But how do I edit the /etc/network/interfaces
file so that it automatically fetches the IP address from the EEPROM on network start/restart?
Btw..I am aware of the methods to configure static IP address the normal way. But in that method, I could only hardcode the IP address in the interfaces file. Is there any way I can make this a variable, which I can populate from EEPROM and use in the interfaces file?
Also, I know that I can do the whole thing using a shell script by calling the EEPROM command and ifconfig. But I would like to do this using the standard init scripts. Also I need DHCP configuration to happen in the standard way.
I got the answer from superuser site. The debian manual says that it is possible to configure an interface without an IP address like this:
I am not sure how I can give credit to the person who gave me the solution. So I will just accept my answer itself.