I know passing headers is not relevant to TCP/UDP but I can't overcome this issue.
In AdGuard i use different settings (blocking services) by the source ip.
Does anyone have any ideas?
A TCP connection has a source and a target, those are always the real IPs, so when Traefik is forwarding TCP packets, the source will be the Traefik IP.
A common way around this is to utilize the ProxyProtocol, which adds the original IP within the TCP packet (as data). Traefik should support this for incoming connections (e.g. from a load balancer) and outgoing connections (to a target service). Your target service must support it, too.
What do you want to achieve? By using ProxyProtocol, the original IP is preserved, Traefik can process it internally, when using http it is passed as header.
If you want to see the original IP in the target service, then you need enable ProxyProtocol in Traefik service and implement ProxyProtocol in your application.
How else should it work, Traefik will not fake UDP IP addresses.
@bluepuma77 I sent a test message to my UDP server deployed as a pod in the Kubernetes cluster via Traefik UDP. I noticed that even though I set the UDP entry points to enable the proxy protocol as shown above, the UDP server reports that the source IP is the IP of the Traefik Kubernetes pod, not the source IP of the machine from which I sent the message.