1

I have a Linux device connected to two different networks. eth0 is connected to 198.18.248.x and wlan0 is connected to 198.19.255.x. Another device connected to the 198.18.248.x network and it's broadcasting Avahi mDNS services. How can I forward the mDNS packets from the 198.18.248.x network to 198.19.255.x (from eth0 to wlan0) so that anyone connected on 198.19.255.x would see the avahi services from 198.18.248.x? Is it even possible?

Thanks

3
  • You should consider a proper network setup using regular DNS.
    – Zac67
    Commented Mar 11, 2021 at 7:47
  • 1
    Unfortunately, questions about hosts/servers and protocols above OSI layer-4 are off-topic here. You could try to ask this question on Server Fault for a business network.
    – Ron Maupin
    Commented Mar 11, 2021 at 16:05
  • The solution is probably having an avahi reflector ( manpages.ubuntu.com/manpages/bionic/man5/… )
    – Jakob
    Commented Apr 13, 2023 at 20:19

1 Answer 1

5

Zeroconf Networking RFC 6272, RFC 6273 has the fundamental design constraint of being "local subnet only".

Zeroconf's multicast packets have a TTL of 255, and if you try forward these through a router, TTL is decremented by 1 (that's what routers do...). Zeroconf implementations I have come across drop the packets they receive if the packet's TTL is <255. There's a reference to that in RFC 6272, p.37:

All Multicast DNS responses (including responses sent via unicast)
SHOULD be sent with IP TTL set to 255. This is recommended to
provide backwards-compatibility with older Multicast DNS queriers
(implementing a draft version of this document, posted in February
2004) that check the IP TTL on reception to determine whether the
packet originated on the local link. These older queriers discard
all packets with TTLs other than 255.

Even using a "multicast helper" will not help here; while it can convert multicast packets from one subnet to unicast packets in the other, TTL will still be decremented.

To make it work, you'll need software on a dual homed system/host acting as gateway, "recaster" or proxy server.

Some network vendors have a "service discovery gateway" feature. I do know that Cisco IOS and IOS XE based routers have it. It is described here: https://www.cisco.com/en/US/docs/ios-xml/ios/ipaddr_dns/configuration/15-e/dns-serv-disc-gtw.html

Service Discovery Gateway

The Service Discovery Gateway feature enables multicast Domain Name System (mDNS) to operate across Layer 3 (L3) boundaries (different subnets). An mDNS gateway will be able to provide transport for service discovery across Layer 3 boundaries by filtering, caching and extending services from one L3 domain (subnet) to another. Prior to implementation of this feature, mDNS was limited in scope to within a subnet due to the use of link-local scoped multicast addresses. This feature enhances Bring Your Own Device (BYOD).

1
  • Thanks, I'm not using any router from any big vendor, I'm trying to do this on a custom linux device running openwrt.
    – Mihai
    Commented Mar 11, 2021 at 7:55

Not the answer you're looking for? Browse other questions tagged or ask your own question.