A mask lower than /24 does not give access to the Internet: BGP

Hello everyone,
I recently upgraded from version 6 to version 7. I have two routers of which in the first I implement BGP and OSPF and in the second OSPF. I have a pool /24 of public IPs that I don’t use in their entirety and that I would like to subdivide into sub-networks to allocate to clients. When I configure the /24 on the interface of my router I have access to the Internet but when I create a /28 for example I don’t have access to the Internet. What can I do? Thank you for your help

Translated with DeepL.com (free version)

Hello!
BGP requires an active /24 route in order to advertise it. You can create a blackhole route for the /24 network to meet this requirement, while injecting the more specific /28 prefix via OSPF. Since the /28 routes are more specific, your internal networks will function normally, and BGP will successfully advertise the /24.

Thank you for your feedback. Several things have changed in version 7. Following your advice, I saw that line

/ip/route/add dst-address=10.0.0.0/24 blackhole

can add a blackhole route assuming that 10.0.0.0/24 corresponds to my public IP block. Do I need to add any more parameters?
Thanks.

I have try this and my problem is sorted out. Thanks