I have configured two IPv4 addresses on my eth0 network interface, so that I
can easily differentiate inbound connections coming from the Internet. Running
"ip addr" shows the following:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP
qlen 1000
link/ether 00:20:ed:31:16:f2 brd ff:ff:ff:ff:ff:ff
inet 192.168.20.10/25 brd 192.168.20.127 scope global eth0
inet 192.168.20.25/25 brd 192.168.20.127 scope global secondary eth0
inet6 fe80::220:edff:fe31:16f2/64 scope link
valid_lft forever preferred_lft forever
3: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast
state UNKNOWN qlen 100
link/none
inet 192.168.90.10 peer 192.168.90.9/32 scope global tun0
4: tun1: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast
state UNKNOWN qlen 100
link/none
inet 192.168.20.129/27 brd 192.168.20.159 scope global tun1
Notice eth0 has 192.168.20.10 as the main address and 192.168.20.25 as a
secondary address. I would like avahi to only use the main address, but it
seems to be always choosing the secondary address (except if I get rid of the
secondary one, then it uses the main one). I have attempted to use the "allow-
interfaces" option in the config file, but it appears that you can't specify an
IP address here.
Here is what I see in my syslog when I start the avahi-daemon service:
Dec 19 22:50:32 freddo avahi-daemon[15559]: Found user 'avahi' (UID 104) and
group 'avahi' (GID 107).
Dec 19 22:50:32 freddo avahi-daemon[15559]: Successfully dropped root
privileges.
Dec 19 22:50:32 freddo avahi-daemon[15559]: avahi-daemon 0.6.27 starting up.
Dec 19 22:50:32 freddo avahi-daemon[15559]: Successfully called chroot().
Dec 19 22:50:32 freddo avahi-daemon[15559]: Successfully dropped remaining
capabilities.
Dec 19 22:50:32 freddo avahi-daemon[15559]: No service file found in
/etc/avahi/services.
Dec 19 22:50:32 freddo avahi-daemon[15559]: Joining mDNS multicast group on
interface eth0.IPv6 with address fe80::220:edff:fe31:16f2.
Dec 19 22:50:32 freddo avahi-daemon[15559]: New relevant interface eth0.IPv6
for mDNS.
Dec 19 22:50:32 freddo avahi-daemon[15559]: Joining mDNS multicast group on
interface eth0.IPv4 with address 192.168.20.25.
Dec 19 22:50:32 freddo avahi-daemon[15559]: New relevant interface eth0.IPv4
for mDNS.
Dec 19 22:50:32 freddo avahi-daemon[15559]: Network interface enumeration
completed.
Dec 19 22:50:32 freddo avahi-daemon[15559]: Registering new address record for
fe80::220:edff:fe31:16f2 on eth0.*.
Dec 19 22:50:32 freddo avahi-daemon[15559]: Registering new address record for
192.168.20.25 on eth0.IPv4.
Dec 19 22:50:32 freddo avahi-daemon[15559]: Registering new address record for
192.168.20.10 on eth0.IPv4.
Dec 19 22:50:32 freddo avahi-daemon[15559]: Registering HINFO record with
values 'I686'/'LINUX'.
Dec 19 22:50:32 freddo kernel: [951518.445181] [UFW BLOCK] IN= OUT=eth0
SRC=192.168.20.25 DST=224.0.0.251 LEN=298 TOS=0x00 PREC=0x00 TTL=255 ID=0 DF
PROTO=UDP SPT=5353 DPT=5353 LEN=278
Dec 19 22:50:33 freddo kernel: [951518.695137] [UFW BLOCK] IN= OUT=eth0
SRC=192.168.20.25 DST=224.0.0.251 LEN=298 TOS=0x00 PREC=0x00 TTL=255 ID=0 DF
PROTO=UDP SPT=5353 DPT=5353 LEN=278
Dec 19 22:50:33 freddo kernel: [951518.946176] [UFW BLOCK] IN= OUT=eth0
SRC=192.168.20.25 DST=224.0.0.251 LEN=298 TOS=0x00 PREC=0x00 TTL=255 ID=0 DF
PROTO=UDP SPT=5353 DPT=5353 LEN=278
Dec 19 22:50:33 freddo avahi-daemon[15559]: Server startup complete. Host name
is freddo.local. Local service cookie is 3500664120.
Dec 19 22:50:34 freddo kernel: [951519.552272] [UFW BLOCK] IN= OUT=eth0
SRC=192.168.20.25 DST=224.0.0.251 LEN=136 TOS=0x00 PREC=0x00 TTL=255 ID=0 DF
PROTO=UDP SPT=5353 DPT=5353 LEN=116
Notice the line saying "Joining mDNS multicast group on interface eth0.IPv4
with address 192.168.20.25" - and there is no line for 192.168.20.10. (NB. The
UFW BLOCK stuff is my workaround to prevent this interface being used.)
Thanks for your time. (I apologise in advance if I am doing something really
stupid. Please let me know if the 'solution' to my problem should be to disable
the avahi-daemon service, as I don't think I actually need it for anything - I
just wasn't sure of the implications.)
Nick.