Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1147238 - [RFE] configure the IP for type='user' interface
Summary: [RFE] configure the IP for type='user' interface
Keywords:
Status: CLOSED DUPLICATE of bug 1075520
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Ján Tomko
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-28 10:36 UTC by lcheng
Modified: 2015-05-15 11:44 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-05-15 11:44:14 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description lcheng 2014-09-28 10:36:37 UTC
Description of problem:
When a guest with two interfaces which are 'user' type, the two virtual NICs are assigned with the same ip in guest.


Version-Release number of selected component (if applicable):
libvirt-1.2.8-3.el7.x86_64
qemu-kvm-1.5.3-73.el7.x86_64
kernel-3.10.0-170.el7.x86_64


How reproducible:
100%

Steps to Reproduce:
1. In host.
# virsh start a
Domain a started

# virsh dumpxml a | grep interface -A5
    <interface type='user'>
      <mac address='52:54:00:29:ae:b7'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <interface type='user'>
      <mac address='52:56:00:29:AE:99'/>
      <model type='virtio'/>
      <alias name='net1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </interface>
...

# ps -aux | grep qemu
...
-netdev user,id=hostnet0 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:29:ae:b7,bus=pci.0,addr=0x3 -netdev user,id=hostnet1 -device virtio-net-pci,netdev=hostnet1,id=net1,mac=52:56:00:29:ae:99,bus=pci.0,addr=0x6 
...

2. In guest.
[root@localhost ~]# ifconfig
eth38     Link encap:Ethernet  HWaddr 52:54:00:29:AE:B7
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::5054:ff:fe29:aeb7/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:15 errors:0 dropped:0 overruns:0 frame:0
          TX packets:18 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:10178 (9.9 KiB)  TX bytes:1853 (1.8 KiB)

eth39     Link encap:Ethernet  HWaddr 52:56:00:29:AE:99
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::3656:ff:fe29:aeb7/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:7 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1955 (1.9 KiB)  TX bytes:1358 (1.3 KiB)

...

Actual results:
As description.

Expected results:
The NICs are assigned with different ip in guest.

Comment 2 Vlad Yasevich 2014-10-01 20:31:55 UTC
This appears to be a configuration issue that is currently not supported by libvirt very well.  Qemu 'user' type network device, also known as SLIRP, has a  qemu built-in configuration that by default uses 10.0.2.0/24 network and provides
10.0.2.15 address to the guest.  This configuration can be changed throught
additional options passed to the '-netdev user' argument, but libvirt doesn't
currently support this.

You can try running this by hand and specifying:
   -netdev user,net=10.0.3.0/24,dhcpstart=10.0.3.15

Re-assigning to livirt for evaluation of support addtional slirp/user related options.

-vlad

Comment 4 Ján Tomko 2015-05-15 11:44:14 UTC

*** This bug has been marked as a duplicate of bug 1075520 ***


Note You need to log in before you can comment on or make changes to this bug.