I use a proxy for load balancing (tcp mode, not http) want to initial TCP connection data, including the source IP address, destination IP address and port number, but receive the ip of the balancer.
Thank you very much, I read documentation. I found examples, but only for http.
Public HTTP address also used by stunnel on the same machine
frontend www
mode http
option forwardfor except 127.0.0.1 # stunnel already adds the header
Those servers want the IP Address in X-Client
backend www
mode http
option forwardfor header X-Client
backend app_8111
mode tcp
balance roundrobin
server 1 93.125.1.135:3535 check inter 30000 rise 3 fall 3 backup
server 2 85.238.98.166:3588 check inter 30000 rise 3 fall 3 weight 100
But in server1 and server2 I do not get the source IP address, in the logs only receive the ip of the balancer.
If I add a line source 0.0.0.0 usesrc client does not work
tried to do so, working, but receive the ip of the balancer.
listen 6666
mode tcp
bind *:6666
server 6666 88.49.34.119:6666
If I add a line source 0.0.0.0 usesrc client does not work
It’s not about haproxy.cfg. The haproxy.cfg is simple. Everything else is complicated: setting up your network so that the haproxy box is in the forwarding path, enabling ip forwarding, etc.
There is not shortcut to transparent proxying: either you are willing to read and understand it, or you won’t be able to do it.
It’s way simpler to setup the PROXY protocol, but it is not clear what you are forwarding and what the backend software is.
Hello i have the following topology
In IIS logs i can see the original IP address, but in the application logs i see always the haproxy loadbalancing address