This is a very good question concerning how BGP and NAT can function together. For BGP to advertise a route, this route must be in the router’s routing table. But if you’re using NAT, then the routes in the router’s routing table will be the internal or private ranges, ranges that you don’t actually want advertised. So how do you get the routable or public IP ranges to be advertised by BGP?
Well, in simple terms, you would have to insert the route to the public IP address space that is being used for NAT translation. If for example, you are translating 10.123.10.50 to the external IP address 220.127.116.11, then you would add a static route on the NAT router that points to a null interface like so:
ip route 18.104.22.168 255.255.255.255 Null0
For this route to be advertised via BGP, you would add the following
network command to the appropriate BGP AS:
network 22.214.171.124 mask 255.255.255.255
This IP address will then be advertised via BGP.
If you have a whole range of public IP addresses that are used for NAT, then you can add the whole range of addresses to the above two commands. For example, if you are translating to the external range 126.96.36.199/27, then the respective commands would be:
ip route 188.8.131.52 255.255.255.224 Null0
network 184.108.40.206 mask 255.255.255.224
I hope this has been helpful!