I follow the steps to set up load balances like:
$ sudo ipvsadm -A -t 127.0.0.1:8301 -s rr
$ sudo ipvsadm -a -t 127.0.0.1:8301 -r 127.0.0.1:8310 -m
In Ubuntu 14.04, kernel 3.13.0-44-generic #73-Ubuntu, ipvsadm v1.2.6 2008/5/15:
$ sudo ipvsadm
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP localhost:8301 rr
-> localhost:8310 **Masq** 1 0 0
But in CentOS 6, kernel 2.6.32-504.3.3.el6.x86_64, ipvsadm v1.2.6 2008/5/15:
$ sudo ipvsadm
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP localhost:amberon rr
-> localhost:8310 **Local** 1 0 0
Is there any difference between masquerading and local?
How can I set forward to masquerading since -m
doesn't work as expected in CentOS?
Update:
When I nc -l 8310
and open another terminal telnet localhost 8301
, CentOS returns Connection refused
while Ubuntu works fine.