[avahi] Mutli-homed server problem

Lennart Poettering lennart at poettering.net
Tue Apr 25 15:30:38 PDT 2006


On Wed, 12.04.06 21:51, Stuart Morris (yahoo at xover.co.uk) wrote:

Hi!

> The machine I am running Avahi on (local name "ruth") has two IP  
> addresses: eth0 is a "real world" ip (e.g. 81.82.83.84) and eth0:1 is  
> a private address (e.g. 192.168.0.84).
> Avahi appears to bind to both addresses. If I publish a web service  
> it shows up as ruth.local. but insists on returning the 81.82.83.84  
> IP address. As the service I'm trying to publish is for internal  
> consumption only and the web server is only listening on the internal  
> IP I really want it to return the internal IP.
> 
> So here is the question... How can I force Avahi to bind only to one  
> of the network devices and/or how can I force it to return the  
> internal IP address for ruth.local. ?
> 
> Or, have I misunderstood some fundamental zeroconf/Avahi principle?

Avahi treats all network interfaces completely independently. It will
 announce a host name record for the external IP address on the external network (and only
 there) and an another one for the internal IP address on the internal
network (and only there).

Unless you enabled some kind of bridging the address records for the
external IP address should never be seen in the internal net and vice
versa.

On the machine itself it depends on the routing and chance which
record is seen it which is not.

Avahi currently doesn't allow you to disable specific interfaces by
the name. However you can use a simple trick: Avahi will ignore
interfaces that have no MULTICAST flag set.  Since you probably don't
want to use any multicasting on the external interface anyway, just
remove that flag ("ifconfig eth7 -multicast") and Avahi will never
touch the device.

Lennart

-- 
Lennart Poettering; lennart [at] poettering [dot] net
ICQ# 11060553; GPG 0x1A015CC4; http://0pointer.net/lennart/


More information about the avahi mailing list