1

I have a Node.JS application receiving UDP packets, which I have recently moved into a Docker container for easy deployment. The application relies on distinguishing multiple UDP streams based on the source IP (using rinfo.address on the 'message' event).

For some of these streams, the source IP is reported as 172.17.0.1, which is just the IP of the "outside" as seen from inside the Docker container.

How can I reliably get the actual origin IP of UDP packets inside a Docker container?

foucdeg
  • 111
  • 3

1 Answers1

0

I found a solution - but my understanding of it is limited.

Running sudo conntrack -D -p udp in the host apparently resets something and allows for the real origin IP addresses to be reported.

Apparently this needs to be done after any restart of the container.

Credits: https://github.com/moby/moby/issues/8795#issuecomment-64946289

foucdeg
  • 111
  • 3