1

On Windows computers, when there is no DHCP server found on the network interface, it gets assigned some IP address like:

169.254.x.x

So it is supposed you can find it on the network using tools like:

# netdiscover -i eth0 -r 169.254.0.0/16

For network embedded devices, like routers or access points, I usually find them :

# netdiscover -i eth0 -r 192.168.0.0/16

But I don't know what range of IPs should be used for Linux computers.
It seems there is none, for example:

$ ifconfig
eth3      Link encap:Ethernet  HWaddr 00:01:c0:15:64:b3
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

What range, if any, gets assigned on Linux to a network interface card when DHCP was not performed?

What could I use this for:

  • Remotely connecting to devices or computers without knowing its IP. For example, on embedded modern devices capable to run full Linux distros, like RaspBerry, for those cases when you are not in the nearby of a DHCP server.
  • you might want to look at zeroconf – Jasen Aug 9 '15 at 6:14
  • 2
    169.254.x.x is a zeroconf IP. If zeroconf is enabled, you'll get a zeroconf IP in Linux as well. – muru Aug 9 '15 at 6:15
  • So, @muru , in my above example for eth3, can we say zeroconf was not enabled? – Sopalajo de Arrierez Aug 9 '15 at 15:19
  • 1
    I think you cannot say yes or no, because it's not plugged in (it would say RUNNING). Auto-config addresses require duplicate detection, so they have to probe the link first. Note modern ip link is better, it inverts the sense and would explicitly show NO CARRIER. linux ipv4 link-local pointer is here. Basically no-one enables it. NetworkManager doesn't support it as a fallback because of potential confusion, presumably it's considered too unusual to be worth the effort to provide sensible UI / UX. – sourcejedi Aug 9 '15 at 20:37
2

The current version of IP has "zeroconf" addresses built in. If IPv6 is enabled, in general there should be a link-local address. You can't scan for it as IPv6 addresses are too large. You should be able to watch for automatic addresses when you turn the device on, as its kernel will probe to make sure no other device has the same address. You can use Wireshark or maybe tcpdump to look for the probe packets. This is called duplicate address detection (DAD) and uses ICMPv6.

When you connect to this address, you will additionally have to specify the network interface, e.g. fe80::1 + eth0 = fe80::1%eth0. In web browsers I think you have to enclose the entire thing in square brackets.


Traditionally the link-local address will be derived from the MAC address. If you can read off the MAC address from a label on the device, you can also calculate the IPv6 link local address.


Unfortunately these addresses won't work with the traditional Linux link-local name resolution. (Avahi doesn't support ipv6 for this and I don't think samba does either. systemd-resolved is hopefully better at ipv6).

Your Answer

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

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