Ask Your Question

Problems of attaching an additional port to a vm

asked 2015-06-23 20:43:52 -0500

nethawk gravatar image

I used Icehouse. I want to add an additional IP to a vm. I did it like this: neutron port-create --mac-address fa:16:3e:5d:f1:80 --fixed-ip subnet_id=9735b6d4-b8a7-40ca-9582-db190db3e07d,ip_address= 9b52ccfc-73fd-49f8-b7f3-237384abf789

nova interface-attach --port-id e2f51e0c-cd6c-40da-9bb2-f54a38fd56e5 1958d7c7-3f31-4b00-9572-ccd92a4fff97

After doing above operations,I can see the port and ip '' on the vm 1958d7c7-3f31-4b00-9572-ccd92a4fff97 through herizon.And the status of the new port is UP,the admin_stat_up is TRUE. But I have two problems: 1 Using ifconfig command on this vm,I can not see the eth1 and its IP. 2 From other vm with the same subnet, I can not ping the IP

Is there anything else should I do about it?

edit retag flag offensive close merge delete


Have you configured the NIC inside VM?

Ranjit gravatar imageRanjit ( 2015-06-24 02:25:58 -0500 )edit

The VM is created by herizon with one network interface. I have not done anything on it.

nethawk gravatar imagenethawk ( 2015-06-24 02:45:54 -0500 )edit

First check that ethernet is getting detected by using lspci command. After that , if you are using network manager inside VM, then it should detect automatically otherwise you need to configure manually.

Ranjit gravatar imageRanjit ( 2015-06-24 06:25:34 -0500 )edit

Does ip link output the second eth? If so you must configure it and bring it up for it to work!

capsali gravatar imagecapsali ( 2015-06-24 06:47:56 -0500 )edit

3 answers

Sort by ยป oldest newest most voted

answered 2015-06-24 05:51:24 -0500

I tried this with a Juno devstack and a cirros instance.

Unlike your case, my instance has eth1 as expected, though it has no IP address. The latter is not surprising when you think where the IP address comes from: The instance must set it, OpenStack can't. OpenStack only makes a DHCP server available (at least, by default), but the instance must be configured to obtain the address. In my case, /etc/network/interfaces contains:

# Configure Loopback
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

I need to add a paragraph for eth1 to get my IP address.

Now I don't have an explanation why you don't even see eth1. If you use KVM or another libvirt-based hypervisor, check whether the interface appears in the XML file for the instance. You can run virsh list to find the libvirt name for the instance, then virsh edit <instance name="">. Here is what it looks like on my system :

<interface type='bridge'>
  <mac address='fa:16:3e:0c:9d:61'/>
  <source bridge='qbr9d6fe0d3-ff'/>
  <target dev='tap9d6fe0d3-ff'/>
  <model type='virtio'/>
  <driver name='qemu'/>
  <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
<interface type='bridge'>
  <mac address='fa:16:3e:5d:f1:80'/>
  <source bridge='qbr69414b42-08'/>
  <target dev='tap69414b42-08'/>
  <model type='virtio'/>
  <driver name='qemu'/>
  <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
edit flag offensive delete link more


The new interface appears in this file. But why can not I ping this new IP from other VM in the same subnet?

nethawk gravatar imagenethawk ( 2015-06-24 21:47:18 -0500 )edit

On your instance, the command "ip addr" should show all interfaces. If the new interface is not there, perhaps you find a relevant error message in /var/log/syslog; otherwise, I don't know. If it's there, it probably has no IP address. The instance needs to set the IP address explicitly.

Bernd Bausch gravatar imageBernd Bausch ( 2015-06-24 22:07:36 -0500 )edit

I can not see the eth1 on the instance after ip addr. And there is no syslog file.

nethawk gravatar imagenethawk ( 2015-06-25 01:28:02 -0500 )edit

Just now,I restarted my instance.And eth1 can be seen on my instance with new IP But it still can not be pinged from other instance with the same subnet.

nethawk gravatar imagenethawk ( 2015-06-25 01:43:16 -0500 )edit

Then you arrived at the point that I described in the answer. Troubleshooting network access is a bit complex and depends on your Network setup. As a start, you could check if you can ping out via eth1, e.g. sudo ping -I eth1 router address (this is an upper case "i").

Bernd Bausch gravatar imageBernd Bausch ( 2015-06-25 02:23:14 -0500 )edit

answered 2015-06-26 02:02:49 -0500

nethawk gravatar image

updated 2015-06-26 02:21:13 -0500

Ranjit gravatar image

To:Bernd Bausch: First,thnks for your help.

There isn't any flaotingIP.

1)I have two instances:
The ip is attached by nova interface-attach command.

2)On vm-1:
host-192-168-10-2:~ # ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet brd scope host lo
    inet brd scope host secondary lo
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether fa:16:3e:5d:f1:7d brd ff:ff:ff:ff:ff:ff
    inet brd scope global eth0
    inet6 fe80::f816:3eff:fe5d:f17d/64 scope link 
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether fa:16:3e:5d:f1:80 brd ff:ff:ff:ff:ff:ff
    inet brd scope global eth1
    inet6 fe80::f816:3eff:fe5d:f180/64 scope link 
       valid_lft forever preferred_lft forever
Here you can see there are two interfaces and each interface only has one IP.

3)Through eth1,it can ping
host-192-168-10-2:~ # ping -I eth1
PING ( from eth1: 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=64 time=2.71 ms
64 bytes from icmp_seq=2 ttl=64 time=0.737 ms

4)But on vm-2 which has the ip
host-192-168-10-11:~ # arp
Address                  HWtype  HWaddress           Flags Mask            Iface
host-192-168-10-2.opens  ether   fa:16:3e:5d:f1:7d   C                     eth0  ether   fa:16:3e:5d:f1:7d   C                     eth0

Here you can see the two interface and MAC are same.
edit flag offensive delete link more


you are facing the problem called arp flux . See some net result and try to solve and let us know.

Ranjit gravatar imageRanjit ( 2015-06-26 02:28:55 -0500 )edit

Thanks, I learned something.

Bernd Bausch gravatar imageBernd Bausch ( 2015-06-26 09:25:33 -0500 )edit

answered 2015-06-26 03:42:30 -0500

dbaxps gravatar image

updated 2015-06-26 03:59:22 -0500

You may install libguestfs tools package ( )

Mount qcow2 image prior to uploading  to glance and add /etc/sysconfig/network-scripts/ifcfg-eth1. Actually,you may create 2,3,4,.... VNICs  on qcow2 image and then upload to glance.

Libguestfs-tools package is available on any RH OS and Ubuntu as well.
View also

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2015-06-23 20:43:52 -0500

Seen: 1,968 times

Last updated: Jun 26 '15