> For the complete documentation index, see [llms.txt](https://docs.cloudeka.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cloudeka.ai/cloudeka-api-list/command-reference/cldkctl-flexi/instance/attach-interface.md).

# attach-interface

Attach an interface to a flexi instance in your project. This command allows you to attach an interface to a flexi instance.

## Usage

```
cldkctl flexi instance attach-interface [name] [flags]
```

## Steps

Follow the steps below to run and view the result of this command:

#### Interactive Mode

1. Run the following command in your terminal:

```
cldkctl flexi instance attach-interface [instance-name] -i 
```

2. Replace **\[instance-name]** with the name of the instance.
3. Select the **interface type**: **By VPC** or **By Port**.

<figure><img src="/files/c31cAxPcfg2StgI8nldO" alt=""><figcaption></figcaption></figure>

4. If you select **By VPC**, select the **VPC**.
5. Enter the **IP address** for the interface.

<figure><img src="/files/LR0uyFMwit0BkA2TLhSe" alt=""><figcaption></figcaption></figure>

6. If you select **By Port**, select the **port**.

<figure><img src="/files/G5p2ZkTIzflO7NNVt2eW" alt=""><figcaption></figcaption></figure>

7. Confirm the interface attachment by selecting **Confirm**.

<figure><img src="/files/ZfCyPnLwEIvtguGAG1C1" alt=""><figcaption></figcaption></figure>

8. Once completed successfully, the terminal displays the success message.

<figure><img src="/files/WRMO4yaqo8vY945IQkE8" alt=""><figcaption></figcaption></figure>

#### Non-Interactive Mode

1. Provide all required values using command flags.
2. Add `--auto-confirm` or `-y` to skip confirmation prompts in non-interactive mode.
3. Run the command in your terminal.
4. Once completed successfully, the terminal displays the success message.

<figure><img src="/files/ZP6It1IShoY1DHS6uBk5" alt=""><figcaption></figcaption></figure>

## Flags

{% hint style="info" %}
This command supports [global flags](/cloudeka-api-list/global-flags.md). Refer to the Global Flags section for details
{% endhint %}

| Flag           | Shorthand | Default | Description                                                    |
| -------------- | --------- | ------- | -------------------------------------------------------------- |
| --auto-confirm | -y        | false   | Skip confirmation prompt in non-interactive mode               |
| --help         | -h        |         | help for attach-interface                                      |
| --interactive  | -i        | false   | Force interactive TUI mode                                     |
| --ip-address   |           |         | IP Address (required when --type is vpc)                       |
| --port-id      |           |         | Port ID (required when --type is port)                         |
| --project      | -p        |         | Specify project ID                                             |
| --type         |           |         | Interface type: vpc or port (required in non-interactive mode) |
| --vpc-id       |           |         | VPC ID (required when --type is vpc)                           |
