Verify Keepalived IP Failover Working Or Not With tcpdump Command

Verify Keepalived IP Failover Working Or Not With tcpdump Command

Keepalived is a Linux daemon that provides failover and load balancing for IP addresses. You can use the tcpdump command to verify that Keepalived is working properly and to diagnose any issues with the failover or load balancing.

To verify Keepalived IP failover with tcpdump, you can follow these steps:

  1. On the active Keepalived server, run the tcpdump command to capture the traffic on the virtual IP address that is being managed by Keepalived. For example:
‮:ot refer‬lautturi.com
tcpdump -n -i <interface> host <virtual-ip>

This will capture the traffic on the specified <interface> that is destined for the <virtual-ip> address. The -n option disables name resolution, and the -i option specifies the interface to capture.

  1. On the passive Keepalived server, run the same tcpdump command to capture the traffic on the virtual IP address.

  2. On the client system, send traffic to the virtual IP address. This can include sending a ping request, connecting to a service, or running any other type of traffic that is expected to reach the virtual IP address.

  3. Observe the output of the tcpdump command on the active and passive Keepalived servers. If the virtual IP address is working properly, you should see the traffic on the active server and not on the passive server.

  4. If you want to test the failover, you can stop the Keepalived daemon on the active server or simulate a failure of the active server. This should cause the virtual IP address to failover to the passive server.

  5. Observe the output of the tcpdump command on the active and passive Keepalived servers. If the failover is working properly, you should see the traffic on the passive server and not on the active server.

By using tcpdump to capture and analyze the traffic on the virtual IP address, you can verify that Keepalived is working properly and troubleshoot any issues with the failover or load balancing.

Keep in mind that tcpdump is a powerful and flexible tool, and there are many other options and techniques that you can use to capture and analyze the traffic. You may want to refer to the tcpdump man page or online documentation for more information.

Created Time:2017-10-30 14:27:31  Author:lautturi