0

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.

  • 1
    there's no point in an ethernet port having an IP address with nothing connected - so, there is no problem – Jaromanda X Mar 7 at 22:10
  • But what is the difference when we use interfaces file? It assign IP even if there is no device connected. – mcv Mar 8 at 3:34
  • Haven't heard about this problem if using Raspbian Stretch. You may consider to upgrade. – Ingo Mar 8 at 9:42
  • That's not possible. Since we are using jessie in lot of devices. – mcv Mar 8 at 9:55
  • Here is asked exactly the same question: Use of bind-interfaces in dnsmasq?. Do you also use the option bind-interfaces in /etc/dhcpcd.conf? – Ingo Mar 8 at 9:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.