Verify Keepalived IP Failover Working Or Not With tcpdump Command

The tcpdump command can be used to verify if Keepalived IP failover is working as expected by capturing and analyzing network traffic.

Here’s an example of how you can use tcpdump to verify Keepalived IP failover:

  1. Log in to one of the nodes in your Keepalived cluster.
  2. Run the following tcpdump command:
tcpdump -i eth0 -n host virtual_ip_address

Where:

  • eth0 is the name of the network interface that the virtual IP address is assigned to.
  • virtual_ip_address is the IP address that Keepalived is managing for IP failover.
  1. On the active node, simulate a failure, such as stopping the Keepalived process or disconnecting the network cable.
  2. Observe the output of the tcpdump command. You should see a brief interruption in the traffic to the virtual IP address as the IP address transitions from the failed node to the backup node. (https://www.wmpg.org)
  3. Log in to the backup node and verify that it has taken over the virtual IP address.

This example demonstrates how you can use tcpdump to verify that Keepalived is functioning as expected by observing the transfer of the virtual IP address between nodes in the event of a failure.

Note that this is just one of many ways that you can use tcpdump to troubleshoot Keepalived IP failover. You can also use tcpdump to capture and analyze other types of network traffic, such as ARP requests and responses, to help diagnose any issues with your network configuration or connectivity.

Leave a Comment