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:
- Log in to one of the nodes in your Keepalived cluster.
- 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.
- On the active node, simulate a failure, such as stopping the Keepalived process or disconnecting the network cable.
- 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) - 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.