avahi
avahi copied to clipboard
select only certain networks on an interface that has multiple ip addresses
hello,
I have an interface that has several IPv6 networks.
Network 1: 2001:bc8:AAAA:BBBB::1/64 Network 2: fd42:a1a2:bbbb:1234::1/64
The problem is that Avahi, subscribes to the 2 network of this interface. I would like him to do just to the network fd42:a1a2:bbbb:1234::1/64 and not at 2001:bc8:aaaa:bbbb::1/64, in order not to have a duplicate And that it plays the ping pong between the two networks.
Is it possible, and if so, how?
I did a lot of research, which did not give me satisfaction
Thanks a lot !
Jeremyp3
up
I think you can review the interface_mdns_mcast_join, and set some criteria to control which ipv6 address you want to join the multicast group.
See below lines in this function
avahi_log_info("%s mDNS multicast group on interface %s.%s with address %s.",
join ? "Joining" : "Leaving",
i->hardware->name,
avahi_proto_to_string(i->protocol),
avahi_address_snprint(at, sizeof(at), &i->local_mcast_address));
I was hoping for a solution without having to touch the avahi source code. for example something to modify on the system side, or something else...
In avahi source code, it finds all the available interfaces and subscribes to them. There is no option to control it to use a specified interface. In system wide, I have no idea except that you can hide the unwanted interfaces in your system.
There does not seem possibility to avoid just selected addresses on the interface. You can enable or disable interface in configuration file, but not per address range.
It seems to me avahi might put first the address from the same network as the querier. It should make it default to ping the same subnet and avoid using gateway to cross networks. If the first address works, it might not need to use the second. Anyway, it seems not possible without code change, sorry.