A lightweight service manager that controls an IP Anycast interface and dynamically updates BIRD BGP configuration based on application health checks.
This service ensures that your Anycast IP address is only advertised to the network when the underlying application service is healthy. It manages a dummy network interface and generates BIRD configuration files to announce or withdraw routes.
- Health Monitoring: Built-in health checks for common services (HTTP, HTTPS, NTP, DNS, LDAP) and support for custom check commands.
- Dynamic BGP Announcement: Automatically reconfigures BIRD to advertise the Anycast IP when healthy and withdraw it when unhealthy.
- Interface Management: Automatically creates and manages a dummy interface for the Anycast IP.
- BFD Support: Configurable BFD (Bidirectional Forwarding Detection) settings for fast failure detection.
sudo dnf install ./ip-anycast-service-*.rpmsudo dpkg -i ./ip-anycast-service_*.deb
sudo apt-get install -f # Install missing dependenciesThe main configuration file is located at /etc/ip-anycast/ip-anycast.conf.
| Parameter | Description | Example |
|---|---|---|
APP_TYPE |
Type of application to monitor (http, https, ntp, dns, ldap, custom) |
ntp |
ANYCAST_CIDR |
The Anycast IP address with CIDR prefix | 192.168.10.1/32 |
INTERFACE_NAME |
Name of the dummy interface to create | anycast0 |
| Parameter | Description | Example |
|---|---|---|
ROUTER_ID |
BGP Router ID (usually the host's physical IP) | 10.0.0.5 |
LOCAL_AS |
Local Autonomous System number | 65001 |
SOURCE_IP |
Source IP for BGP sessions | 10.0.0.5 |
NEIGHBORS |
Space-separated list of upstream neighbors (IP:AS) |
10.0.0.1:64512 10.0.0.2:64512 |
If APP_TYPE is set to custom, define your check command:
CUSTOM_CHECK_CMD="/usr/local/bin/my_check_script.sh"The command should return exit code 0 for healthy and non-zero for unhealthy.
Start and enable the service:
sudo systemctl enable --now ip-anycastCheck the status:
sudo systemctl status ip-anycastView logs:
journalctl -u ip-anycast -fbird(BIRD Internet Routing Daemon)bashiproute2systemd- Service-specific tools:
bind-utils(DNS),nmap-ncat(LDAP),chrony(NTP),curl(HTTP/HTTPS)
MIT