Allow Broadcasts from Guest Network to Host Network

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Author Message
Tuus Vere
DD-WRT Novice


Joined: 12 Jan 2020
Posts: 4

PostPosted: Sat Feb 15, 2020 19:57    Post subject: Allow Broadcasts from Guest Network to Host Network Reply with quote
I have a working (unbridged) guest network that I created as per these instructions: https://web.archive.org/web/20170713083950/http://tips.desipro.de/wp-content/uploads/2013/12/GuestWireless.png

I want to be able to send broadcast packets from guest to host subnet. Is there a way? I can modify or recreate guest network as needed, but I do not want to have host and guest on the same subnet and lose firewall between them.

(What I'm trying to achieve here is the discovery of few 'Web Things' which reside on my guest network, by devices such as phones on my host network).


Last edited by Tuus Vere on Sat Feb 15, 2020 20:44; edited 1 time in total
Sponsor
Per Yngve Berg
DD-WRT Guru


Joined: 13 Aug 2013
Posts: 6868
Location: Romerike, Norway

PostPosted: Sat Feb 15, 2020 20:35    Post subject: Reply with quote
Use Avahi and mDNS.

https://www.avahi.org

Avahi is install-able from Entware.
Tuus Vere
DD-WRT Novice


Joined: 12 Jan 2020
Posts: 4

PostPosted: Sat Feb 15, 2020 20:42    Post subject: Reply with quote
Per Yngve Berg wrote:
Use Avahi and mDNS.

https://www.avahi.org

Avahi is install-able from Entware.


Thanks, I'll look into these.

One thing to note is that the discovery of the 'Web Things' residing on the guest network is to be done by devices (such as phones, and not just Linux computers) residing on the host network. While I'll investigate, I'm not sure if Avahi/mDNS will help in this scenario.
manisar
DD-WRT Novice


Joined: 20 Feb 2020
Posts: 4

PostPosted: Thu Feb 20, 2020 20:44    Post subject: Reply with quote
After extensive research I've been able to find two interesting and completely unrelated ways to resolve this issue of mine!
  1. bcrelay
  2. samplicator

Before explaining these, I just want to reiterate that it is virtually impossible to make routers forward broadcast messages between different subnets/interfaces. Given below are two workarounds to overcome this constraint.

1. bcrelay. This is a very simple utility that happens to be there on dd-wrt as well Smile.
As the name suggests, it simply reads broadcast messages from one interface, and sends them out to another interface. Doesn't have many options, but at least it can run as a daemon.

With this I was able to relay the broadcast messages coming from the web-things on my guest network to the devices on my host network, and the devices were able to discover the things and communicate with them.

It has some limitations or issues as explained below.
  • Can be demanding on resources (I didn't test that).

  • All broadcasts are relayed - including DHCP requests etc. - iptables on the router seems to have absolutely no control over both incoming and outgoing messages through bcrelay.
    This is something I definitely wanted to avoid.

  • If you sometimes connect your devices (in tun mode) to your router via OpenVPN server (running on the router), bcrelay will not work - OpenVPN will not relay broadcast messages given to it by bcrelay. I had this constraint of using tun and not tap.

So, in all, bcrelay is a quick and dirty workaround.

2. samplicator. This is an interesting tool that can receive UDP datagrams on a given port and send them to a set of receivers. One of the good things about this is that it has a lenient config file that allows multiple destinations for multiple sources.
And another awesome feature is that it can spoof IP addresses - i.e. the new destination devices (on the host network) will still the IPs of the original web-things!

I didn't try compiling it for dd-wrt because I anyway have a spare Linux machine that is always on.
So, I took the code from github - https://github.com/sleinen/samplicator, compiled it on the Linux machine and, since all my web-things are using only couple of ports to send broadcasts, I ran two samplicate daemons each listening on a specific port, in order to send those packets to only certain devices of my choice.

So, now I'm converting broadcasts-to-unicasts!
This means that OpenVPN is happy now, and on the other hand I'm not pushing too much traffic into my host network (broadcasts are costly - all clients have to read them).

Along with this, I had to open channels between the web-things and devices accordingly using iptables (i.e. through the host-guest and VPN/guest firewalls).

Lastly, after testing, I stopped internet access for those web-things.

samplicator is doing almost exactly what I wanted, and it might be very well possible to have it running on the router-itself, maybe someday I'll give it a try.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum