How does Airbyte handle connecting to databases that are behind a firewall / NAT?

We currently don’t. We strongly recommend hosting Airbyte in your own private cloud/VPC.