BGP Configurations for Tor Relay Servers

By 1AEO Team • May 1, 2025

Supercharge your Tor relay deployments with turnkey BGP configs that take you from zero to announced in minutes

The TorBGPConfigs repository provides a reference collection of BGP configuration files to announce your Autonomous System Number (ASN) and IP address ranges for Tor relay servers across different upstream providers.

BGP Server Configuration Files

Common Variables

Common BGP Commands

Show BGP Unicast Summary

sudo vtysh -c "show bgp ipv4 unicast summary"

Displays a summary of all BGP routes along with peer states.

Show Detailed Routing Information for an IP Prefix

sudo vtysh -c "show bgp ipv4 unicast xxx.xxx.xxx.0/24"

Provides detailed routing information for a specific prefix.

Show Advertised Routes to a Specific BGP Neighbor

sudo vtysh -c "show ip bgp neighbors xxx.xxx.xxx.xxx advertised-routes"

Shows the routes being advertised to the specified neighbor.

Community Discussion: BGP Management Choices

Highlights from a Tor relays mailing list thread, Tor Relay Deployment Dilemma: Handle BGP yourself or have it done upstream to announce your own AS? on April 8, 2025, covering whether to self-manage BGP sessions or delegate to upstream providers, resource considerations, and monitoring options:

Communicating With Your Upstream Provider

Before setting up your BGP session, gather these details:

Information You Should Share

  1. Your ASN:
  2. Your Peering IP Address:
  3. Prefix to Announce:
  4. Preferred Table Type: Default only, Full Table only, Full Table + Default

Questions to Ask Your Upstream Provider

  1. Upstream ASN:
  2. Upstream Peering IP Address:
  3. Upstream Continuation ASNs: Will you announce to ASXXXX and ASXXX?
  4. Session Timers: Keepalive interval? Hold time?
  5. Capabilities: Do you support graceful restart, route refresh, etc.?
  6. Prefix and Community Policies: Any inbound/outbound filters or community settings?
  7. VLAN or Interface Settings: Any VLAN tags or interface-specific requirements?
  8. Operational Guidelines: Maintenance windows or other operational guidelines?
Join the Mission