I have configured a static IP on my PI 3 adding this in dhcpcd.conf :

static ip_address=
static routers=
static domain_name_servers=

It works well when it is plugged in my home router. But if I unplug the Ethernet cable, then there is no IP assigned anymore when I check with ifconfig. Is it normal? Can I have a static IP assigned even when there is no cable plugged?

I have also set the embeded wifi interface as a WIFI hotspot following this tutorial:

Maybe it could explain this behavior.

  • 3
    What good is an IP static or otherwise if it isn't connected? Feb 8, 2018 at 18:25
  • @SteveRobillard It might prevent isc-dhcp-server from failing to start successfully. Then when you do plug the cable in, dhcpd is already running and can assign the other device an IP.
    – NReilingh
    Jun 1, 2020 at 17:20

3 Answers 3


The IP address is associated with the Ethernet port. So if there is nothing connected it doesn't need an address. Once You plug the cable back in, the same address will be used again. If you want the Wifi to have a static IP address (which I assume it does if it is set up as an access point) Then that is configured separately. Each interface has its own address.

  • you could bridge ethernet and wifi so, they can have the same address (technically, the bridge has the ip address, of course) Feb 9, 2018 at 1:18

Disable or uninstall dhcpcd and define your static ip in /etc/network/interfaces. These settings will be overridden if dhcpcd starts.

  • This is poor advice. It is also WRONG! Settings will NOT "be overridden if dhcpcd starts" - although they may be ignored resulting in duplicates.
    – Milliways
    Feb 10, 2018 at 0:01
  • I saw it with my own eyes, @Milliways. Feb 10, 2018 at 2:00

I have the same situation you have. Sometimes eth0 cable is unplugged, but I managed to set static ip address. You need to edit /etc/network/interfaces file as follows:

auto eth0

iface eth0 inet static






Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.