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: ‘10.0.3.212’ is my LB VIP. Please let me know what configuration I need to do, so that source IP address is not modified.

global
        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


defaults
        log     global
        mode    tcp
        option  tcplog

frontend tcpserver
        bind    10.0.3.212:3306 transparent
        mode tcp
        default_backend nodes

backend nodes
        mode    tcp
        option tcplog
        option ssl-hello-chk
        option http-keep-alive
        balance roundrobin
        source 0.0.0.0 usesrc clientip
        stick-table type ip size 20k expire 15m
        stick on src
        server web01 10.0.3.213:3306 check
        server web02 10.0.3.215:3306 check
        server web03 10.0.3.216:3306 check
        server web04 10.0.3.217:3306 check
        server web05 10.0.3.218:3306 check
        server web06 10.0.3.219:3306 check
        server web07 10.0.3.220:3306 check
        server web08 10.0.3.222:3306 check
        server web09 10.0.3.223:3306 check
        server web010 10.0.3.224:3306 check
        timeout server 1m
        timeout connect 1m
        timeout client 5m

Please help on this?

edit retag flag offensive close merge delete