-8

If a new host connects to a LAN without a DHCP server, how does it receive an IP?

4 Answers 4

6

if a DHCP server is not available.

Reserved addresses from 169.254.0.0-169.254.255.255 is used for automatic addressing. It wont conflict because its non routable

Manual config can also be done. There after TCP IP takes care.

4
  • You mean APIPA/AVAHI... that's not really the same thing, it doesn't allow it to talk to the other hosts on the network.
    – D Whyte
    Jul 7, 2014 at 8:30
  • 1
    @DWhyte it allows devices on a local segment that are all using apipa to talk to one another. It's not pretty, it's quite limited, and I certainly wouldn't recommend using it to anyone, but it does work.
    – Rob Moir
    Jul 7, 2014 at 8:36
  • 1
    Perhaps the scope of the question needs expansion, if all use APIPA/AVAHI... then I guess this is correct, the realism kicks in that if they are using APIPA addressing on servers just to avoid DHCP or to configure routers... then something is very wrong.
    – D Whyte
    Jul 7, 2014 at 8:39
  • 2
    Absolutely @DWhyte is right. The answer to "how do I make use of APIPA" is "you do not". While I see it might be useful for two non-technical people who just want to connect two devices, I think it's almost a step back in terms of technical troubleshooting of a connection. In some ways it was easier for problems to become apparent when things simply didn't work at all.
    – Rob Moir
    Jul 7, 2014 at 8:50
6

See RFC 2322, Management of IP by peg-DHCP.

3

Behold the beauty of IPv6 - it has Stateless Address Autoconfiguration, defined in RFC 4862.

IPv4 has APIPA (RFC 3927) and obviously the option of manual configuration.

Note that for functional networking you likely will need more than just "an IP". Name resolution and service discovery likely need to be addressed as well. See Zeroconf for further details and references to real-world implementations.

1

It doesn't. You would need to assign one yourself.

5
  • 1
    APIPA has been around long enough and on enough devices to make this "no longer strictly correct", I would say.
    – Rob Moir
    Jul 7, 2014 at 8:30
  • Sure, APIPA/AVAHI... but the point is these will not communicate with statically assigned machines... presumably a gateway will have an ip address statically assigned...
    – D Whyte
    Jul 7, 2014 at 8:33
  • I'm not saying it's a good idea as a strategy for building a LAN but you could get a few machines talking to one-another just using APIPA/zeroconf
    – Rob Moir
    Jul 7, 2014 at 8:35
  • I'm not arguing it's validity, in the real world - this is not an option.
    – D Whyte
    Jul 7, 2014 at 8:36
  • I agree it's not a sensible real world option. But the OP asked what would happen, not whether or not what happens is viable in the real world.
    – Rob Moir
    Jul 7, 2014 at 8:41

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