Possible to do mDNS across VLANS without AVAHI, and using smcroute?

So far I have been using the AHAVI reflector to get mDNS between certain VLANs/subnets.

Also I am doing SSDP and CoAP between those VLANs/subnets using a combination of static multicast routes (smcroute), iptables mangling to keep the TTL above 1, and firewall rules to allow the packets to pass between the subnets.

Now - forgive my naivete - I thought it would be nice to treat mDNS the same as SSDP and CoAP to get rid of the layer 7 reflector. The main reason being, that the Apple Homekit Home App will periodically lose contact to the devices for about a minute or so, which is super annoying (as it always happens when you tell Siri to switch the lights, or whatever).

So I wanted to solve that. And it just does not work as it does for SSDP and CoAP.

excerpt from /etc/smcroute.conf:

mgroup from ethX.abc group 224.0.0.251
mgroup from ethX.xyz group 224.0.0.251

mroute from ethX.abc group 224.0.0.251 to ethX.xyz
mroute from ethX.xyz group 224.0.0.251 to ethX.abc

TTL mangling custom rule:

iptables -t mangle -A PREROUTING -d 224.0.0.251 -m ttl --ttl-lt 2 -j TTL --ttl-inc 1

and firewall rules:

config rule
        option name 'ABC mDNS'
        list proto 'udp'
        option src 'abc'
        option dest '*'
        option dest_port '5353'
        option target 'ACCEPT'
        option src_port '5353'
        list dest_ip '224.0.0.251'

config rule
        option name 'XYZ mDNS'
        list proto 'udp'
        option src 'xyz'
        option dest '*'
        option dest_port '5353'
        option target 'ACCEPT'
        option src_port '5353'
        list dest_ip '224.0.0.251'

Using tcpdumpI can see the mDNS packets in each subnet, and I can only see mDNS packets that are originating in the very same subnet!

tcpdump -n -i ethX.abc udp and host 224.0.0.251

Using smcroutectl show routes I can see that the routes are successfully prepared, but the packet count for the mDNS routes are 0 (although they should not be according to the observations with tcpdump!). Also no specific routes have been created for that mgroup, but it happens perfectly for the SSDP and CoAP mgroups I have defined.

(*, 224.0.0.251)                   ethX.abc         ethX.xyz
(*, 224.0.0.251)                   ethX.xyz         ethX.abc

Is 224.0.0.251 somehow differently treated by smcrouted or iptables or the kernel such that smcrouted does not see packets for that address?

I know this whole thing is discouraged and i saw this:

So please spare your breath, if you have a lessons why this is discouraged. My question is this:

Is something in smcroute or in openwrt making it impossible to statically route 224.0.0.251 so that AHAVI reflector is the only possible solution on OpenWRT?

If not, what am I overlooking or where is my mistake here?

1 Like