I am using the jessie version 2017-07-05 on Rpi3. I have set the a static IP address for eth0 interface using dhcpcd.conf as shown below.
interface eth0 static ip_address=192.168.0.10/24 static routers=192.168.0.1 static domain_name_servers=192.168.0.1
After doing the changes, I have rebooted the device and ran
ifconfig But eth0 interface doesn't have any IP.
Then I connected a laptop to the ethernet port. Again ran
ifconfig but at this time, eth0 interface shows the IP. So to confirm, I removed the cable from the laptop and ran
ifconfig once again, and at this time IP address for eth0 is vanished.
So eth0 get the IP address only when a device is connected to the ethernet port. Why this happens?
Because when I used interfaces file( on older raspbian version) for setting the static IP, it's not required to connect a device at eth0 inorder to get the IP address.
I have a problem that dnsmasq is failed to start at boot due to the eth0 interface is not assigned with the static address. So I have to restart the Rpi with a device is connected to it.