# Network

What traffic can leave a VM, what can reach it, and how connections behave when the VM sleeps.

Source: https://slashinfra.com/docs/how/network
Last modified: 2026-11-30T16:36:19.000Z

Outbound HTTPS works by default through the secure gateway. Inbound traffic reaches a VM only through its web addresses, port forwards, SSH and your tailnet.

## Going out

The VM sets HTTP and HTTPS settings for outbound traffic. Tools such as `curl` and package managers use them. Keep those settings when a program starts a subprocess or when you configure a tool.

```bash
si exec -- curl -I https://example.com
```

A successful HTTPS connection does not give your request any credentials for the destination. Your application sends its own provider keys or account tokens. Keep those keys separate from the SlashInfra key, which authenticates requests to SlashInfra only.

By default the firewall allows ports 80 and 443. Domain filtering is off by default and may be on for your service. The current policy is in [limits](https://slashinfra.com/docs/reference/limits#network).

When domain filtering is on, the host must match the allowlist, and allowing a host does not allow all its ports. The Tailscale control and relay hosts are allowed in that case, as covered in [private network](https://slashinfra.com/docs/platform/private-network). The domain filter does not apply to traffic inside a Tailscale tunnel.

The firewall refuses a destination written as an IP address. It also checks the address that a name resolves to, so a correct name can still fail when it resolves to a restricted address. A client that ignores the outbound settings gets no direct route to the internet.

## Coming in

A web address has the form `https://<port>-<id>.slashinfra.dev`. The secure gateway checks access and sends the request to that port inside the VM. Start the server before you open the address. The address does not start a listener. See [web addresses](https://slashinfra.com/docs/platform/web-addresses) for the access levels.

Your laptop can reach a closed port through a port forward. This command listens on `127.0.0.1` on your laptop and tunnels to the VM:

```bash
si port forward 3000 8000 5432:15432
```

A forward works on a closed port and wakes the VM on the first connection. It counts toward the VM’s connection limit, and it closes when you stop the command.

Every VM runs an SSH server on port 22. Once the VM has joined your tailnet, a tailnet peer connects to it by name, without a port forward.

Tailnet traffic reaches the VM through a Tailscale relay. Direct peer connections do not work from inside the VM, so transfers can be slower than on a normal network.

## Between your VMs

A VM with a name is reachable from the other VMs of its project as `<name>.<project>.internal`, on any TCP port. A VM without a name has no private name.

```bash
curl http://api.default.internal:8080/
```

Neither VM needs a key, and the target does not need an open port. Connecting wakes a sleeping target. A name in another project, a name in another organization, or a name that matches no VM ends the connection without an answer. `curl` reports `(52) Empty reply from server`, not `403` or `404`.

The bytes you receive count toward your VM’s network usage, not the target’s. The connection keeps both VMs awake while data moves.

## Connections and sleep

Open connections always end when a VM sleeps or stops. Browser apps, WebSockets, SSH sessions and database clients must reconnect. Their next request wakes the VM. See [sleep and wake](https://slashinfra.com/docs/how/sleep-and-wake) for what a resumed process keeps.

A preview, an SSH session or a port forward keeps the VM awake while it moves data. A connection that carries only keep-alives does not. A preview connection closes after about 100 seconds without traffic, so send WebSocket pings or server-sent event comments to keep a long-lived one open.

A tunnel daemon inside the VM does not keep it awake, and a sleeping VM is not reachable through its own tunnel. A web address wakes it, and so does `si svm start`.

To keep SSH from your tailnet reachable at any time, set the `on` policy. The VM then never sleeps, and it uses its memory all the time:

```bash
VM=my-vm
si svm sleep "$VM" on
```

Set `auto` again when the VM should sleep when idle.

## Next

- [Sleep and wake](https://slashinfra.com/docs/how/sleep-and-wake): what keeps a VM awake and what wakes it. 
- [Web addresses](https://slashinfra.com/docs/platform/web-addresses): addresses, links and access levels. 
- [Private network](https://slashinfra.com/docs/platform/private-network): the tailnet, SSH and private names.
