Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to find a problem server hiding behind a virtual IP (using LVS/ipvs). I've got a test program that sends requests to the virtual IP until it gets the bad response, but how can I tell to which real IP a request to the virtual IP got routed?

On the box doing the virtual IP magic, here's the virtual IP configuration (for the service I care about):

IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
  -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP nq
  ->                Route   1      0          1         
  ->                Route   1      0          5         
  ->                Route   1      0          2         
  ->                Local   1      0          3         
  ->               Route   1      0          3         

My client program is sending TCP requests to, usually getting a good response but sometimes a bad response. With this few servers, I could send my request to each server in turn until I discover the culprit, but I wonder if that technique will scale as we add servers. What means exist for me to find out where requests got routed?

  • Kernel: Linux 2.6.32
  • OS: Debian testing (whatever that's called these days).
  • ipvsadm is version 1.25, compiled with ipvs v1.2.1
share|improve this question
up vote 1 down vote accepted

This is quite a typical problem with IPVS/ldirectord, you have several options to try to resolve this

  • Check logging on the destination servers looking for the request (not very accurate but most of the time it'll cover the bill)
  • If your destination server replies with headers (like apache or ftp) just add a new custom header like X-Served-by or some hint in the welcome header
  • Activate logging on ldirectord, the logging is a bit obscure but I'm pretty sure it'll be useful, just add to your logfile="/var/log/ldirectord.log" in the global options
share|improve this answer
We don't appear to have an ldirectord. keepalived, we got. In any case, although our servers don't currently reply with headers, the protocol is under our control so we can add any headers we like. I don't know why we didn't think of that before. Thanks! – Wayne Conrad Feb 2 '11 at 5:38

ipvsadm -Lcn on the LB (aka "director") should list your connections. Grep for the IP you are searching.

share|improve this answer
Outstanding. Thanks! – Wayne Conrad Sep 21 '11 at 20:31

You best bet would be to rn tcpdump on the real servers to see where you request is going.

Gotcha. LVS-TUN listen on the on the virtual interface for the client address because the packets are encapsulated you wouldn't be able to identify the packet based on users IP

$ tcpdump -i tunl0 host USER_IP

share|improve this answer
Thanks. The IPVS box has a tunl0 device, but it's not up. ifup tunl0 reports "Ignoring unknown interface tunl0=tunl0". – Wayne Conrad Dec 21 '10 at 21:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.