Skip to main content
IMHCloud Logo
Back to support home

Attaching Network Interfaces to OpenStack Instances

Learn how to attach additional network interfaces to running OpenStack instances using Horizon dashboard and CLI commands for multi-network configurations.

Introduction

Attaching network interfaces to running instances allows you to connect your virtual machines (instances) to additional networks without stopping or restarting them. This capability is essential for creating multi-network architectures where you need to isolate traffic, separate management from production networks, or provide dedicated paths for database connections.

This guide shows you how to attach network interfaces to existing instances using both the Horizon dashboard and the OpenStack command-line interface (CLI).

Prerequisites

Before attaching network interfaces, ensure you have:

  • An active InMotion Cloud account with at least one running instance
  • Horizon dashboard access or OpenStack CLI installed and configured
  • One or more networks already created in your project
  • Appropriate security group rules configured for the target network
  • Administrative permissions to modify instance network configurations

When to Attach Multiple Interfaces

You should attach additional network interfaces when you need to:

  • Network isolation: Keep database traffic separate from application traffic on different networks
  • Security zones: Connect sensitive workloads to private networks while maintaining a public-facing interface
  • Dedicated management access: Use a separate network for administrative access and monitoring
  • High availability: Provide redundant network paths for critical services
  • Multi-tenant architectures: Separate customer traffic across isolated network segments

Attaching Interfaces Using Horizon

The Horizon dashboard provides a straightforward graphical method for attaching network interfaces to instances.

Step 1: Navigate to Instances

Log in to your OpenStack Horizon dashboard and navigate to Project > Compute > Instances.

Step 2: Open Instance Actions

Locate the instance where you want to attach a network interface. Click the dropdown arrow in the Actions column for that instance.

Step 3: Select Attach Interface

From the Actions menu, select Attach Interface. This opens the interface attachment dialog.

Step 4: Choose Network Configuration

In the Network dropdown menu, select the network you want to attach to this instance.

Optional configurations:

  • Fixed IP Address: Leave blank to automatically assign an IP from the network's DHCP pool, or specify a fixed IP address within the subnet range
  • Port: Leave at "No ports available" to create a new port, or select an existing unattached port from the dropdown

Step 5: Confirm Attachment

Click Attach Interface to complete the operation.

The interface attachment happens immediately. You will see the new interface listed in the instance's interface table within a few seconds.

Attaching Interfaces Using CLI

The OpenStack CLI provides flexible options for attaching interfaces, including the ability to specify exact IP addresses and security groups.

Basic Attachment

To attach a new interface from a specific network to an instance:

1openstack server add port <instance-name-or-id> <network-name-or-id>

Example:

1openstack server add port web-server-01 private-network

This creates a new port on the specified network and attaches it to the instance with an automatically assigned IP address.

Attachment with Specific Port

If you have already created a port with specific configurations (security groups, fixed IP, etc.), attach it directly:

1openstack server add port <instance-name-or-id> <port-id>

Example:

1openstack server add port web-server-01 a1b2c3d4-e5f6-7890-abcd-ef1234567890

Creating Port with Fixed IP

To create a port with a specific IP address before attaching:

1openstack port create --network <network-id> \
2 --fixed-ip subnet=<subnet-id>,ip-address=<ip-address> \
3 --security-group <security-group-id> \
4 <port-name>
5
6openstack server add port <instance-name-or-id> <port-name>

Example:

1openstack port create --network private-network \
2 --fixed-ip subnet=private-subnet,ip-address=192.168.1.100 \
3 --security-group default \
4 db-port
5
6openstack server add port db-server-01 db-port

Verify Attachment

Confirm the interface was attached successfully:

1openstack server show <instance-name-or-id> -c addresses

This displays all network interfaces and their IP addresses assigned to the instance.

Verifying Network Interface Configuration

After attaching an interface, verify it appears correctly in both OpenStack and within the instance operating system.

Check Interface Status in Horizon

Navigate to Project > Compute > Instances, click on your instance name, and select the Interfaces tab. You should see all attached interfaces with their network names, IP addresses, and MAC addresses.

Check Interface Status Using CLI

List all ports attached to an instance:

1openstack port list --server <instance-name-or-id>

View detailed port information:

1openstack port show <port-id>

Verify Inside the Instance

SSH into your instance and check that the operating system detects the new network interface:

Linux:

1ip addr show

Windows (PowerShell):

1Get-NetAdapter

Note: The newly attached interface may not be automatically configured by the operating system. You will need to configure it manually or via DHCP inside the instance. Refer to the "Configuring Multiple Network Interfaces Inside Your Instance" guide for OS-level configuration steps.

Troubleshooting Common Issues

Interface Attached But Not Visible in Instance

Cause: The operating system has not configured the new interface.

Solution: Restart the network service or reboot the instance to trigger interface detection. For persistent configuration, manually configure the interface inside the instance.

Port Attachment Fails with "Port Already in Use"

Cause: The port you are trying to attach is already assigned to another instance.

Solution: Verify the port is not in use:

1openstack port show <port-id>

If the port is attached to another instance, either detach it first or create a new port.

Cannot Attach Interface: Quota Exceeded

Cause: Your project has reached its network port quota.

Solution: Request a quota increase from your cloud administrator or delete unused ports:

1openstack port list
2openstack port delete <unused-port-id>

Network Not Available in Horizon Dropdown

Cause: The network may not exist, or you may not have access to it.

Solution: Verify the network exists and is shared or owned by your project:

1openstack network list

If the network does not appear, create it or contact your administrator for access.

Related Resources

Related Articles

Read article

Detaching Network Interfaces from OpenStack Instances

Learn how to safely detach network interfaces from running OpenStack instances using Horizon and CLI, with key considerations to prevent connectivity loss.

Read article

Configuring Multiple Network Interfaces Inside Your OpenStack Instance

Learn how to configure multiple network interfaces at the operating system level inside your OpenStack instances for Linux and Windows systems.

Read article

Setting Up OpenStack Prerequisites for Launching Instances

Learn how to create SSH key pairs, configure security groups, and set up networks before launching your first OpenStack instance.