[avahi] Running avahi

Lennart Poettering mzzhgg at 0pointer.de
Sat Jul 2 10:45:03 PDT 2005


On Sat, 02.07.05 12:15, Steev (steev at steev.net) wrote:

> I did notice that when I use nmap to scan, I get
> 
> Jul  2 12:00:58 mebius avahi[10621]: Recieved packet from invalid interface.
> Jul  2 12:00:59 mebius avahi[10621]: Recieved packet from invalid interface.
> Jul  2 12:01:00 mebius avahi[10621]: Recieved packet from invalid
> interface.

Yes, avahi accepts traffic only from interfaces it considers
"relevant", i.e. not from the loopback device (you scanned "localhost"
with nmap, didn't you?)

> I have added in IP Multicasting support, not sure how or why I disabled
> it, but I still don't get avahi starting "properly" - I *think* it might
> have to do with my ethX devices (or wlanX devices) being down when I
> start it, however, I tried ifconfig ethX up and then starting avahi, but

avahi uses netlink to be notified when the network configuration
changes, so it shouldn't make a difference if you "up" the interface
before starting avahi or if you do it after that. 

> I still don't get it.  I disabled iptables until I can figure out what
> is going on with avahi, and the new output of netstat -gn is
> 
> mebius steev # netstat -gn
> IPv6/IPv4 Group Memberships
> Interface       RefCnt Group
> - --------------- ------ ---------------------
> lo              1      224.0.0.1
> ppp0            1      224.0.0.1
> lo              1      ff02::1
> eth0            1      ff02::1:ff33:fde1
> eth0            1      ff02::1

avahi still doesn't subscribe to any the multicast group on any
interface. Everytime avahi finds a new "relevant" interface it prints
a line like "New relevant interface dummy0.2 (#4)" to syslog (or
STDERR).

Interfaces are considered relavant iff:

 - the interface has the flag  UP set
 - AND it has the flag MULTICAST set
 - AND it has the flag LOOPBACK *not* set
 - AND it has the flag POINTOPOINT *not* set
 - AND it has at least one address assigned with scope "global".

It seems as if avahi ignores the eth0 interface on your machine. To
check why, please post the output of "ifconfig eth0". It should look
like this:

<snip>
eth0      Link encap:Ethernet  HWaddr 00:0E:A6:52:A3:3D
          inet addr:192.168.50.4  Bcast:192.168.50.255
          Mask:255.255.255.0
          inet6 addr: 2001:db8:0:1:20e:a6ff:fe52:a33d/64 Scope:Global
          inet6 addr: fe80::20e:a6ff:fe52:a33d/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8697696 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1607548 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2501930990 (2.3 GiB)  TX bytes:379646172 (362.0 MiB)
          Interrupt:209 Base address:0x8800
</snip>

To check if avahi's netlink support works, please run "ifconfig dummy0
1.1.1.1 multicast". Then avahi should print the line "Interface
dummy0.2 no longer relevant". After that run "ifconfig dummy0 down"
which should bring avahi to print "Interface dummy0.2 no longer
relevant".

> Jul  2 12:01:58 mebius avahi[10956]: iface.c: avahi_server_add_service()  failed.

You seem to have a very interesting network configuration, haven't
you? Something with empty MAC addresses or similar? Please post an
"ifconfig -a" output, too.
> Jul  2 12:12:59 mebius sshd[11377]: Server listening on :: port 22.
> Jul  2 12:12:59 mebius sshd[11377]: error: Bind to port 22 on 0.0.0.0
> failed: Address already in use.

By default if an application binds on an IPv6 port its binds to the
same port on IPv4, too. So if you bind on "::" (which is the IPv6
equivalent of 0.0.0.0, i.e. all local addresses) you bind on 0.0.0.0
too. It seems like you have an explicit line for binding to 0.0.0.0 in
your sshd_config, so this conflicts.

Lennart

-- 
name { Lennart Poettering } loc { Hamburg - Germany }
mail { mzft (at) 0pointer (dot) de } gpg { 1A015CC4 }  
www { http://0pointer.de/lennart/ } icq# { 11060553 }


More information about the avahi mailing list