Using the dummy0 interface for a local-only service to be broadcasted by Avahi

Till Kamppeter till.kamppeter at
Fri Dec 30 14:15:12 UTC 2016

On 12/30/2016 12:01 PM, Stéphane Graber wrote:
>> - Is there any replacement for the third line using the "ip" instead of the
>> "ifconfig" command?
> sudo ip link set ippusbxd multicast on
>> - How can I implement these three lines in C?
> I think the recommended way to do so nowadays in C (and what iproute2
> itself uses) is through the kernel's netlink interface, possibly through
> the use of libnl or another binding.
> You should be able to find some example code out there, though note that
> netlink certainly isn't the most developer friendly kernel API (but is
> unfortunately the only real one for networking) :)

Thanks, I will look into this.

>> And now to the real problem:


>> - cups-browsed adding "%25ippusbxd". To implement this I would need a method
>> (in C) which finds out that the IP belongs to the "ippusbxd" interface.
> Should be reasonably easy to iterate through all interfaces and find
> which has the matching address (that would be done through netlink too).
> If dealing with IPv6 link-local becomes too much of a pain, you can
> still go the ULA way and generate a random ULA address that you add to
> your ippusbxd interface which will then work without needing the
> interface name or interface id suffix.

Thank you very much, I will look into the random ULA address solution.


More information about the ubuntu-devel mailing list