-
Notifications
You must be signed in to change notification settings - Fork 462
Environment Variables
ExaBGP can be configured using environment variables, providing an alternative to command-line arguments and allowing easy integration with containerized deployments.
Environment variables in ExaBGP follow the naming convention:
exabgp.<section>.<option>
For example:
-
exabgp.daemon.daemonize- Run as daemon -
exabgp.api.ack- Enable API acknowledgments -
exabgp.log.level- Set log level
exabgp.daemon.daemonize
-
Type: Boolean (
true/false) -
Default:
false - Description: Run ExaBGP as a background daemon
export exabgp.daemon.daemonize=trueexabgp.daemon.pid
- Type: String (file path)
- Default: None
- Description: PID file location
export exabgp.daemon.pid=/var/run/exabgp.pidexabgp.daemon.user
- Type: String (username)
- Default: Current user
- Description: User to run ExaBGP as (requires root)
export exabgp.daemon.user=exabgpexabgp.api.ack
-
Type: Boolean (
true/false) -
Default:
true - Description: Enable API command acknowledgments
-
Note: Can also be controlled at runtime with
enable-ack/disable-ackcommands (5.x/main)
export exabgp.api.ack=true # Enable ACK (default)
export exabgp.api.ack=false # Disable ACK (fire-and-forget mode)exabgp.api.encoder
-
Type: String (
text/json) -
Default:
text - Description: API message encoding format
export exabgp.api.encoder=json # Use JSON format
export exabgp.api.encoder=text # Use text format (default)exabgp.log.level
- Type: String
-
Values:
DEBUG,INFO,WARNING,ERROR,CRITICAL -
Default:
INFO - Description: Minimum log level to display
export exabgp.log.level=DEBUG # Verbose logging
export exabgp.log.level=WARNING # Warnings and errors onlyexabgp.log.destination
-
Type: String (file path or
stdout/stderr/syslog) -
Default:
stdout - Description: Where to send log output
export exabgp.log.destination=/var/log/exabgp.log
export exabgp.log.destination=syslogexabgp.log.packets
-
Type: Boolean (
true/false) -
Default:
false - Description: Log BGP packets for debugging
export exabgp.log.packets=true # Enable packet logging (verbose!)exabgp.log.routes
-
Type: Boolean (
true/false) -
Default:
false - Description: Log route updates
export exabgp.log.routes=true # Log all route changesexabgp.bgp.openwait
- Type: Integer (seconds)
-
Default:
60 - Description: How long to wait for BGP OPEN message
export exabgp.bgp.openwait=30exabgp.tcp.bind
- Type: String (IP address)
- Default: Empty (bind to all)
- Description: Local IP address to bind to
export exabgp.tcp.bind=192.168.1.10exabgp.tcp.port
- Type: Integer
-
Default:
179 - Description: TCP port for BGP (requires root for port < 1024)
export exabgp.tcp.port=1179 # Non-privileged portexabgp.cache.attributes
-
Type: Boolean (
true/false) -
Default:
true - Description: Cache BGP attributes for memory efficiency
exabgp.cache.nexthops
-
Type: Boolean (
true/false) -
Default:
true - Description: Cache next-hop information
exabgp.reactor.speed
- Type: Float (seconds)
-
Default:
1.0 - Description: Main event loop sleep time
Environment variables are particularly useful in Docker/Kubernetes deployments:
Docker Compose example:
version: '3'
services:
exabgp:
image: exabgp/exabgp:latest
environment:
- exabgp.daemon.daemonize=false
- exabgp.log.level=INFO
- exabgp.log.destination=stdout
- exabgp.api.ack=true
- exabgp.api.encoder=json
volumes:
- ./exabgp.conf:/etc/exabgp/exabgp.conf
- ./run:/etc/exabgp/runKubernetes ConfigMap:
apiVersion: v1
kind: ConfigMap
metadata:
name: exabgp-env
data:
exabgp.daemon.daemonize: "false"
exabgp.log.level: "INFO"
exabgp.api.encoder: "json"#!/bin/bash
# Production ExaBGP with logging and ACK enabled
export exabgp.daemon.daemonize=true
export exabgp.daemon.pid=/var/run/exabgp.pid
export exabgp.daemon.user=exabgp
export exabgp.log.level=INFO
export exabgp.log.destination=/var/log/exabgp.log
export exabgp.log.routes=true
export exabgp.api.ack=true
export exabgp.api.encoder=text
exabgp /etc/exabgp/exabgp.conf#!/bin/bash
# Debug mode with verbose logging
export exabgp.daemon.daemonize=false
export exabgp.log.level=DEBUG
export exabgp.log.destination=stdout
export exabgp.log.packets=true
export exabgp.log.routes=true
export exabgp.api.ack=true
export exabgp.api.encoder=json
exabgp /etc/exabgp/exabgp.conf#!/bin/bash
# Minimal configuration for simple API programs
export exabgp.daemon.daemonize=false
export exabgp.log.level=WARNING
export exabgp.api.ack=false # No ACK responses
exabgp /etc/exabgp/exabgp.conf#!/bin/bash
# Optimized for performance
export exabgp.cache.attributes=true
export exabgp.cache.nexthops=true
export exabgp.reactor.speed=0.5
export exabgp.log.level=WARNING
export exabgp.log.routes=false
exabgp /etc/exabgp/exabgp.conf- Configuration Syntax - Configuration file format
- Directives Reference - All configuration directives
- Process Configuration - Process directive details
- API Overview - API programming guide
- Production Best Practices - Production deployment
- Debugging - Troubleshooting guide
- Monitoring - Production monitoring
- Log Analysis - Log file analysis
- Docker - Docker deployment
- Kubernetes - Kubernetes integration
π» Ghost written by Claude (Anthropic AI)
π Home
π Getting Started
π§ API
π‘οΈ Use Cases
π Address Families
βοΈ Configuration
π Operations
π Reference
- Architecture
- BGP State Machine
- Communities (RFC)
- Extended Communities
- BGP Ecosystem
- Capabilities (AFI/SAFI)
- RFC Support
π Migration
π Community
π External
- GitHub Repo β
- Slack β
- Issues β
π» Ghost written by Claude (Anthropic AI)