I try to achieve a network configuration on my device, that it will always get an ip-address from dhcp if available on plug in of rj45. Most of the time the device will boot up without connection. In /etc/network/interfaces
i put following:
allow-hotplug eth0
iface eth0 inet dhcp
I want to add a rule or behaviour, that when i connect this device to a network with no dhcp
(device <---> [USB LAN] pc)
that my device get a static ip address.
I tried to add Multiple IP addresses on one Interface to the interfaces
right under the allow-hotplug
entry:
auto eth0:1
iface eth0:1 inet static
address 10.0.0.2
netmask 255.255.255.0
All i get is 10.0.0.2
as ip on my device. I've heard about lease
in /etc/dhcp/dhcpd.conf
but i never used it before.
Could you please help me to get my head around this network configuration.