Wiley
Wiley

Reputation: 21

avahi Segregated mDNS domains from one multi-homed host

We're attempting to enable a number of mDNS advertised services on our campus wide wireless network, most notably airplay. In our case, the airServers would sit on our wired network, so we need to advertise the services manually either with DNS-SD or mDNS on the wireless side. We've gotten that working using static service advertisements in avahi and it's pretty slick, but we have a scaling problem.

We have potentially 150 AirServer hosts in a variety of classrooms around the campus. If we were to enable all of them, the list to choose from on iPads would be outrageously large (to say nothing of students thoroughly enjoying taking over an AirServer from across campus when a faculty member forgets to change the password).

What we would like to do is segregate our wireless network on a single vlan per building basis to form 27 mDNS segments and then run avahi to advertise the services in each segment, preferably on a single, multi homed host with access to all of the segments.

I was hoping that avahi-daemon would take a parameter in the avahi-daemon.conf that points to a unique services directory, so that I could have multiple config files, each with a different allow-interfaces clause and a pointer to a different services directory, but that doesn't appear to be a configurable option.

I was thinking of chroot jailing multiple copies of avahi, but that seems really kludgy.

Am I missing some more obvious strategy to handle this without creating 27 separate hosts?

Thanks much!

JD

Upvotes: 1

Views: 1234

Answers (1)

slgramacho
slgramacho

Reputation: 31

It is possible to achieve what you want if you build your own application for publishing the services in the interfaces you want. This method call is from GNUStep "base" framework, class GSAvahiNetServices (can be used on Linux) and the method is based on the Avahi API.

- (id) initWithDomain: (NSString*)domain
                 type: (NSString*)type
                 name: (NSString*)name
                 port: (NSInteger)port
         avahiIfIndex: (AvahiIfIndex)anIfIndex
        avahiProtocol: (AvahiProtocol)aProtocol

As you can see it is possible to specify the network interface index you want the service to be published on. You can also limit the protocol (IPv4 or IPv6). If you want one service to be available in more then one interface, just publish it in each interface.

Upvotes: 1

Related Questions