I'm using Raspbian Jessie.
I would like to have 2 ip addresses on my raspberry eth0 interface.
- One dynamic, dhcp assigned,
- One static, configured either in /etc/network/interfaces, either in /etc/dhcpcd.conf
I tried changing the file /etc/network/interfaces like this:
source-directory /etc/network/interfaces.d auto lo iface lo inet loopback auto eth0 iface eth0 inet dhcp auto eth0:0 iface eth0:0 inet static address 10.166.247.2 netmask 255.255.255.0 allow-hotplug wlan0 iface wlan0 inet manual wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf allow-hotplug wlan1 iface wlan1 inet manual wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
It works fine, but after a while, the dynamic ip address disappears. It seems the lease isn't renewed.
I've read a lot of advises to leave /etc/network/interfaces untouched and rather use /etc/dhcpcd.conf to setup a static ip address, but is it possible to ask dhcpcd to setup both a static and a dynamic ip address at the same time?
Other solutions (systemd-networkd) are welcome too! (as long as I don't need a gui)