- Symptom:
When you create a VM instance, you may discover that one VM instance has attached multiple networks. At this time, you can see multiple NICs on the VM instance via the console, but no IP addresses are found.
- Cause:
For a VM instance, each network is exactly one NIC. Attaching a network to a VM instance is equal to connecting a physical NIC to a server. By running ifconfig, you can see the eth device. If no IP addresses are found, this NIC has been actually connected but is not configured properly.
- Solution:Ensure that you create a configuration file for this new NIC by incurring through the eth configuration file as follows:
- Make a copy of eth0: (The following is an example of a CentOS 7.2 environment. Notice that other versions of Linux path and file may be slightly different.)
# Replace eth0 to eth1 in your configuration file, and delete the UUID. cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth1 sed -i 's/eth0/eth1/g' ifcfg-eth0 sed -i '/UUID*/d' /etc/sysconfig/network-scripts/ifcfg-eth1
- Restart the network to take effect:
/etc/init.d/network restart
- By running
ifconfig
, you will see the IP addresses of the second NIC. If you attach multiple NICs to one VM instance, run the preceding commands.
- Make a copy of eth0: (The following is an example of a CentOS 7.2 environment. Notice that other versions of Linux path and file may be slightly different.)
How can I attach multiple NICs to a VM instance? Print
Created by: ZStack Support
Modified on: Mon, 28 Mar, 2022 at 10:54 AM
Did you find it helpful? Yes No
Send feedbackSorry we couldn't be helpful. Help us improve this article with your feedback.