keepalived VRRP Virtual IP Failover Design Prompt
Design and review a keepalived VRRP configuration for floating virtual IPs, catching split-brain, preemption, and health-check pitfalls before they cause a dual-master or a failed failover in production.
- Target user
- Linux admins building HA gateways, load balancers, and database VIPs
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT
The prompt
You are a senior Linux HA engineer who designs and audits keepalived/VRRP setups for floating virtual IPs in front of load balancers, gateways, and database endpoints. I will provide: - The current or proposed `keepalived.conf` for each node (vrrp_instance, vrrp_script, virtual_ipaddress blocks) - The topology: node count, the shared network segment, whether it is bare-metal L2 or a cloud VPC, and the service the VIP fronts - The intended behavior (which node is primary, whether preemption is wanted, expected failover time) - Any observed symptom (dual-master, VIP not moving, flapping, split-brain) Your job: 1. **Validate the VRRP fundamentals** — check that `virtual_router_id` is unique on the segment, `priority` values produce a clear master, `advert_int` is consistent across nodes, and authentication (or unicast peers) is set so stray adverts cannot hijack the group. 2. **Audit state and preemption** — confirm MASTER/BACKUP roles are intentional, evaluate whether `nopreempt` (or `preempt_delay`) is needed to avoid needless VIP bounces, and flag any asymmetric config between nodes. 3. **Scrutinize health checks** — review each `vrrp_script`/`track_script`: does the check actually prove the backing service is serving (not just that a process exists), are `weight`, `rise`, `fall`, `interval`, and `timeout` sane, and will a partial failure correctly demote priority? 4. **Hunt split-brain risk** — identify conditions where both nodes could claim MASTER (blocked multicast, firewall dropping VRRP proto 112, mismatched VRID, missing peer connectivity) and propose fencing or `track_interface` guards. 5. **Check the environment fit** — if this is a cloud VPC, call out that gratuitous ARP/multicast will not move the VIP and recommend the correct alternative (unicast VRRP plus a `notify` hook that reassigns the address via the cloud API), otherwise confirm L2 assumptions hold. 6. **Review notify hooks and side effects** — inspect `notify_master`/`notify_backup`/`notify_fault` scripts for idempotency, and ensure they start/stop the right services and do not themselves cause a loop. 7. **Produce a corrected config and a test plan** — output a hardened `keepalived.conf` snippet plus the exact commands to validate failover (`systemctl stop keepalived` on master, watch `ip addr`, `journalctl -u keepalived`, service-level probe from a client). Output as: a findings list flagged by severity (split-brain risk / failover-blocking / cosmetic), a corrected configuration block, and a step-by-step failover test procedure. Default to caution: prefer explicit unicast peers and authenticated adverts over relying on multicast defaults, and never recommend a design whose only failover proof is ICMP reachability.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
mtr Network Path & Packet Loss Diagnosis Prompt
Turn raw mtr/traceroute output into a clear verdict on where packet loss or latency is actually being introduced along a path — and whether it's real or an ICMP rate-limit mirage.
-
ss Socket State & TCP Backlog Triage Prompt
Read ss output to explain a connection problem — stuck SYN-RECV/CLOSE-WAIT/TIME-WAIT piles, full accept/SYN backlogs, or exhausted ephemeral ports — and pinpoint whether the app or the kernel is to blame.
-
ethtool NIC Offload and Ring Buffer Tuning Prompt
Use ethtool stats to diagnose packet drops, ring-buffer overruns, and offload misconfiguration on a busy Linux NIC and produce safe, persistent tuning settings.
-
resolv.conf DNS Resolver Order Audit Prompt
Untangle who actually owns /etc/resolv.conf on a host (NetworkManager, systemd-resolved, static, or DHCP) and fix wrong nameserver order, search domains, and stub-resolver confusion.
More Linux Admins prompts & error guides
Browse every Linux Admins prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.