Is TPROXY compatible with conntrack?
Environment
Red Hat Enterprise Linux
Issue
I am using TPROXY. Can I use conntrack too?
Resolution
Either make use of NOTRACK features to avoid confusing conntrack, or upgrade to RHEL 7 and setup conntrack zones properly.
Root Cause
It depends on what are you going to use conntrack for. Conntrack uses the 5-tuple (src host, src port, dst host, dst port, protocol) to identify a connection. On TPROXY environments, this may be duplicated if you consider both sides of TPROXY. That's where the issue lies within: the 5-tuple is the same and cannot be duplicated, therefore you can track only one side of the system.
RHEL 7 adds support for (conntrack zones)[https://access.redhat.com/site/solutions/156413]. With it, you may duplicate the 5-tuple because it adds a 6th element to that hash: the zone number, a number you choose and give via iptables matches. You may only track all your connections when properly using conntrack zones.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
