i have a setup with multiple LANs.
now i have a device on LAN_A (subnet A) which needs to send a UDP packet to the broadcast address of LAN_B (subnet B) port 13111, so that multiple devices on LAN_B, listening on port 13111 get the packet.
i tried a lot, but so far, i could not get the packet to LAN_B broadcast address port 13111.
how exactly do i need to configure OPNsense for this?
i was able to send the packet to a specific address of LAN_B, but for broadcast, this did no work so far.
Broadcast traffic is per definition not routeable. Take a look at the plugin os-udpbroadcastrelay.
thanx for pointing to the plugin.
i installed the plugin and tried, but for some reason, i still don't get any broadcast data through.
my packet sender is 10.1.1.240 and i want to broadcast to 192.168.1.255.
so what is the required setup in the plugin? looks like i still do something wrong.
and to what address does 10.1.1.240 need to send the udp packets? to 10.1.1.255 or 192.168.1.255 ?
are there any other settings required in OPNsense?
Guessing from how you ask, you have your own broadcast sender - are you sure that it really sends broadcasts? A broadcast is not just a broadcast IP as destination, you will need to send the packets on the broadcast address (i.e. MAC ff:ff:ff:ff:ff:ff). So, you should first try to reach clients on your own subnet (i.e. 10.1.1.255/24, if that is the correct subnet).
That will also be the address you use when your broadcasts should be relayed to your second network interface on 192.168.1.x/24.
Of course, you need to configure the udp broadcast relay by creating an entry via selecting two (or more) participating OpnSense interfaces, the port and the source and broadcast address that packets should be relayed to. Usually, such packets are used to broadcast content such that clients can detect services, which then can be routeable. The other option is to actually broadcast data directly to multiple clients.
But which source and destination addresses must be used is up to the implementation - if it is your own, then you must know yourself. If it is some standard protocol, like SSDP or something of that sort, you should provide what you want to do and hope that somebody has done that already to provide more details. Essentially, this all boils down to OpnSense listening for broadcasts on the sender's network segment and repeating those packets to the other interface(s).
For MDNS, there is also a specialized relay (os-mdns-repeater).
the application is a device connected to one subnet, than periodically sends its status as a udp packet.
this packed needs to be read by several devices located in the 2nd subnet. unfortunately, i was not able so far to get this packet through OPNsense in a way that it goes to the broadcast address of the 2nd subnet.
so now i implemented a workaround. i send the packet to a specific IP in the 2nd subnet, where i programmed my own relay that listens for the incoming packets and broadcasts them. not very elegant, but so far the only approach that seems to work for me.
But that is exactly what os-udpbroadcastrelay does and you can configure the port and how it delivers the relayed packets to the other interface(s). How does that not work (besides having forgotten to open the receiving port on OpnSense via a firewall rule, of course)?
You can debug all of that with tcpdump on OpnSense and see if/how the packets come in and what goes out.