Lora-gateway-bridge sends downlink messages to incorrect gateway port

Hi,

I have set up (on Ubuntu using the available apt packages) loraserver (loraserver, lora-app-server, lora-gateway-bridge) and configured everything and am receiving packets from a test node. I have run a tcpdump to capture the packets to and from my gateway (Tektelic pico gateway) and I see lora rx frames (encapsulated in a UDP packet) going to port 1700 of my loraserver setup, which is correct.

However, the packets my test node are sending are confirmed frames, and when the “ack” downlink frame from the loraserver is sent from the lora-gateway-bridge to my Tektelic gateway, I am seeing the outbund UDP packet going to the gateway’s IP, but on a port other than 1700 (49550 in this case). I have my gateway configured to both send/receive frames on UDP port 1700, so I am guessing that is why I don’t see any “ack” frames to my node.

Is there a way to configure the lora-gateway-bridge to send UDP packets to a particular port on the gateway?

LoRa Gateway Bridge responds to the source IP:PORT of the received UDP packet. If believe this is needed as the gateway “initiates” the UDP “connection” by sending periodically a PING request over UDP so theoretically LoRa Gateway Bridge can still respond, even when the gateway is behind a NAT or firewall.

Note that my experience is that sometimes this works and sometimes it doesn’t. To give you a concrete example:

I’m using a DigitalOcean droplet. When using the public IP assigned to the droplet, it works. When using an elastic IP (a public IP which I can re-assign to droplets) downlink UDP traffic gets dropped.

Hi, idpromnut !
I have the same situation.
When software wants to send UDP packet by default it takes first available source port after 1024. It is normal. But when my lora-gateway-bridge responds I have ICMP
11:22:19.565986 IP 192.168.5.199 > 192.168.5.1: ICMP 192.168.5.199 udp port 49155 unreachable, length 36
Seems like gateway doesn’t listen on port which was used to send a packet.
I was using NAT to redirect from global ip to my local net with lora-gateway-bridge but later I changed the configuration to UDP forwarder based on nginx stream module. Both variants have same symptoms…
Did you make that to be working?

UPD. With proper config of nginx stream module, I can avoid “port unreachable” errors. But still have “denied” when trying to join with otaa.

UPD1. UDP nginx stream module works with loriot. Seems like there is an issue with tektelic pico gateway and loraserver implementation.