RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 611793 - Static only DHCP not supported in network configs.
Summary: Static only DHCP not supported in network configs.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.0
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Laine Stump
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-07-06 14:43 UTC by Daniel Berrangé
Modified: 2015-09-28 02:11 UTC (History)
11 users (show)

Fixed In Version: libvirt-0.8.7-1.el6
Doc Type: Bug Fix
Doc Text:
If the configuration for a virtual network only contained static address definitions, dnsmasq (the DHCP server used by libvirt) was started incorrectly and would not respond to any DHCP requests. Any guests with MAC address/IP address pairs listed in static address definitions were then unable to acquire their IP addresses. libvirt now starts up dnsmasq with the correct options so that these statically configured addresses are properly served to the guests.
Clone Of: 597363
Environment:
Last Closed: 2011-05-19 13:19:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:0596 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2011-05-18 17:56:36 UTC

Description Daniel Berrangé 2010-07-06 14:43:51 UTC
+++ This bug was initially created as a clone of Bug #597363 +++

Description of problem:

If you specify only 'host' entries in the dhcp section, then no dnsmasq is started up.


Version-Release number of selected component (if applicable):
Using library: libvir 0.6.3



How reproducible:


Steps to Reproduce:

Use network 

<network>
  <name>brbb6fd2</name>
  <uuid>f90a9a4b-449b-ae12-c0ac-d80255141a77</uuid>
  <forward dev='bond0' mode='route'/>
  <bridge name='brbb6fd2' stp='off' forwardDelay='0' />
  <ip address='10.187.111.209' netmask='255.255.255.252'>
    <dhcp>
      <host mac='00:16:3e:bb:6f:d2' name='xenhvmlvm' ip='10.187.111.210' />
    </dhcp>
  </ip>
</network>

and start the network. 

  
Actual results:

No dnsmasq is started.


Expected results:

Should start up a dnsmasq serving only static entries by including an appropriate dhcp-range flag.

For example above should including something like:

--dhcp-range=10.187.111.209,static


Additional info:

workaround is to include the network broadcast address as a single range. So for above that would be

    <dhcp>
      <range start='10.187.111.211' end='10.187.111.211' />
      <host mac='00:16:3e:bb:6f:d2' name='xenhvmlvm' ip='10.187.111.210' />
    </dhcp>

Comment 1 Laine Stump 2011-01-04 20:19:37 UTC
This functionality was added in the following upstream commit:

commit df990b445bd85bbd59296acbcaeb9d81543466c8
Author: Jiri Denemark <jdenemar>
Date:   Thu Sep 9 16:00:08 2010 +0200

    bridge: Fix static-only DHCP configuration
    
    For static-only DHCP, i.e. with no <range> but at least one <host>
    element within <dhcp> element, we have to add "--dhcp-range IP,static"
    option to dnsmasq to actually enable the service. Without this option,
    dnsmasq will not respond to DHCP requests.

and included in upstream libvirt-0.8.4.

It will therefore be in the next RHEL6 rebase of libvirt.

Comment 2 Jiri Denemark 2011-01-09 23:58:12 UTC
Built into libvirt-0.8.7-1.el6

Comment 3 xhu 2011-01-11 04:44:47 UTC
Verified it on RHEL6_x86_64 Server with the following component and it passed:
libvirt-0.8.7-1.el6
qemu-kvm-0.12.1.2-2.128.el6
kernel-2.6.32-94.el6

The steps are as follows:
1 define and start the routed network by using the following xml:
# cat statictest.xml
<network>
	<name>statictest</name>
	<forward mode='nat'/>
	<bridge name='s1' stp='on' delay='0' />
        <ip address='192.168.100.1' netmask='255.255.255.0'>
        	<dhcp>
			<host mac='00:16:36:7b:4a:21' name='new-host1' ip='192.168.100.33' />
		</dhcp>
        </ip>
</network>

# virsh net-define statictest.xml
Network statictest defined from statictest.xml

# virsh net-start statictest
Network statictest started

2 Check dnsmasq process option:
# ps -ef|grep dnsmasq|grep statictest
nobody   29523     1  0 11:08 ?        00:00:00 /usr/sbin/dnsmasq --strict-order --bind-interfaces --pid-file=/var/run/libvirt/network/statictest.pid --conf-file=  --listen-address 192.168.100.1 --except-interface lo --dhcp-range 192.168.100.1,static --dhcp-no-override --dhcp-hostsfile=/var/lib/libvirt/dnsmasq/statictest.hostsfile

3 define and start guest using statictest network:
# virsh dumpxml rhel6
...
    <interface type='network'>
      <mac address='52:54:00:8c:c7:f6'/>
      <source network='statictest'/>
      <target dev='vnet0'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
...

4 the guest get IP:  192.168.100.33 hostname: new-host1

Comment 5 Cui Chun 2011-02-09 08:39:07 UTC
Rechecked it on the following test environment according to comment 3. It is passed.

Test environment:
libvirt-0.8.7-5.el6
qemu-kvm-0.12.1.2-2.144.el6
kernel-2.6.32-94.el6

Comment 6 Laine Stump 2011-05-03 17:05:15 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
In previous versions of libvirt, if the configuration for a virtual network only contained static address definitions (ie no dynamic address range), dnsmasq (the dhcp server used by libvirt) was started incorrectly, and would not respond to any DHCP requests. This resulted in the guests with MAC address/IP address pairs listed in the static address definitions being unable to acquire their IP addresses.

libvirt now starts up dnsmasq with the correct options so that these statically configured addresses are properly served to the guests.

Comment 9 Laura Bailey 2011-05-04 06:20:02 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1,3 +1 @@
-In previous versions of libvirt, if the configuration for a virtual network only contained static address definitions (ie no dynamic address range), dnsmasq (the dhcp server used by libvirt) was started incorrectly, and would not respond to any DHCP requests. This resulted in the guests with MAC address/IP address pairs listed in the static address definitions being unable to acquire their IP addresses.
+If the configuration for a virtual network only contained static address definitions, dnsmasq (the DHCP server used by libvirt) was started incorrectly and would not respond to any DHCP requests. Any guests with MAC address/IP address pairs listed in static address definitions were then unable to acquire their IP addresses. libvirt now starts up dnsmasq with the correct options so that these statically configured addresses are properly served to the guests.-
-libvirt now starts up dnsmasq with the correct options so that these statically configured addresses are properly served to the guests.

Comment 10 errata-xmlrpc 2011-05-19 13:19:26 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0596.html


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