How to trace the source IP behind a load balancer ?

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?



Submit an 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.

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.

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.