# Send-proxy-v2 doesn't work when conntrack is disabled

**URL:** <https://discourse.haproxy.org/t/send-proxy-v2-doesnt-work-when-conntrack-is-disabled/6891>\
**Category:** Help!\
**Created:** [September 7, 2021, 9:07am UTC](https://discourse.haproxy.org/t/send-proxy-v2-doesnt-work-when-conntrack-is-disabled/6891 "2021-09-07T09:07:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mreymann](https://avatars.discourse-cdn.com/v4/letter/m/e99b99/32.png) [@mreymann](https://discourse.haproxy.org/u/mreymann)\
**Post date:** [September 7, 2021, 9:07am UTC](https://discourse.haproxy.org/t/send-proxy-v2-doesnt-work-when-conntrack-is-disabled/6891/1 "2021-09-07T09:07:25Z")

</div>

We have the following (working) setup:

Haproxy and our Proxy app are running on the same server. Haproxy sends requests to the Proxy app via the proxy prototcol:

```auto
listen web_proxy_app
        bind *:443 ssl crt /etc/ssl/our-certs no-sslv3
        server proxy-app /tmp/proxy.sock send-proxy-v2

```

As soon as we exclude port 443 from the conntrack table via nft like this:

```auto
chain PREROUTING_NOTRACK {
        type filter hook prerouting priority -300 policy accept
        iif VLAN1012 tcp dport { 80, 443 } notrack

```

the proxy app doesn’t receive the correct IP values:

```auto
- Proxy 2 123.123.129.3 57893 234.236.46.5 443 <--- before, good
- Proxy 2 123.123.129.3 58217 123.123.129.3 58217 <--- after, bad

```

We’d like to keep our conntrack table as small as possible. Is there a way to achieve this?

---

<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:** [September 7, 2021, 4:51pm UTC](https://discourse.haproxy.org/t/send-proxy-v2-doesnt-work-when-conntrack-is-disabled/6891/2 "2021-09-07T16:51:34Z")

</div>

This has nothing to do with haproxy at all.

When you disable conntrack and applications stop working, you’ll have to look at the firewall configuration altogether, not at the application.

---

<div class="post-metadata">

**Author:** ![mreymann](https://avatars.discourse-cdn.com/v4/letter/m/e99b99/32.png) [@mreymann](https://discourse.haproxy.org/u/mreymann)\
**Post date:** [September 13, 2021, 8:23am UTC](https://discourse.haproxy.org/t/send-proxy-v2-doesnt-work-when-conntrack-is-disabled/6891/3 "2021-09-13T08:23:48Z")

</div>

Ok, are you are 100 % sure that the conntrack table is not used by haproxy in any way? If so, I’ll direct my question to the netfilter folks.

---

<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:** [September 13, 2021, 7:30pm UTC](https://discourse.haproxy.org/t/send-proxy-v2-doesnt-work-when-conntrack-is-disabled/6891/4 "2021-09-13T19:30:31Z")

</div>

I’m sure, yes.

---

<div class="post-metadata">

**Author:** ![mreymann](https://avatars.discourse-cdn.com/v4/letter/m/e99b99/32.png) [@mreymann](https://discourse.haproxy.org/u/mreymann)\
**Post date:** [November 5, 2021, 8:29am UTC](https://discourse.haproxy.org/t/send-proxy-v2-doesnt-work-when-conntrack-is-disabled/6891/5 "2021-11-05T08:29:12Z")

</div>

For anyone running into the same problem: You also need to add a notrack rule for outgoing connections like this:

```auto
        chain OUTPUT_NOTRACK {
                type filter hook output priority raw; policy accept;
                oif "VLAN1012" tcp sport { 80, 443 } counter notrack
        }

```

Afterwards, everything works as desired.  
Strangely enough, this issue was only present for port 443. Port 80 seems to be handled differently by haproxy and didn’t need this rule to work.

---

<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:** [November 5, 2021, 11:09am UTC](https://discourse.haproxy.org/t/send-proxy-v2-doesnt-work-when-conntrack-is-disabled/6891/6 "2021-11-05T11:09:59Z")

</div>

Haproxy works with sockets in a straightforward way, there is no special handling for specific ports or anything like that.

iptables/nftables can be complex beasts, but this has nothing to do with haproxy.
