One way would be:
configure neighbor 1.2.3.4 maximum-prefix 400000 threshold 90
(only accept 400K routes from neighbor 1.2.3.4, make a warning log entry when we get to 90%)
Another possibility is to only accept routes of a certain length - that way you don't get a million /24 entries clogging up your routes. For instance a policy "BGP-in-filter"
entry DenySmall4 {
if {
nlri any/16;
} then {
deny;
}
}
entry PermitRest {
if {
} then {
permit;
}
}
can be applied via
configure bgp neighbor 1.2.3.4 route-policy in BGP-in-filter
and should drop anything from a /16 to /24 (and you'd still receive your default-route 0.0.0.0/0)
You can use both, policy and "cutoff", btw.
After that, I'd suggest to still keep a close eye on CPU utilization (bgp process) when a neighbor dies/comes back.
Frank
P.S.: Oh, I'm assuming you're already using route-compression 😉