My standard method is to create a discard static route and use that for the BGP export.
There are other methods. Choose one you like best. I like discard, it's worked well for me.
Like this:
routing-options {
static {
route 2.0.0.0/24 discard;
}
}
policy-options {
policy-statement public-to-bgp {
from {
protocol static;
route-filter 2.0.0.0/24 exact;
}
then accept;
}
}
protocols {
bgp {
export public-to-bgp;
}
}