this post was submitted on 15 Jan 2024
8 points (100.0% liked)

homelab

6589 readers
6 users here now

founded 4 years ago
MODERATORS
 

I have a network set up something like the following:

Device A <---> Router A <---> Router B <---> Device B

where Router A is a tp-link Archer AX73, and Router B is a tp-link Archer C7. Router B is flashed with OpenWRT, and Router A is using stock firmware. Router B is set up to be a wireless bridge between Router A's network, and its own (it was set up using this guide).

What I am wondering is if Device A can find, say, Device B.local, using Avahi (assuming Device A, and Device B both have Avahi installed, and running), over this bridged network. So far, I haven't been able to get it to work, so I'm wondering if it is possible at all. I have read that Avahi only works on a local network, but I was wondering if it could be bridged.

UPDATE (2024-01-16T01:28Z):

The issues that I mentioned in this post have since been solved. The majority of the issues stemmed from the fact that the relay software that I was using, relayd, doesn't support ipv6. All the tests that I was conducting were defaulting to ipv6, so it was appearing like the bridge was failing unpredictably. Since that realization was made, and countermeasures were enacted, the problem was solved.

top 25 comments
sorted by: hot top controversial new old
[–] [email protected] 5 points 9 months ago (1 children)

Avahi uses mDNS which is a multicast protocol. Multicast is designed to be link-local only: it ends at the edge of a broadcast domain. Router A would also need to bridge in order for that to work (i.e. Device A and B would need to have the same broadcast ip).

On the other hand, there are ways of setting up Multicast Forwarding if the router supports it, or you could have a device in both networks that does Avahi/mDNS Reflection.

https://www.cisco.com/assets/sol/sb/Switches_Emulators_v2_3_5_xx/help/250/index.html#page/tesla_250_olh/multi_forwarding.html https://serverfault.com/questions/121032/forward-mdns-from-one-subnet-to-another

[–] [email protected] 1 points 9 months ago

Router A would also need to bridge in order for that to work

Why would Router A also need to be a bridge? Router B is configured to bridge its devices to Router A's network, so, from what I understand, its devices are treated as if they are on Router A's network -- bridging is layer 2, and mDNS is layer 3 (afaik), so Avahi should be able to resolve across the bridge.

On the other hand, there are ways of setting up Multicast Forwarding if the router supports it, or you could have a device in both networks that does Avahi/mDNS Reflection.

Wouldn't this only matter if Device A, and Device B were on two separate vlan's?

[–] [email protected] 2 points 9 months ago (1 children)

These are routed networks, and you need avahi reflector set up to mirror between A and PtP and between B and PtP

[–] [email protected] 1 points 9 months ago (1 children)

Router B is bridging Device B to Router A's network, so they aren't on separate vlans; thus, it shouldn't require an mDNS reflector as that repeats mDNS between separate subnets.

[–] [email protected] 1 points 9 months ago (1 children)

Then I don’t understand your topology. However, I still think you need the reflector on both routers

[–] [email protected] 1 points 9 months ago (1 children)

Afaik, an mDNS reflector is only needed to cross subnets -- both subnets and mDNS function on layer 3. Bridging occurs on layer 2, and since mDNS functions in layer 3 (ipv4 multicast is layer 3), the bridge itself is invisible to it.

[–] [email protected] 1 points 9 months ago (1 children)

This works if B has an interface that is connected to the A subnet, but not if you have a PtP between the two routers

[–] [email protected] 1 points 9 months ago (1 children)

This works if B has an interface that is connected to the A subnet

I'm not sure I understand exactly what you mean. Is it not given that if two routers are connected to each other then an interface from either of them will be connected to the other?

but not if you have a PtP between the two routers

What do you mean by PtP? Are you referring to something like WDS, or, in my case, relayd?

[–] [email protected] 1 points 9 months ago (1 children)

No, with PtP I meant a point to point link on a dedicated interface just for the two routers. https://image2.slideserve.com/5192070/point-to-point-sub-interfaces-l.jpg

[–] [email protected] 1 points 9 months ago* (last edited 9 months ago) (1 children)

Wait, are you just generally referring to this? That already exists in the form of PPPoE, and, for all intents and purposes, WPA, does it not?

[–] [email protected] 1 points 9 months ago* (last edited 9 months ago) (1 children)

No, not at all 🙂. I'm referring to a configuration in which the two routers are linked through another subnet (using a separate link between the two) and this link is the point to point link. You usually assign a /30 so you can have an address for each router. ~This way the traceroute shows three hops instead of just two.~ However, since you’ve already told us that this is not your setup, what I’m saying shouldn’t matter to you. If you’re curious though, let’s keep talking :)

Edit: striked mistake

[–] [email protected] 1 points 9 months ago (1 children)

Interesting, where does the 3rd hop come from? Wouldn't the routing table just point from one router to the other -- so 2 hops?

[–] [email protected] 1 points 9 months ago* (last edited 9 months ago) (1 children)

Traceroute from device in subnet A to device in subnet B

  • Router A
  • Router B
  • Device B

Note that the only way to do that in only two hops is to have the same router handle both subnets, contrary to what I said earlier.

[–] [email protected] 1 points 9 months ago (1 children)

To make sure that I understand correctly, are you describing something similar to what was described in this thread?

[–] [email protected] 1 points 9 months ago (1 children)

Hmmm it seems that router B there should be a bridge. However, how comfortable are you with routing in general?

[–] [email protected] 2 points 9 months ago (1 children)

However, how comfortable are you with routing in general?

Ha, depends what you mean by that. If you mean manually specifying routes in a router, I think I generally understand it, but I am not at all confident in my abilities.

[–] [email protected] 2 points 9 months ago (1 children)

Exactly that. Router A

ip address add 192.168.1.1/24 dev eth1
ip address add 10.0.0.1/30 dev eth2
ip route add 192.168.2.0/24 via 10.0.0.2

Router B

ip address add 192.168.2.1/24 dev eth1
ip address add 10.0.0.2/30 dev eth2
ip route add 192.168.1.0/24 via 10.0.0.1

Does this make it more clear?

[–] [email protected] 2 points 9 months ago (1 children)

Does this make it more clear?

Yes, thank you! Usually, however, most of my issues seem to stem from knowing where configs are, what tools to use for what, or where to find things in the router user interface, etc.

[–] [email protected] 2 points 9 months ago

I definitely agree!

[–] [email protected] 1 points 9 months ago (1 children)

The majority of the issues stemmed from the fact that the relay software that I was using, relayd, doesn’t support ipv6. All the tests that I was conducting were defaulting to ipv6, so it was appearing like the bridge was failing unpredictably. Since that realization was made, and countermeasures were enacted, the problem was solved.

I hope this means you changed or fixed the software and not that you disabled IPv6.

[–] [email protected] 1 points 9 months ago
[–] [email protected] 1 points 9 months ago (1 children)

I'm not familiar with how Avahi works, but I assume it uses broadcast packets. Do you actually have routing between two networks, or is it just a wireless bridge? Do broadcast packets transit the bridge? Have you taken a packet capture from both sides?

[–] [email protected] 1 points 9 months ago

I’m not familiar with how Avahi works, but I assume it uses broadcast packets.

It does, yeah; multicast DNS uses multicast packets e.g. 224.0.0.251 (ipv4).

Do you actually have routing between two networks, or is it just a wireless bridge?

It's just a wireless bridge.

Do broadcast packets transit the bridge?

They do.

[–] [email protected] 1 points 9 months ago (1 children)

This sounds more like running double NAT with 2 routed networks? Are your clients all on the same subnet, or does router B have its own subnet?

Make sure you're actually doing a bridge and not adding a second router, then everything will work including avahi.

[–] [email protected] 1 points 9 months ago

Are your clients all on the same subnet

Router A (192.168.0.1) is a different subnet than router B (192.168.2.1).

Make sure you’re actually doing a bridge

Bridge was added using the linked guide (it uses relayd).