Default IP Address on All Distributions
Alexey Feldgendler
alexey at feldgendler.ru
Sat Dec 20 16:32:59 CET 2008
On Sat, 20 Dec 2008 13:26:01 +0100, William Kenworthy <billk at iinet.net.au>
wrote:
>>>> 169.254.0.0/16 is probably more appropriate because this range is
>>>> assigned to link-local addresses.
>>> Sure. And if we go that way, why not use the proper way of setting a
>>> link-local address?
>>> * Pick a random address
>>> * check that it is free (arp, ping,...)
>>> * take it.
That would be reinventing some wheels. See below for standardized
solutions.
>>> That has a good chance of working, even for those who
>>> routinely connect two phones to the same pc at the same time.
>> This would make it way harder to communicate with the freerunner.
>> For now you know you can reach it at 192.168.0.202 and most of the
>> documentations builds on this. So figuring out the ip address FR has
>> chosen is way harder, especially for newbies.
> Not if its handled right.
One possible way to handle it right would be:
1. Try DHCP first. If a DHCP server gives us an address, use it and skip
to step 3.
2. Grab a link-local IP address via IPv4LL (RFC 3927). This is even
supported by default by both Windows >= 98 and MacOS >= 8, as well as in
many Linux distributions, so it's as simple as plugging the device in.
3. If we have a DNS address from step 1, use it and skip to step 5.
4. Try discovering a DNS server using DNS-SD and use one if discovered.
5. Advertise through mDNS a user-configurable name defaulting to something
like openmoko.local.
6. Advertise relevant services through mDNS, such as ssh, sftp-ssh,
clipboard (would be nice, eh?), sip/h323 (why not?).
7. If we have a router address from step 1, skip to step 9.
8. Try some router discovery protocol (UPnP, SSDP?).
Most of this is fulfilled by using avahi <http://avahi.org>, so it seems
like a good choice. From a user's point of view, the device will never
cause routing problems and always be accessible at a fixed host name, even
without a domain name server.
Alternatively, the phone itself can run a DHCP server after step 1 and
assign an IP address to the peer, as well as run a DNS server. That way,
plugging the phone with GPRS enabled into a Windows machine will
automatically provide it with Internet connectivity.
--
Alexey Feldgendler <alexey at feldgendler.ru>
[ICQ: 115226275] http://feldgendler.livejournal.com
More information about the community
mailing list