# AWS EKS Traefik UDP Load Balancer

**URL:** <https://community.traefik.io/t/aws-eks-traefik-udp-load-balancer/14616>\
**Category:** Traefik v2\
**Tags:** kubernetes-ingress\
**Created:** [May 30, 2022, 12:11pm UTC](https://community.traefik.io/t/aws-eks-traefik-udp-load-balancer/14616 "2022-05-30T12:11:29Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![tothalex](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/tothalex/32/5332_2.png) [@tothalex](https://community.traefik.io/u/tothalex)\
**Post date:** [May 30, 2022, 12:11pm UTC](https://community.traefik.io/t/aws-eks-traefik-udp-load-balancer/14616/1 "2022-05-30T12:11:29Z")

</div>

Hi!

I set up an eks in aws, I installed the traefik via helm charts, and I also added the nlb annotation to the UDP load balancer to make it work. There's a service listening to the UDP packets and it does, it's receiving the packet but with the wrong IP.

My question is that how can I configure the traefik UDP load balancer to forward the real IP of the client?

---

<div class="post-metadata">

**Author:** ![douglasdtm](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/douglasdtm/32/2002_2.png) [@douglasdtm](https://community.traefik.io/u/douglasdtm)\
**Post date:** [May 30, 2022, 8:15pm UTC](https://community.traefik.io/t/aws-eks-traefik-udp-load-balancer/14616/2 "2022-05-30T20:15:17Z")

</div>

Hi @tothalex

Can you confirm the address that Traefik is receiving is the real client source address?

Getting the correct IP address as the client source on incoming connections usually involves some configuration before Traefik to work properly, mainly on any load balancer / proxy that might be in front of it.

As an example for Kubernetes cloud providers its often required to set the `service.spec.externalTrafficPolicy` to `Local` to avoid being NATed on the load balancer provisioned by the cluster, see [Using Source IP | Kubernetes](https://kubernetes.io/docs/tutorials/services/source-ip/#source-ip-for-services-with-type-loadbalancer)

---

<div class="post-metadata">

**Author:** ![tothalex](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/tothalex/32/5332_2.png) [@tothalex](https://community.traefik.io/u/tothalex)\
**Post date:** [May 31, 2022, 6:40am UTC](https://community.traefik.io/t/aws-eks-traefik-udp-load-balancer/14616/3 "2022-05-31T06:40:59Z")

</div>

@douglasdtm is there a way to check what IP the traefik is receiving? Here is the repo btw [GitHub - tothalex/cluster](https://github.com/tothalex/cluster)

---

<div class="post-metadata">

**Author:** ![tothalex](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/tothalex/32/5332_2.png) [@tothalex](https://community.traefik.io/u/tothalex)\
**Post date:** [May 31, 2022, 7:33am UTC](https://community.traefik.io/t/aws-eks-traefik-udp-load-balancer/14616/4 "2022-05-31T07:33:49Z")

</div>

I mean is there a way to log out the received messages in the traefik-udp service? I tried turning on the logging on info level but I can see only the HTTP logs but not any udp packet-related log.

---

<div class="post-metadata">

**Author:** ![tothalex](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/tothalex/32/5332_2.png) [@tothalex](https://community.traefik.io/u/tothalex)\
**Post date:** [May 31, 2022, 9:28am UTC](https://community.traefik.io/t/aws-eks-traefik-udp-load-balancer/14616/5 "2022-05-31T09:28:33Z")

</div>

Apparently, I found out that the aws nlb by default using the client ip, so I believe the issue is between traefik and the pod. [Target groups for your Network Load Balancers - Elastic Load Balancing](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html#client-ip-preservation)

---

<div class="post-metadata">

**Author:** ![douglasdtm](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/douglasdtm/32/2002_2.png) [@douglasdtm](https://community.traefik.io/u/douglasdtm)\
**Post date:** [June 1, 2022, 7:08pm UTC](https://community.traefik.io/t/aws-eks-traefik-udp-load-balancer/14616/6 "2022-06-01T19:08:20Z")

</div>

usually there is access logs to show what is incoming but to be honest I don't remember if the functionality shows anything useful or anything at all for UDP connections.

if you identified that the NLB uses the correct client IP than its probably a matter of letting Traefik know there is another load balancer in front of it and that it should trust it.

On TCP you can rely on enabling the proxy protocol on the entrypoint, reference [here](https://doc.traefik.io/traefik/routing/entrypoints/#proxyprotocol)  
For HTTP there is also the option to just trust `X-Forwarded-*` headers, reference [here](https://doc.traefik.io/traefik/routing/entrypoints/#forwarded-headers)

Unfortunately for UDP we still don't support proxy protocol, tracked on [this issue](https://github.com/traefik/traefik/issues/8613), and that might explain why you're just seeing the Traefik IP

---

<div class="post-metadata">

**Author:** ![tothalex](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/tothalex/32/5332_2.png) [@tothalex](https://community.traefik.io/u/tothalex)\
**Post date:** [June 2, 2022, 7:03am UTC](https://community.traefik.io/t/aws-eks-traefik-udp-load-balancer/14616/7 "2022-06-02T07:03:41Z")

</div>

@douglasdtm It's weird I managed to solve it with proxy\_protocol.v2, but I'm confused about how the traefik works together with nlb, the load balancing might happen somehow without traefik. We decided to move on without traefik we experienced no difference with/without traefik.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/containo/original/2X/b/bd81ebdb578656e76e56ff3cc3eed021d3ba132d.png) [@system](https://community.traefik.io/u/system)\
**Post date:** [June 5, 2022, 7:04am UTC](https://community.traefik.io/t/aws-eks-traefik-udp-load-balancer/14616/8 "2022-06-05T07:04:25Z")

</div>

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
