You can use cooperative BGP4 route filtering to cause the neighbor to perform the filtering before sending the routes to the device.
device# configure terminal
device(config)# ip prefix-list Routesfrom1234 deny 10.20.0.0/24 device(config)# ip prefix-list Routesfrom1234 permit 10.0.0.0/0 le 32
device(config)# router bgp
device(config-bgp-router)# address-family ipv4 unicast
device(config-bgp-ipv4u)# neighbor 10.2.3.4 prefix-list Routesfrom1234 in
device(config-bgp-ipv4u)# neighbor 10.2.3.4 capability orf prefixlist send
The following example summarizes the commands in this procedure.
device# configure terminal device(config)# ip prefix-list Routesfrom1234 deny 10.20.0.0/24 device(config)# ip prefix-list Routesfrom1234 permit 10.0.0.0/0 le 32 device(config)# router bgp device(config-bgp-router)# address-family ipv4 unicast device(config-bgp-ipv4u)# neighbor 10.2.3.4 prefix-list Routesfrom1234 in device(config-bgp-ipv4u)# neighbor 10.2.3.4 capability orf prefixlist send