Skip to content
B BGPCast

Knowledge Base

How to connect your router to the BGPCast route server. Two ways: direct BGP peering (needs a public IP on your router) or the connector agent (if your router is behind NAT/CGNAT). Copy the commands and substitute your values from the app.

Updated

Direct peering (router's public IP)

For routers with a public IP. Bring up a BGP session with the route server and substitute your peer IP and ASN from the app.

MikroTik (RouterOS 7.23+)

1. Filter rules (next-hop to ISP + discard)

/routing filter rule
add chain=bgp_in comment="Nexthop to ISP" disabled=no rule="set gw <next-hop>; accept;"
add chain=discard disabled=no rule="reject;"

2. BGP template

/routing bgp template
add as=<your-asn> disabled=no name=bgpcast output.network=bgp-networks .no-client-to-client-reflection=yes routing-table=main

3. BGP connection

/routing bgp connection
add as=<your-asn> cisco-vpls-nlri-len-fmt=auto-bits connect=yes disabled=no hold-time=4m input.filter=bgp_in instance=bgp-instance-bgpcast keepalive-time=1m listen=yes \
    local.address=<your-ip> .role=ebgp multihop=yes name=bgpcast output.filter-chain=discard .network=bgp-networks .no-client-to-client-reflection=yes \
    remote.address=<bgpcast-ip> .as=<bgpcast-asn> routing-table=main templates=bgpcast vrf=main

4. Verify the session is established

/routing/bgp/session/print
Sign in to get your parameters

Connector agent (behind NAT)

If your router is behind NAT/CGNAT. The agent is a small daemon: it pulls your announce set from the route server over HTTPS/WSS and re-originates it as BGP locally on your router. No inbound BGP session required. The agent is published at github.com/samfili/bgpcast-agent — the container image tagged latest on GHCR (used below), and the .ipk packages under Releases.

Keenetic (Entware)

1. Install the package and start the service

opkg install ./bgpcast-agent_<version>-1_<arch>_entware.ipk
/opt/etc/init.d/S99bgpcast-agent start

2. Open the settings page (LAN only)

http://<router-ip>:8080/

3. Fill in the fields and click "Save & apply"

API URL:      https://bgpcast.cc
Agent token:  <your-token>

4. Full BIRD2 config (bird.conf)

# bird.conf
log syslog all;
router id <router-id>;

protocol device {}

protocol kernel {
  ipv4 { export all; };
}

protocol bgp bgpcast {
  local port 1791 as <your-asn>;       # BIRD uses 1791, leaving TCP/179 for the agent
  neighbor 127.0.0.1 as <agent-asn>;   # the agent listens on 179
  ipv4 {
    import filter { gw = <next-hop>; accept; };
    export none;
  };
}
<router-id> — any 32-bit ID, e.g. the router's LAN IP; <your-asn> = "Your ASN", <agent-asn> = "Agent ASN" — from the peer card in the app; <next-hop> — your ISP gateway. local port 1791 keeps BIRD off TCP/179 so it doesn't clash with the agent, which listens on 179.

Architectures: mipsel, mips, aarch64. The settings page has two fields — "API URL" (the route server address) and "Agent token" (from the app); the page is reachable from the local network only.

Sign in to get your token and parameters
Common issues Session not coming up, or 0 prefixes received? See troubleshooting.