My application is running on a TCP port and exposed via Traefik ingress crd. I have created a ingresstcp router in which I have added proxy protocol. Below is my configuration
My application is having support for proxy protocol. It will detect the original source IP from Proxy protocol header. But every time I am getting Traefik IP in my application logs and tcp dump also. Proxy protocol is not working in Traefik. Please help.
Use 3 backticks in front and after the code to format it, or select the code and press the </> button.
Are you running a current Traefik version? It seems it's only supported since v2.4 (doc).
Of course TCPdump will show the Traefik IP because this is where the packet came from. But when ProxyProtocol is active, you will see the originating IP in the content of the packet.
I tried with Traefik v2.9 and it is working fine. We are getting original source IP. But we are not getting error also in Traefik v2.3 that proxy protocol is not supported.
I am using Traefik ingress controller and routing the TCP request to my application that is having proxy protocol support. But I am getting same IP every time as original source IP even I am executing the request from different hosts. It looks like a subnet IP. I am using Traefik v2.9
Below are Traefik debug logs related to proxy protocol
time="2023-07-24T05:15:13Z" level=debug msg="Handling connection from 10.x.0.0:2787 to 10.x.x.123:9090"
original source IP is coming always 10.x.0.0. Is it K8 cluster subnet IP or something? I should get the original source IP from where I am executing the request.
I am sending a TCP message that will not come in access log. I am getting Kubernetes cluster CIDR IP as original source IP. Why I am getting CIDR IP in proxy protocol? Do I need to add Trusted IP's in entry point proxy protocol configuration?
Below is my logs at my application side and traefik logs
Traefik debug logs
time="2023-07-24T10:50:15Z" level=debug msg="Handling connection from 10.244.0.0:59657 to 10.x.43.123:9090"
Stil getting original source IP as Kubernetes Cluster IP only
time="2023-07-24T12:29:53Z" level=debug msg="Handling connection from 10.244.0.0:20566 to 10.244.3.205:9090"
time="2023-07-24T12:29:53Z" level=debug msg="Error while setting deadline: set tcp 10.244.3.207:51840: use of closed network connection"
Any solution to this issue? Traefik is getting client IP as Kubernets cluster CIDR IP 10.244.0.0. Not getting original soruce IP from where the request is originating.