Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could I use avahi to publish service across subnetworks?

Avahi is usually used for service discovery. I want to make a service discoverable from a different subnetwork, could I use avahi to achieve this?

For example, the service host ip is "192.168.1.100" with mask "255.255.255.0", so it's in 192.168.1.X subnetwork. Another host ip is "192.168.2.100" with mask "255.255.255.0". Could I use avahi to let this host discover the previous service host?

like image 573
bertyuan Avatar asked Jan 08 '14 03:01

bertyuan


People also ask

Does mDNS work across subnets?

mDNS's uses of multicast packets is designed to work within a single IP subnet. That is, mDNS traffic does not cross from one IP subnet to another. As a result, mDNS can be used among a set of devices that are all attached to a single IP subnet, but cannot be used among devices attached to different IP subnets.

What is avahi daemon used for?

The avahi-daemon Linux service runs on client machines to perform network-based Zeroconf service discovery. Avahi is an implementation of the DNS Service Discovery and Multicast DNS specifications for Zeroconf Networking.

Does avahi daemon require service?

Generally, Avahi is only useful in small local networks (such as a home LAN). The avahi-daemon process handles mDNS, which is used for name resolution and service discovery within the local network. If you don't need its functions, Avahi can be safely removed.

What is avahi service?

Avahi is a system which enables programs to publish and discover services and hosts running on a local network. For example, a user can plug a computer into a network and have Avahi automatically advertise the network services running on its machine, facilitating user access to those services.


1 Answers

Unfortunately, no, it's going to require reconfiguration of whatever device is routing between those two subnets. mDNS uses the multicast addresses 224.0.0.251 for IPv4 and ff02::fb for IPv6. Those are link-local addresses and the data sent to them is typically not routed outside of the current subnet.

There are various options, some may be easier than others depending on what your routing device is.

Multicast Proxying. mdns-repeater is a simple solution that will repeat mDNS requests across interfaces.

Wide Area DNS. Wide-Area DNS-SD could be enabled on the DNS resolver that is service the hosts in those subnets. Avahi could then be configured to publish not the .local domain but to the domain for those subnets.

Multicast Routing. The device routing between those subnets could be configured to route the multicast groups between those two subnets.

mDNS Gateway. There is a draft RFC for implementing a mDNS gateway that sits at the edge of a network segment (typically a router). This is not a simple repeater/reflector, but a gateway that caches service entries and responds to queries from other connected network segments.

like image 83
Linville Avatar answered Sep 23 '22 04:09

Linville