How to configure transparent mode for load balancer in mitaka?

asked 2016-08-30 04:31:12 -0500

ashokt gravatar image

updated 2016-08-30 10:30:52 -0500

sunnyarora gravatar image

I have created LB+Autoscaling on a subnet, LB is configured to receive and balance TCP packets on port 3306 (though this is mysql port), From another subnet, I am sending TCP packets to LB IP address on port 3306. Here, LB is forwarding packets to pool members, but the source IP address is LB’s IP address when we see the packet in pool member machines.

Here is my haproxy.cfg config details: ‘’ is my LB VIP. Please let me know what configuration I need to do, so that source IP address is not modified.

        log /dev/log    local0
        log /dev/log    local1 notice
        chroot /var/lib/haproxy
        stats socket /run/haproxy/admin.sock mode 660 level admin
        stats timeout 30s

        log     global
        mode    tcp
        option  tcplog

frontend tcpserver
        bind transparent
        mode tcp
        default_backend nodes

backend nodes
        mode    tcp
        option tcplog
        option ssl-hello-chk
        option http-keep-alive
        balance roundrobin
        source usesrc clientip
        stick-table type ip size 20k expire 15m
        stick on src
        server web01 check
        server web02 check
        server web03 check
        server web04 check
        server web05 check
        server web06 check
        server web07 check
        server web08 check
        server web09 check
        server web010 check
        timeout server 1m
        timeout connect 1m
        timeout client 5m

Please help on this?

edit retag flag offensive close merge delete