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.
Introduction
After attaching additional network interfaces to your OpenStack instance at the platform level, you must configure those interfaces inside the instance's operating system before they become functional. The operating system does not automatically configure newly attached network interfaces, so you need to manually set up DHCP or static IP addressing, routing, and DNS settings.
This guide covers operating system level configuration for multiple network interfaces on Linux and Windows instances. This is a separate step from attaching interfaces through OpenStack Horizon or the CLI.
Note: This guide assumes you have already attached network interfaces to your instance using OpenStack. If you have not yet attached interfaces, refer to the "Attaching Network Interfaces to OpenStack Instances" guide first.
Prerequisites
Before configuring network interfaces inside your instance, ensure you have:
- An OpenStack instance with multiple network interfaces already attached at the platform level
- SSH access (Linux) or RDP access (Windows) to your instance
- Root or administrator privileges inside the instance
- Knowledge of the IP addresses, subnet masks, and gateway addresses for each network
- Backup of existing network configuration files
Understanding Interface Configuration
When you attach a new network interface to an OpenStack instance, the hypervisor makes the interface available to the instance, but the operating system does not configure it automatically. You must:
- Identify the newly attached interface name (eth1, ens4, etc.)
- Configure IP addressing (DHCP or static)
- Set up routing rules if needed
- Configure DNS settings
- Enable the interface and make configuration persistent across reboots
Identifying New Interfaces
Before configuring, identify which interfaces exist on your system.
Linux
List all network interfaces:
1ip link show
Or use the traditional command:
1ifconfig -a
New interfaces typically appear as eth1, eth2, ens4, ens5, etc., depending on your distribution's naming scheme.
Windows
Open PowerShell and list all network adapters:
1Get-NetAdapter
Newly attached interfaces will appear as "Ethernet 2", "Ethernet 3", etc.
Configuring Linux Interfaces with DHCP
DHCP configuration allows the instance to automatically obtain IP addresses from the OpenStack network's DHCP server.
Debian/Ubuntu (Netplan)
Modern Ubuntu versions use Netplan for network configuration.
Edit the Netplan configuration file:
1sudo nano /etc/netplan/50-cloud-init.yaml
Add the new interface configuration:
1network:2 version: 23 ethernets:4 eth0:5 dhcp4: true6 eth1:7 dhcp4: true8 dhcp4-overrides:9 use-routes: false
Note: The use-routes: false directive prevents the second interface from overriding your default gateway.
Apply the configuration:
1sudo netplan apply
Debian/Ubuntu (Traditional ifupdown)
Edit the network interfaces file:
1sudo nano /etc/network/interfaces
Add the new interface:
1auto eth12iface eth1 inet dhcp
Bring up the interface:
1sudo ifup eth1
CentOS/RHEL/Rocky Linux
Create a configuration file for the new interface:
1sudo nano /etc/sysconfig/network-scripts/ifcfg-eth1
Add the following configuration:
1DEVICE=eth12BOOTPROTO=dhcp3ONBOOT=yes4TYPE=Ethernet5PERSISTENT_DHCLIENT=16NM_CONTROLLED=no7DEFROUTE=no
Note: DEFROUTE=no prevents this interface from setting a default route.
Restart networking:
1sudo systemctl restart NetworkManager
Or for older systems:
1sudo systemctl restart network
Configuring Linux Interfaces with Static IP
Static IP configuration gives you precise control over addressing and routing.
Debian/Ubuntu (Netplan)
Edit the Netplan configuration:
1sudo nano /etc/netplan/50-cloud-init.yaml
Add static configuration:
1network:2 version: 23 ethernets:4 eth0:5 dhcp4: true6 eth1:7 addresses:8 - 192.168.1.100/249 routes:10 - to: 192.168.1.0/2411 via: 192.168.1.112 nameservers:13 addresses:14 - 8.8.8.815 - 8.8.4.4
Apply the configuration:
1sudo netplan apply
CentOS/RHEL/Rocky Linux
Edit the interface configuration file:
1sudo nano /etc/sysconfig/network-scripts/ifcfg-eth1
Add static configuration:
1DEVICE=eth12BOOTPROTO=static3IPADDR=192.168.1.1004NETMASK=255.255.255.05ONBOOT=yes6TYPE=Ethernet7NM_CONTROLLED=no8DEFROUTE=no
Restart networking:
1sudo systemctl restart NetworkManager
Configuring Windows Interfaces
Windows instances require configuration through the GUI or PowerShell.
Using PowerShell (DHCP)
Configure the interface to use DHCP:
1Get-NetAdapter | Where-Object {$_.Name -eq "Ethernet 2"} | Set-NetIPInterface -DHCP Enabled
Restart the adapter:
1Restart-NetAdapter -Name "Ethernet 2"
Using PowerShell (Static IP)
Assign a static IP address:
1New-NetIPAddress -InterfaceAlias "Ethernet 2" -IPAddress 192.168.1.100 -PrefixLength 24 -DefaultGateway 192.168.1.1
Set DNS servers:
1Set-DnsClientServerAddress -InterfaceAlias "Ethernet 2" -ServerAddresses 8.8.8.8,8.8.4.4
Using the GUI
- Open Control Panel > Network and Sharing Center
- Click Change adapter settings
- Right-click the new network adapter and select Properties
- Select Internet Protocol Version 4 (TCP/IPv4) and click Properties
- Choose Obtain an IP address automatically for DHCP, or Use the following IP address for static configuration
- Enter IP address, subnet mask, default gateway, and DNS servers
- Click OK to apply
Verifying Connectivity
After configuring interfaces, verify they are working correctly.
Check Interface Status
Linux:
1ip addr show
Verify each interface has an IP address assigned.
Windows:
1Get-NetIPAddress
Test Network Connectivity
Ping the gateway for each network:
Linux:
1ping -c 4 192.168.1.1
Windows:
1Test-Connection -ComputerName 192.168.1.1 -Count 4
Verify Routing Table
Linux:
1ip route show
Windows:
1Get-NetRoute
Ensure your default route points to the correct gateway and that additional routes exist for secondary networks.
Troubleshooting Common Issues
Interface Configured But No Connectivity
Cause: Missing or incorrect gateway configuration, or security group rules blocking traffic.
Solution: Verify the gateway IP is correct and that OpenStack security groups allow traffic on the network. Check security group rules in Horizon or using the CLI.
DHCP Not Assigning IP Address
Cause: DHCP service not available on the OpenStack network, or the instance is not requesting DHCP.
Solution: Verify the network has DHCP enabled in OpenStack:
1openstack network show <network-name>
Look for enable_dhcp: true. If DHCP is disabled, configure a static IP instead.
Default Gateway Overridden by Secondary Interface
Cause: The secondary interface is setting a default route that conflicts with the primary interface.
Solution: On Linux, use DEFROUTE=no (CentOS/RHEL) or use-routes: false (Ubuntu Netplan) to prevent the secondary interface from setting default routes. On Windows, remove the default gateway from the secondary interface configuration.
Cannot Reach Secondary Network After Configuration
Cause: Firewall rules inside the instance may be blocking traffic.
Solution: Check firewall status and rules:
Linux (firewalld):
1sudo firewall-cmd --list-all
Linux (iptables):
1sudo iptables -L -n
Windows Firewall:
1Get-NetFirewallProfile
Add rules to allow traffic on the secondary interface if needed.
MTU Issues with Multiple Networks
Cause: Different networks may have different MTU (Maximum Transmission Unit) settings, causing packet fragmentation or loss.
Solution: Set consistent MTU values across interfaces:
Linux:
1sudo ip link set dev eth1 mtu 1450
Make the change persistent by adding it to your network configuration files.
Related Resources
Related Articles
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.
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.
