LAN network translated to Rancher network

Hello there,

I have a cluster of 8 k3S nodes managed by Rancher (version 2.10.1)
All my services are well working thru Ingress or Load Balancers

But I noticed that when a service receives a connection, the IP address of the client is not its own address, but an address from Rancher’s network (10.42.0.0/16)

I would to know if it possible for the pod to know the real ip address of the source of the connection?
(I found nothing about that in the documentation)

Thanks for your help

@ppcm this depends on your Ingress. Response is assuming your using traefik as its the default ingress for K3s. Check and/or add/edit the config.yaml for traefik and add use-proxy-protocol: "true". That should keep the source ip in the logs.

@meza Thanks for the answer, but in the config for traefik, I don’t have a line with use-proxy-protocol
I found something else, I don’t if it is the best way:
I modify the config of the loadbalancer associated with my workload, by changing externalTrafficPolicy: Cluster to externalTrafficPolicy: Local
Now when the request lands directly to the server node hosting the pod, the external IP is exposed, but if the request lands on another node, the Ip of the node is exposed

But I would to have only the external IP exposed whatever the node on which the request lands