[lvs-users] LVS-NAT setup

Prasun Bhattacharjee prasunb25 at gmail.com
Sat Aug 3 12:41:04 BST 2013

Dear all,
I am trying to setup LVS-NAT load-balancer. I am using three ubuntu
instances. Here are the instance details...
Private IP:
Public IP:
Real Server
Private IP:
Public IP:
Real Server
Private IP:
Public IP:
Now, I have configured ipvsadm in following manner...
root at ubuntutcs:~#
root at ubuntutcs:~# ipvsadm -A -u -s rr
root at ubuntutcs:~# ipvsadm -a -u -r -m
root at ubuntutcs:~# ipvsadm -a -u -r -m
Set "net.ipv4.ip_forward" to 1 in /etc/sysctl.conf file. Then I have
configured iptables for NAT.
root at ubuntutcs:~# iptables -t nat -A PREROUTING -p udp --dport 4679 -m ipvs
--vproto udp --vaddr --vport 5683 --vmethod MASQ --vportctl
root at ubuntutcs:~# iptables -t nat -A POSTROUTING -j MASQUERADE
With this configuration, I am not able to connect real servers. I have used
"tcpdump" to track packets. Here are snippet of tcpdump output on
root at ubuntutcs:~# !tcp
tcpdump -n -i any port 5683
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on any, link-type LINUX_SLL (Linux cooked), capture size 65535
14:40:09.113514 IP > UDP, length 39
14:40:09.113685 IP > UDP, length 39
14:40:23.556608 IP > UDP, length 39
14:40:23.556790 IP > UDP, length 39
It seems that packets are forwarded to the real servers, but they are not
received by real servers. I have executed "tcpdump" on real servers too,
but did not get any packets.
Please advice, do I need to configure real server?

More information about the lvs-users mailing list