> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ppio.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# ppio sandbox network

> Update the egress rules of a running sandbox from the CLI, allowing or denying outbound destinations by IP address or CIDR range, or clearing every rule.

The `network` command updates the egress, or outbound, rules of a running sandbox. Rules control which external destinations the sandbox can reach. They apply to one sandbox, by its ID, and take effect on the running sandbox.

> [!NOTE]
>
> Install the CLI and set the `PPIO_API_KEY` and `PPIO_DOMAIN` environment variables before running these commands. See [Install and authenticate](https://docs.ppio.ai/sandbox/cli/install.md).

> [!WARNING]
>
> If no `allowOut` is specified, all outbound traffic is allowed. Omitting both `--allow-out` and `--deny-out` clears all egress rules.

## Usage

```bash theme={null}
ppio sandbox network <sandbox-id> [--allow-out <destination>] [--deny-out <destination>]
```

## Arguments and options

**\<sandbox-id>** `string` *required*

ID of the running sandbox to update.

**--allow-out** `string`

Allowed outbound destination: an IP address or a CIDR range, such as `1.1.1.1` or `8.8.8.0/24`. Repeat the option to allow several destinations.

**--deny-out** `string`

Denied outbound destination: an IP address or a CIDR range, such as `1.1.1.1` or `8.8.8.0/24`. Repeat the option to deny several destinations.

## Examples

```bash theme={null}
# Only allow egress to these two destinations
ppio sandbox network <sandbox-id> \
  --allow-out 1.1.1.1 \
  --allow-out 8.8.8.0/24
```

```bash theme={null}
ppio sandbox network <sandbox-id> \
  --deny-out 1.1.1.1 \
  --deny-out 8.8.8.0/24
```

```bash theme={null}
# Omit both options to remove all egress rules
ppio sandbox network <sandbox-id>
```

On success the CLI prints:

```text Output theme={null}
Sandbox <sandbox-id> network has been updated
```

> [!NOTE]
>
> The command fails when the sandbox ID does not exist. See [Errors](https://docs.ppio.ai/sandbox/errors.md).


## Related topics

- [ppio sandbox connect](https://docs.ppio.ai/sandbox/cli/connect.md)
- [ppio sandbox exec](https://docs.ppio.ai/sandbox/cli/exec.md)
- [Manage sandboxes in the PPIO console](https://docs.ppio.ai/sandbox/console.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.