[avahi] General Avahi usage questions

Jen Chitty JenChitty at vtech.ca
Mon Feb 15 11:52:08 PST 2010

You can use the "--force-bind" option to force avahi-autoipd to ignore 
other interface configuration (for example, configuration by DHCP client) 
and go ahead and assign a link-local address no matter what.

Hopefully your network admin is a bit more on-the-ball than to allow a 
bunch of uncoordinated DHCP servers on the network.  But, if you're 
building consumer electronics products, it's probably a good idea to be 
ready for such a thing, if possible.  Of course, there's only so much we 
can do to deal with a network mis-configuration like that, and we must be 
very careful not to make the problem worse with our workarounds.



Linus Lüssing <linus.luessing at web.de>
Sent by: avahi-bounces at lists.freedesktop.org
02/12/2010 06:54 PM
Please respond to Avahi ML
        To:     Avahi ML <avahi at lists.freedesktop.org>
        cc:     (bcc: Jen Chitty/ENG/VTNCAN/VTECH)
        Subject:        Re: [avahi] General Avahi usage questions

Moin moin, Lennart,
Hi Jen,

thanks a lot for your detailed explanations so far.

On Wed, Feb 10, 2010 at 11:26:36PM +0100, Lennart Poettering wrote:
> On Sat, 06.02.10 18:46, Linus Lüssing (linus.luessing at web.de) wrote:
> > hi guys. I was looking for a way to get pidgin/libpurple working
> > with avahi+ipv6. but then I realised, that I'm lacking some basic
> > knowledge about avahi :)
> > 
> > first question: I think I remember having the avahi-daemon running
> > which assigned an ipv4 address on a new alias interface. when does
> > this happen, when not?
> avahi-autoipd is usually used as a fallback for dhcp.
I see. In the beginning I more had the impression that avahi would utilise
dedicated subnets only. But sounds plausible as at least for IPv4
IP collisions are a lot less when using dhcp. Hmm, but also... if
I intend to use a network without a dhcp server and all clients
rely on just using the link local ones, then one host that left its dhcp
server on by mistake could cause quite a lot of trouble couldn't
it? Or even if there were two dhcp serves on by mistake with two
different subnets... hell, that would split everything in two to
three clouds! I couldn't find an option to enforce link-local
addresses for avahi anywhere, is there something like this?
> > I also found this avahi-ipauto thingy, but it does not seem to be
> > running for this avahi-ip4ll stuff to assign a
> > adress
> > - and (if I remember right)
> uh? avahi-autoipd will assign one of those addresses if no other
> address is configured via dhcp or so.
Ah, okay. I had to play a little with dhcp client and avahi to
see when and how avahi-autoipd is actually determening this state.
On my Debian system it also looks like, that additionally I have
to set the according interface to static, dhcp or NetworkManager
in /etc/network/interfaces, right? (according to

> > 2nd question: how can I look up the ip addresses that are assigned
> > to mylaptop.local (mylaptop should just be the local host name in
> > /etc/hosts on on a debian system, right?)
> getent hosts mylaptop.local
Hmm, that did not seem to work, I'm just getting the local ip
addresses specified in /etc/hosts. But hey, the mdns-scan did at
least find the other machine in my network.
> (you need nss-mdns installed for that)
Ehm, and there's only the libnss-mdns available in Debian
unstable (and it is installed here).

> Avahi will always announce the "best" address it can find on each
> interface. Meaning that global addresses are generally preferred over
> link-local ones.
So like global -> organisation -> site -> link -> host? (Is the
ipv6 multicast scopes list the one that can be used as a
reference? Or is there something more complete?)
Another question that comes in my mind here: What happens, if two
computers have two different subnets configured which can't reach
each other over this one but could reach each other over their
ipv6 link local address as being on the same ethernet link.
Shouldn't avahi announce this link local address as well so that
those two hosts could communicate with each other anyway?
Is there a reason why avahi is not announcing all ip addresses
available on an interface (with adding its prefered priorities so
that the another host could choose the interface with the highest
priority stated and reachable as well)?

And I guess, avahi is announcing both the "best" ipv6 and ipv4
address letting the other hosts decide which type they are
capable connecting to, right?
> > 3rd question: when exactly is avahi-dnsconfd needed and why? Is my
> > assupmtion right, that I need this thing, if I want to use
> > applications that are not utilising avahi (for instance a normal
> > ping tool) and I want to reach mylaptop.local with that?
> It's useful when unicast-DNS server adresses are stored in multicast
> DNS. it could be used to configure unicast DNS servers in a non-dhcp
> environment. It is a more exotic feature and hence not installed by
> default on most distros.
> > 4th question: so an application that uses the libavahi can tell
> > the avahi-daemon to announce a certain service with the specified
> > port. which ip addresses would/should the avahi-daemon be
> > announcing then?
> as mentioned above avahi uses the "best" ip adress of each respective
> iface, and treat every iface seperately.
> > 5th question: what has to be kept in mind when using avahi with
> > ipv4+ipv6 or ipv6 only? read this article in the german linux
> > maganzine  03/06. at the end it is saying that for ipv6 stateless
> > autoconfiguration, avahi-dnsconfd is necessary. sounds plausible
> > because of the lack of a dhcp server. but why is this not the case
> > for avahi with ipv4?
> Some awesome dude wrote that article. He is really brainy and smart. I
> am a great admirer of his ;-)
> That said, I cannot remember I wrote "necessary" in that
> article. useful, yes. But necessary, no. In IPv4 if you do automatic
> configuration of routable IP adresses you use DHCP. And DHCP allows
> configuration of unicast DNS servers anyway. That's why the
> avahi-dnsconfd stuff is not really that useful there.
> Lennart
Okay, and then I'd have some more questions about how applications
that utilise the libavahi stuff should react. Sorry in advance,
didn't find the time to look at it yet, but will definitely do
that in two weeks the latest.
Should applications only allow connections from other hosts that
had previously announced themselves via avahi or should they accept
any connection (which might be a security issue?). But the first
thing could cause some trouble if the kernel would decide to use
source address differing from the one announced by avahi...
And again for IPv6, generally an application should try connecting
to the host's announced IPv6 address first and retry the IPv4 one
after a timeout?

Cheers, Linus
avahi mailing list
avahi at lists.freedesktop.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/avahi/attachments/20100215/8d9ad6a5/attachment.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/octet-stream
Size: 853 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/avahi/attachments/20100215/8d9ad6a5/attachment.obj 

More information about the avahi mailing list