Understanding private vs public networking
3 min read
Summary
SonicInfra doesn't have a VPC, subnet, or private-network resource — there's nothing to configure to make an instance "private." Instances are private by default, full stop: a Compute Instance has no public IP address of its own. The only way anything about an instance becomes reachable from the public internet is by fronting it with a Load Balancer, which is what actually gets the public IP.
How instances stay private
Since an instance has no public IP, the only way in is through SonicInfra's own gateway, using the sonic CLI:
sonic ssh web-01
sonic tunnels this connection through the gateway rather than connecting to the instance directly. Running sonic ssh-copy-id and sonic setup-ssh doesn't change that — setup-ssh just writes a Host *.sonicinfra block into your local ~/.ssh/config with a ProxyCommand that routes through the same gateway tunnel, so ssh web-01.sonicinfra works as shorthand. It's a local SSH convenience, not a private DNS zone or a network identity SonicInfra assigns the instance.
Making something public
To expose an instance, front it with a Load Balancer. Both kinds select their target instance(s) by label (instance-name by default, so just the instance's name in the simple case) rather than by IP — the instance never needs a public address for this to work:
- L4 Load Balancer (
load-balancer-spec.yaml) — maps TCP/UDP ports straight through to a port on the instance. Good for non-HTTP protocols or raw TCP. - L7 Load Balancer (
l7-load-balancer-spec.yaml) — routes HTTP/HTTPS by domain and path to a port on the instance, with optional TLS termination via a TLSConfig resource.
Either way, the public IP (or hostname, for L7) lands on the load balancer's status, never on the instance. Only the ports and paths you explicitly map are reachable from outside — everything else on the instance stays behind the gateway.
Still stuck?
Search the Knowledge Base for your exact error, or reach out from your dashboard's support panel. See also Deploy your first compute instance for the full walkthrough of connecting over SSH and exposing an app with an L7 Load Balancer.