Report this

What is the reason for this report?

How to trace the source IP behind a load balancer ?

Posted on October 14, 2020

I’ve set up a rabbitmq cluster in a k8s cluster, and published with a k8s service of type LoadBalancer. So the load balancer got created, and everything works. All connections to the rabbitmq server come from the k8s node IP. How can I trace back to the real IP of the requests?

Thanks.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

You can determine the IP addresses associated with an internal load balancer or an internet-facing load balancer by resolving the DNS name of the load balancer. These are the IP addresses where the clients should send the requests that are destined for the load balancer. However, Classic Load Balancers and Application Load Balancers use the private IP addresses associated with their elastic network interfaces as the source IP address for requests forwarded to your web servers. For Network Load Balancers, the source IP address of these requests depends on the configuration of its target group.

I found the solution enabling PROXY PROTOCOL on both DO Load Balancer and the rabbitmq server. Now client IPs are forwarded in clear to rabbitmq.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.