> For the complete documentation index, see [llms.txt](https://docs.platform9.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.platform9.com/private-cloud-director/virtualized-networking/multi-subnet-vm-networking.md).

# Attach Multiple Ports from the Same Physical Network to a VM

## Overview

When a physical network has more than one subnet, you can attach a VM to multiple subnets of that same network in a single operation, directly from the VM creation wizard. Each subnet attachment creates a separate network interface (port) on the VM.

This matters for first-boot network configuration. An operating system runs its initial network setup exactly once, when it first detects each interface. If you add extra interfaces to a running VM after creation, those interfaces miss that first-boot pass and require manual configuration inside the guest. Attaching all the ports you need at creation time ensures that every interface is configured automatically during first boot.

The same multi-port capability is available when cloning an existing VM.

This guide explains how to use this feature from both the UI and the CLI.

## Prerequisites

* A physical network with two or more subnets already created. See [Physical Network](/private-cloud-director/virtualized-networking/physical-network.md) for steps to create a physical network and its subnets.
* The ports you plan to attach must not already be in use by another VM. Only unassigned ports belonging to the selected subnet are shown in the port picker.
* (Optional) If you need a port with a specific IP address or dual-stack configuration, pre-create the port before starting the wizard. See [Port](/private-cloud-director/virtualized-networking/port.md) and [Add Multiple Dual Stack Ports to a VM](/private-cloud-director/tutorials/create-dual-stack-port.md).

## Attach Multiple Ports Using the UI

When you create or clone a VM, the **Networking** step of the wizard shows one row per network connection. Each row represents one network interface that will be created on the VM.

### Add a Port Row

1. In the **Networking** step, locate the physical network you want to attach to.
2. For each additional subnet you want to attach, click **Add subnet**. A new row appears for the same network.
3. Each row is independent. You can configure the subnet and port for each row separately.

### Configure Each Row

For each row, you can leave both fields at their defaults or narrow the selection:

* **Subnet (optional).** The default is **Automatic**, which lets the Networking Service assign a subnet and IP address. To pin the interface to a specific subnet, expand the subnet selector. The list shows each available subnet as `<CIDR> (<subnet-name>)`. Selecting a subnet narrows the port choices to only the ports that belong to it. If you change the subnet after selecting a port, the port selection resets.
* **Port (optional).** The default is **Automatic**, which creates a new port on the selected subnet. To use a specific pre-existing port, expand the port selector after choosing a subnet. Only unassigned ports from that subnet are listed.

### Duplicate Subnets

You can add two or more rows that reference the same subnet. The Networking Service allows this, but the wizard will display an advisory:

{% hint style="warning" %}
**Routing Advisory**

Multiple interfaces on the same subnet can cause routing issues in the guest unless source routing (policy-based routing) is configured inside the operating system.
{% endhint %}

This warning is informational. The wizard does not block the configuration. If your guest OS is configured for source routing, you can safely ignore it.

### Security Groups

Security groups you assign during the **Networking** step apply correctly to every port attachment, including ports on a specific subnet. To assign security groups, use the **Assign Security Groups** section in the wizard.

### Complete the Wizard

After configuring all rows, proceed through the remaining wizard steps and click **Deploy Virtual Machine**. The VM starts with all the specified network interfaces already present and configured by the guest OS on first boot.

## Attach Multiple Ports Using the CLI

The `pcdctl server create` command accepts multiple `--port` flags, one per interface. Pre-create the ports you need, then pass each port ID to the command:

```bash
pcdctl server create \
  --flavor <flavor-name> \
  --volume <volume-id> \
  --port <port-id-1> \
  --port <port-id-2> \
  --port <port-id-3> \
  --availability-zone <cluster-name> \
  --wait <vm-name>
```

Each `--port` flag maps to one network interface on the VM. All interfaces are present at first boot, so the guest OS configures them during initial startup.

To list available ports and filter by subnet, run:

```bash
pcdctl port list --network <network-id>
```

To create a new port on a specific subnet before running `server create`:

```bash
pcdctl port create --network <network-id> --fixed-ip subnet=<subnet-id>
```

## Clone a VM with Multiple Port Attachments

When cloning a VM that already has multiple network interfaces, the **Clone** wizard includes the same **Networking** step described above. You can keep the original port configuration, change individual rows, or add new rows before cloning. The cloned VM starts with all specified interfaces configured during its first boot.

## Next Steps

* To pre-create ports with specific IP addresses or dual-stack configurations, see [Port](/private-cloud-director/virtualized-networking/port.md).
* To learn about physical networks and subnets, see [Physical Network](/private-cloud-director/virtualized-networking/physical-network.md).
* To configure security groups for your VM's interfaces, see [Security Group](/private-cloud-director/virtualized-networking/security-group.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.platform9.com/private-cloud-director/virtualized-networking/multi-subnet-vm-networking.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
