# Haproxy support udp

**URL:** <https://discourse.haproxy.org/t/haproxy-support-udp/10147>\
**Category:** Help!\
**Created:** [August 19, 2024, 5:44pm UTC](https://discourse.haproxy.org/t/haproxy-support-udp/10147 "2024-08-19T17:44:03Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![mehdi05](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@mehdi05](https://discourse.haproxy.org/u/mehdi05)\
**Post date:** [August 19, 2024, 5:44pm UTC](https://discourse.haproxy.org/t/haproxy-support-udp/10147/1 "2024-08-19T17:44:03Z")

</div>

Hi,  
I wanted to know if haproxy supported udp because I’m a bit confused. I notice that on the site of you haproxy that loadbalancer udp is checked and in the forums I notice that udp is managed only at the level of syslog that’s all.  
I’d like to have more explanations on this.  
Thanks

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [August 19, 2024, 7:41pm UTC](https://discourse.haproxy.org/t/haproxy-support-udp/10147/2 "2024-08-19T19:41:21Z")

</div>

I confirm udp load balancing only works for syslog:

```
http://docs.haproxy.org/dev/configuration.html#4.2-bind

```

states:

```
            - 'udp@' -> address is resolved as IPv4 or IPv6 and
              protocol UDP is used. Currently those listeners are
              supported only in log-forward sections.

```

---

<div class="post-metadata">

**Author:** ![mehdi05](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@mehdi05](https://discourse.haproxy.org/u/mehdi05)\
**Post date:** [August 19, 2024, 9:35pm UTC](https://discourse.haproxy.org/t/haproxy-support-udp/10147/3 "2024-08-19T21:35:47Z")

</div>

Thanks, ok so I’ll try to use another solution.

---

<div class="post-metadata">

**Author:** ![mrit](https://avatars.discourse-cdn.com/v4/letter/m/e19b73/32.png) [@mrit](https://discourse.haproxy.org/u/mrit)\
**Post date:** [August 21, 2024, 7:15am UTC](https://discourse.haproxy.org/t/haproxy-support-udp/10147/4 "2024-08-21T07:15:59Z")

</div>

upd loadbalancing is only supported in the enterprise versions not in the community/opensource version

---

<div class="post-metadata">

**Author:** ![mehdi05](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@mehdi05](https://discourse.haproxy.org/u/mehdi05)\
**Post date:** [August 21, 2024, 11:31am UTC](https://discourse.haproxy.org/t/haproxy-support-udp/10147/5 "2024-08-21T11:31:14Z")

</div>

Thanks

---

<div class="post-metadata">

**Author:** ![loadbalancer](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/loadbalancer/32/521_2.png) [@loadbalancer](https://discourse.haproxy.org/u/loadbalancer)\
**Post date:** [August 26, 2024, 3:18pm UTC](https://discourse.haproxy.org/t/haproxy-support-udp/10147/6 "2024-08-26T15:18:29Z")

</div>

You can use [Linux Virtual Server](http://www.linuxvirtualserver.org/) LVS for UDP, its built into the linux kernel and is very reliable.  
But you’ll need to pair it with [Keepalived](https://www.keepalived.org/) or [Ldirectord](https://projects.horms.net/projects/ldirectord/) for health checks.

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [August 26, 2024, 5:07pm UTC](https://discourse.haproxy.org/t/haproxy-support-udp/10147/7 "2024-08-26T17:07:52Z")

</div>

Which for the record is exactly what HAPEE uses as well:

> **[Overview of the LB Layer4 tab](https://www.haproxy.com/documentation/haproxy-aloha/load-balancing/layer-4/overview/)**
>
> Get an overview of the LB Layer4 (LVS) tab in HAProxy ALOHA.

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [August 28, 2024, 8:57am UTC](https://discourse.haproxy.org/t/haproxy-support-udp/10147/8 "2024-08-28T08:57:03Z")

</div>

Also see:

> <https://github.com/haproxy/haproxy/issues/62#issuecomment-2314707114>
>
> \## Output of \`haproxy -vv\` and \`uname -a\`
> 
> \<!--
> Please add the output of hapr…oxy -vv you are currently using here, this helps us
> later to see what has changed in HAProxy when we revisit this issue after some
> time.
> 
> Put it in code blocks \`\`\`:
> \--\>
> 
> \`\`\`
> HA-Proxy version 1.8.19 2019/02/11
> Copyright 2000-2019 Willy Tarreau \<willy@haproxy.org\>
> 
> Build options :
> TARGET = linux2628
> CPU = generic
> CC = gcc
> CFLAGS = -O2 -g -fno-strict-aliasing -Wdeclaration-after-statement -fwrapv -Wno-unused-label
> OPTIONS = USE\_ZLIB=1 USE\_OPENSSL=1 USE\_PCRE=1
> 
> Default settings :
> maxconn = 2000, bufsize = 16384, maxrewrite = 1024, maxpollevents = 200
> 
> Built with OpenSSL version : OpenSSL 1.0.2k-fips 26 Jan 2017
> Running on OpenSSL version : OpenSSL 1.0.2k-fips 26 Jan 2017
> OpenSSL library supports TLS extensions : yes
> OpenSSL library supports SNI : yes
> OpenSSL library supports : SSLv3 TLSv1.0 TLSv1.1 TLSv1.2
> Built with transparent proxy support using: IP\_TRANSPARENT IPV6\_TRANSPARENT IP\_FREEBIND
> Encrypted password support via crypt(3): yes
> Built with multi-threading support.
> Built with PCRE version : 8.32 2012-11-30
> Running on PCRE version : 8.32 2012-11-30
> PCRE library supports JIT : no (USE\_PCRE\_JIT not set)
> Built with zlib version : 1.2.7
> Running on zlib version : 1.2.7
> Compression algorithms supported : identity("identity"), deflate("deflate"), raw-deflate("deflate"), gzip("gzip")
> Built with network namespace support.
> 
> Available polling systems :
> epoll : pref=300, test result OK
> poll : pref=200, test result OK
> select : pref=150, test result OK
> Total: 3 (3 usable), will use epoll.
> 
> Available filters :
> \[SPOE\] spoe
> \[COMP\] compression
> \[TRACE\] trace
> 
> 
> Linux \* 3.10.0-957.5.1.el7.x86\_64 #1 SMP Wed Dec 19 10:46:58 EST 2018 x86\_64 x86\_64 x86\_64 GNU/Linux
> 
> \`\`\`
> 
> \## What should haproxy do differently? Which functionality do you think we should add?
> 
> 
> 
> It would be amazing if HAProxy also supported loadbalancing of UDP packets.
> A good and free loadbalancer that can do this and also supports Healthchecks does not seem to exist yet.
> NGINX can loadbalance UDP, but only supports health checks in the paid version and is kinda expensive if you just need that functionality.
> 
> 
> 
> 
> \## What are you trying to do?
> 
> 
> Loadbalancing of traffic to the Graylog cluster. Syslog UDP to be more precise. Many devices don't support sending Syslog TCP packets, which is why UDP is still needed.
> And it would be great to have a UDP Loadbalancer that also checks if the device receiving the message is alive.

---

<div class="post-metadata">

**Author:** ![ipevans](https://avatars.discourse-cdn.com/v4/letter/i/b19c9b/32.png) [@ipevans](https://discourse.haproxy.org/u/ipevans)\
**Post date:** [February 19, 2025, 12:12pm UTC](https://discourse.haproxy.org/t/haproxy-support-udp/10147/9 "2025-02-19T12:12:41Z")

</div>

(Disclaimer: I work for HAProxy)

HAProxy Enterprise 2.9+ supports UDP load balancing with a native module (not via LVS). HAProxy ALOHA appliances support UDP via LVS, but will have the same native UDP module soon.

Links:

- Documentation: [Load balance UDP with HAProxy Enterprise | HAProxy Enterprise](https://www.haproxy.com/documentation/haproxy-enterprise/enterprise-modules/udp-load-balancing/)
- UDP solution information: [HAProxy UDP Load Balancing Solutions](https://www.haproxy.com/solutions/udp-load-balancing)
