I've installed keepalived IP failover software as described here. But how do I verify it is working or not?
By default keepalived uses 224.0.0.18 IP address for VRRP (Virtual Router Redundancy Protocol) for communication between two nodes for health check. All you have to do is run tcpdump as follows on eth0 (or eth1) to make sure communication is established:
tcpdump -v -i eth0 host 224.0.0.18
tcpdump -vvv -n -i eth0 host 224.0.0.18
Sample outputs:
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes 16:54:01.743275 IP (tos 0x0, ttl 255, id 451, offset 0, flags [none], proto: VRRP (112), length: 96) 10.10.28.5 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 103, authtype simple, intvl 1s, length 76, addrs(15): 123.12.15.2,123.12.15.3[|vrrp] 16:54:02.744241 IP (tos 0x0, ttl 255, id 452, offset 0, flags [none], proto: VRRP (112), length: 96) 10.10.28.5 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 103, authtype simple, intvl 1s, length 76, addrs(15): 123.12.15.2,123.12.15.3[|vrrp]
Where,
- 10.10.28.5 - your eth0 ip.
- 123.12.15.2 and 123.12.15.3 - Virtual IPs manage by keepalived.
- 224.0.0.18 - multicast request.
If you do not see any communication, than make sure keepalived service started on both nodes:
# service keepalived status
# service keepalived start
Make sure firewall is configured to accept accept multicast and vrrp protocol (IP Protocol # 112):
# /sbin/iptables -I INPUT -i eth0 -d 224.0.0.0/8 -j ACCEPT
# /sbin/iptables -A INPUT -p 112 -i eth0 -j ACCEPT
# /sbin/iptables -A OUTPUT -p 112 -o eth0 -j ACCEPT
# /sbin/service iptables save
Adjust above rules as per your interface and other requirements.
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop














{ 3 comments… read them below or add one }
instead of “# /sbin/iptables -I INPUT -i eth0 -d 224.0.0.0/8 -j ACCEPT”, I believe It should be “# /sbin/iptables -I INPUT -i eth0 -s 224.0.0.0/8 -j ACCEPT”, Please validate once and confirm.
no, just /sbin/iptables -I INPUT -i eth0 -d 224.0.0.0/8 -j ACCEPT!
Thanks a lot. It was very helpful!