vfreex / mdns-reflector

a lightweight and performant multicast DNS (mDNS) reflector with modern design, supports zone based reflection and IPv6
GNU General Public License v3.0
166 stars 16 forks source link

Feature: Running multiple mdns-reflector processes in parallel. #7

Closed dzatoah closed 1 year ago

dzatoah commented 1 year ago

A nice future feature would be to have multiple systemd mdns-reflector services running in parallel. All processes would have their own config file. Each process does a slightly different job.

For example: You'd have 4 networks one of the networks is a printer-only network. You want to let the printers announce their service via mDNS to the other networks. But only into the other networks, NOT vice-versa. And only ipp services should get through. Everything else should be filtered.

You'd make 4 systemd-services with a config file each.

So this is the most generic approach we could find. This makes mdns-reflector extremely flexible while keeping it's memory and CPU footprint low.

We can copy this mechanic from openvpn. They're doing a pretty good job.

This feature is of course dependent on #5 and #6

sunweaver commented 1 year ago

@vfreex Do you see any blockers for implementing this?

vfreex commented 1 year ago

@sunweaver It sounds like a nice feature. Currently mdns-reflector has limited ability to forward in parallel within a single process, like:

mdns-reflector -fn eth0 eth1 -- eth2 eth3 -- eth4 eth5

This will forward messages (through 3 forwarding planes):

However as you might noticed, it is not possible to forward unidirectionally at this moment (which might require parsing the mDNS message and doing some filtering) or place a single interface to multiple forwarding planes.

I didn't see a blocker but not sure how hard to implement this for now. I saw #5 and #6 mentioned patched would be provided. Getting the program to filter unidirectionally might be the first step. Do you have any ideas?