Find actual IPv4 for external hosts?

I’m using Docker CE for Mac Version 17.09.0-ce-rc3-mac30 (19329); Channel: edge; 68d0b2019b on macOS 10.12.6

I have a container that listens on port 2055 (netflow) for data from external hosts. I would like to be able to send (SNMP) requests back to the host to get more information about them. The container also has a web interface, that I successfully access using the address of my host machine

My problem: All data packets arrive from an external address of 172.17.0.1. There’s no way to send requests back to those senders.

My questions:

  • Is there a way to configure/run my docker instance so that the data arriving comes from the actual sender’s address?

  • If so, how do I determine the external address of my docker container? (Will it still be the address of the host machine?)

Try out these steps in the blog - https://dev.to/bufferings/access-host-from-a-docker-container-4099

Thanks for this response. Unfortunately, unless I misunderstand your note, you seem to be solving the opposite of my problem.

I have a process running in the Docker container that receives (UDP) packets from outside. I want to know the true IP address of the external host(s) (not the 172.17.0.1 that Docker assigns) so that my process can send responses to those hosts. Thanks again.