@carter are you using the API for this? You can allocate IPs before the first deploy. fly ips allocate-v4
(or the API equivalent) will prep an app to work like it did before.
Note, though, that dedicated IPv4 addresses added to apps will cost $2/mo starting in Jan.
Shared IP routing works based on the certificate names on each app. When we generate a certificate for one of these apps, we add the hostname to a kv store. Then route new connections based on that.