0

I connect a headless RPi to a laptop.

Putting ip=169.254.0.55 at the end of cmdline.txt has this major advantage:

  • since this address is in APIPA "Automatic Private Internet Protocol Addressing" IP range, it is automatically available from a PC Windows laptop, without having to do anything here like this in the Windows IPv4 configuration. This is very useful when you often connect different devices with ethernet and you don't want to modify this manually Windows IPv4 configuration.

But if no ethernet cable is connected, I see this message during boot:

Waiting up to 110 more seconds for network...
Waiting up to 100 more seconds for network...

A common solution to the latter, as described in Pi3 - Waiting up to 110 more seconds for network is "don't use ip=... in cmdline.txt, use /etc/network/interfaces instead".

But then we lose the main advantage described above, we do have to modify the Windows IPv4 settings to make it work, or alternatively use a DHCP server (which I don't want).

Question: how to keep ip=... in cmdline.txt and avoid the 120 seconds waiting time if no ethernet cable is connected?

2 Answers 2

1

This question contains a lot of incorrect detail.

169.254.0.0/16 is a Link-local address (also occasionally called APIPA) but there is NO point in attempting to assign one as there will already be one assigned.

The link suggesting etc/network/interfaces is misleading. Raspberry Pi OS hasn't used Debian networking for 8 years, but by default uses dhcpcd.

If you REALLY want a static IP assign a normal private address in /etc/dhcpcd.conf (using a different address range than used by your network) but there is no need as you should be able to access the Pi at its self assigned address using Zero-conf with hostname.local (unless this is a very old Windows).


  1. In my opinion don't use cmdline.txt
  2. If you must have a static IP use the recommended method.

Until recently /etc/network/interfaces included the following:-

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
  1. I only use static IP if I am configuring an Access Point -
    otherwise I use hostname.local

See How to set up Static IP Address (but if directly connecting you obviously don't need static routers= or static domain_name_servers=)

  1. "in which RPi config file do we set the Zero-conf ON"
    You don't do anything. Raspberry Pi OS (and most Linux) include it.
    mypi.local should work, but I can't comment on putty as I haven't used Windows for > 10 years but modern Windows should also support Zero-conf which is an IETF standard.
2
  • Thank you for your answer. I did a minor spelling edit.
    – Basj
    Jun 16, 2023 at 17:10
  • So, in order to be sure to understand, can you add what should we set 1) in cmdline.txt (removing ip =169.254.0.55, is that right?) 2) what to write in /etc/network/interfaces? 3) what to write in dhcpd config, in which file? (you wrote dhcpcd with a different spelling, is it something else?) 4) in which RPi config file do we set the Zero-conf ON ? If mypi is the hostname, can we directly set mypi.local in putty to SSH the Pi?
    – Basj
    Jun 16, 2023 at 17:17
0

Addendum to @Milliways' answer:

  • In the case Windows hasn't it installed already, you have to install Bonjour Print Services for Windows v2.0.2.

    Then ZeroConf works and you can find the RPi with ping raspberrypi.local.

    No ip=... in cmdline.txt and no modification of /etc/network/interfaces is needed.

  • In the case it's not enabled on the RPi (for example in the case of a custom distro derived from RaspiOS, like in my case), you have to

    systemctl enable avahi-daemon

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.