Skip to content

A prefix limit on every session ​

Every BGP session has a limit a little higher than the number of routes its neighbor should send, and closes when the neighbor goes over it.

Why ​

A prefix limit is a fuse. A neighbor may leak routes, or send a full table by mistake. The session then closes before those routes spread through your network and fill your router's memory and its chip.

In the June 2019 leak, the provider that announced the leaked routes took thousands of them from one customer. A limit on that session would have closed it, and Cloudflare named limits as one of the fixes.

RFC 7454 sets the limit by who the neighbor is. For a peer, keep it lower than a full table, so the session closes if the peer suddenly sends one. For a transit, keep it higher than a full table, to protect the router's memory.

In Circuit ​

max_prefixes goes on each neighbor, or on its group. When the neighbor sends more, the session closes, and it stays closed until you clear it. On RouterOS, circuit bgp shows why each session is down, and circuit bgp --clear-limit opens the closed ones again. If several closed at once, look for a leak upstream before you raise a limit.

The edge router example sets a limit on each of its three sessions. Its transit:

ts
"hurricane-electric": {
    address: "203.0.113.1",
    remote_as: 6939,
    description: "Hurricane Electric",
    role: "provider",
    max_prefixes: 1_200_000,
    import_policy: "transit-import",
    export_policy: "export",
    communities: { groups: ["transit"] },
},

For a peer, use the limits its PeeringDB record recommends for IPv4 and IPv6. BGP lets you try a limit on a session, and Choosing a device shows how many routes a chip holds.

Further reading ​

Discussion

Stuck, or found a mistake? Ask here. You sign in with GitHub.

Released under the Business Source License 1.1.