How as400671/server-config works
Main Components
• BIRD Routing Service:
• The “bird” directory holds multiple configuration files (inside basic and bgp) for controlling BGP connections and various routing policies.
• It includes configuration for standard Bird operation plus support for RPKI checks and BGP Large Communities.
• GRETP Tunneling:
• Found in the “gretap” folder, these scripts are used to manage GRE tunneling connections (critical for interconnect stability).
• API/Web Interface:
• The “html” folder contains PHP scripts (api.php) and the front-facing web pages (index.html, robots.txt) that serve as an interface for the network dashboard.
• Technologies include PHP and a recommended webserver (Caddy or alternatives).
• Cron / Scheduled Tasks:
• The “cron” folder holds Python scripts for connectivity checks and likely other periodic checks regarding IXP connectivity and BGP status.
• Network and Environment:
• The README emphasizes that all inbound/outbound network connections use WireGuard (wg0 interface) and that several external tools (stayrtr, rpki-client, bgpq4, tcpdump/Wireshark) are important for proper operation and debugging.
Relationships and Interactions
• The BIRD daemon is the core component handling BGP routing. It interacts with various configuration files that define routing rules, filters, constants, and environment variables.
• Before or after (re)starting the Bird daemon, GRETP scripts are executed to reset and establish GRE tunnel connections, ensuring link stability.
• The API layer (PHP in the “html” directory) serves external requests by interfacing with Bird’s configuration data. This API feeds data to a network dashboard, effectively bridging the configuration layer and the monitoring/visualization components.
• Cron jobs (Python scripts in the “cron” folder) periodically perform connectivity checks and potentially crawl interconnected IXPs and peers, feeding back data into the system.
• Overall, the system is governed by network layer rules – particularly enforced via WireGuard for all traffic routing, ensuring secure and reliable operations.
Architectural Patterns and Design Principles
• Separation of Concerns:
• Each folder targets a different aspect of the system (routing, tunneling, API, scheduling).
• Modular Design:
• By having all configuration files modularly placed within “basic” and “bgp” subdirectories and separate tooling (a dedicated scripts folder for upgrades and GRETP tunneling), the system facilitates easy updates and extensions.
• Interaction via Well-Defined Interfaces:
• For example, the web API serves as an interface between the Bird daemon’s operations and an external system (the dashboard).
Additional Notes
• Even though the overall system isn’t overly large, break it down into distinct parts (configuration for BIRD, cron operations, web API) to better reflect modularity and design.