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 1113983 - netcf should allow interfaces to be configured with both DHCPv4 and static IPv4 addresses at the same time
Summary: netcf should allow interfaces to be configured with both DHCPv4 and static IP...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: netcf
Version: 7.1
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Laine Stump
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-06-27 11:54 UTC by Hu Jianwei
Modified: 2015-11-19 08:58 UTC (History)
5 users (show)

Fixed In Version: netcf-0.2.8-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-19 08:58:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:2248 0 normal SHIPPED_LIVE Moderate: netcf security, bug fix, and enhancement update 2015-11-19 09:11:05 UTC

Description Hu Jianwei 2014-06-27 11:54:57 UTC
Description of problem:
libvirt should not set DHCPV6C and IPV6ADDR on interface for IPV6 protocol concurrently

Version-Release number of selected component (if applicable):
libvirt-0.10.2-39.el6.x86_64
netcf-0.2.4-1.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
[root@rhel6 ~]# virsh iface-dumpxml eth1
<interface type='ethernet' name='eth1'>
  <start mode='none'/>
  <mac address='00:1B:21:27:4E:CE'/>
  <mtu size='1500'/>
  <protocol family='ipv6'>
    <dhcp/>
    <ip address='2001:db8:ca2:2::1' prefix='64'/>
  </protocol>
</interface>

[root@rhel6 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
HWADDR=00:1B:21:27:4E:CE
ONBOOT=no
MTU=1500
IPV6INIT=yes
IPV6_AUTOCONF=no
DHCPV6=yes
IPV6ADDR=2001:db8:ca2:2::1/64

Actual results:
As shown above steps, the ifcfg-eth1 was set DHCPV6=yes and IPV6ADDR=2001:db8:ca2:2::1/64 concurrently for ipv6 options.

Expected results:
libvirt need check both two options before iface-define, iface-edit and virt-xml-validate. ipv4 family has no this issue.

Comment 2 Ján Tomko 2014-07-17 13:06:56 UTC
For ipv4, the combination gets rejected by netcf, because it doesn't match the schema. For ipv6, it accepts both. I don't think libvirt should forbid this, moving to netcf.

Comment 3 Laine Stump 2014-08-13 17:56:51 UTC
There is nothing in the design of DHCP to prevent having a DHCP-provided IP address on the same interface as one or more static IP addresses. However, a short experiment with IPv4 on a system running NetworkManager shows that this is silently not supported for IPv4. I don't currently have the proper setup to test it for IPv6 so I can't say for certain if IPv6 suffers the same problem - this is all a long winded way of saying that I don't think allowing this is a bug, but can't verify it with enough certainty to close the report right now.

Comment 6 Laine Stump 2015-03-30 21:08:46 UTC
I think the commit log of the patch I've posted upstream explains the situation fairly well (this patch hasn't yet been pushed - it is pending review):

Author: Laine Stump <laine>
Date:   Mon Mar 30 16:20:19 2015 -0400

    Allow IPv4 static addresses simultaneous with DHCP
    
    Because initscripts network startup ends up ignoring static IPv4
    addresses when dhcp is enabled (BOOTPROTO=dhcp in the ifcfg file) and
    because at least some of the frontends to Network Manager disable
    configuring a static address if dhcp is enabled (and likely due to
    other indications, but this all happened far in the past...) netcf has
    always made DHCP and static IP addresses for IPv4 mutually exclusive
    in the config - an interface either had one or it had the other.
    
    A recent BZ filed against libvirt:
    
      https://bugzilla.redhat.com/show_bug.cgi?id=1113983
    
    suggested that we should also forbid simultaneous DHCP and static IPs
    for IPv6, but investigation shows the following:
    
    1) there is nothing inherent in the DHCP protocol that precludes
    having both a single DHCP address and one or more static IP addresses
    from each protocol (as well as an IPv6 address learned via IPv6
    autoconf). Even the lead NetworkManager developer says this in an
    email response to a question posed on the dnsmasq mailing list:
    
      http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2015q1/009346.html
    
    2) Different networking backends currently properly support different
    combinations of these address types for the two platforms (for
    example, NetworkManager 0.9.10.2 on Fedora 21 will properly acquire a
    DHCPv4 address to live alongside multiple static IPv4 addresses while
    initscripts 9.56.7 will discard the static IPs, and initscripts will
    support multiple static IPv6 addresses together with an autoconf
    address, while NetworkManager apparently won't (although this could be
    a configuration error on my part).
    
    In the end, any time that all three address types for IPv6 (autoconf,
    dhcp, static) or two address types for IPv4 (dhcp, static) cannot work
    simultaneously on the same interface, that is a bug in the networking
    backend (e.g. initscripts, NetworkManager), *not* a reason to disallow
    such configurations via netcf.
    
    For that reason, this patch opens up the RNG for the IPv4 protocol,
    allowing <dhcp/> to be specified simultaneously with any number of
    static <ip> elements for IPv4, just as we already did for IPv6. Any
    future failures of such configurations to work properly should result
    in bugs filed against the network backend in use at the time (or
    possibly the dhcp server, or some other piece of infrastructure).

Comment 7 Laine Stump 2015-05-16 00:42:28 UTC
Pushed upstream:

commit 0013d5a2ccf61e58b021feead6ed66813ee50f65
Author: Laine Stump <laine>
Date:   Mon Mar 30 16:20:19 2015 -0400

    Allow IPv4 static addresses simultaneous with DHCP

Comment 11 Hu Jianwei 2015-05-21 09:11:16 UTC
Reproduce it with old version:
[root@localhost ~]# rpm -q libvirt netcf
libvirt-1.2.15-2.el7.x86_64
netcf-0.2.6-3.el7.x86_64

[root@localhost ~]# cat eth1.xml 
<interface type='ethernet' name='eth1'>
  <start mode='none'/>
  <mac address='00:1B:21:27:4E:CE'/>
  <mtu size='1500'/>
  <protocol family='ipv4'>
    <dhcp/>
    <ip address='192.168.1.111' prefix='24'/>
  </protocol>
  <protocol family='ipv6'>
    <dhcp/>
    <ip address='2001:db8:ca2:2::1' prefix='64'/>
  </protocol>
</interface>

[root@localhost ~]# virsh iface-define eth1.xml
error: Failed to define interface from eth1.xml
error: XML error: could not get interface XML description: XML invalid - Extra element protocol in interleave

[root@localhost ~]# ncftool define eth1.xml 
error: XML invalid
error: Extra element protocol in interleave

Verified as below:
[root@localhost ~]# rpm -q libvirt netcf
libvirt-1.2.15-2.el7.x86_64
netcf-0.2.8-1.el7.x86_64
[root@localhost ~]# 
[root@localhost ~]# 
[root@localhost ~]# cat eth1.xml 
<interface type='ethernet' name='eth1'>
  <start mode='none'/>
  <mac address='00:1B:21:27:4E:CE'/>
  <mtu size='1500'/>
  <protocol family='ipv4'>
    <dhcp/>
    <ip address='192.168.1.111' prefix='24'/>
  </protocol>
  <protocol family='ipv6'>
    <dhcp/>
    <ip address='2001:db8:ca2:2::1' prefix='64'/>
  </protocol>
</interface>
[root@localhost ~]# virsh iface-define eth1.xml
Interface eth1 defined from eth1.xml

[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1 
DEVICE="eth1"
HWADDR="00:1B:21:27:4E:CE"
ONBOOT="no"
MTU="1500"
BOOTPROTO="dhcp"
IPADDR="192.168.1.111"
NETMASK="255.255.255.0"
IPV6INIT="yes"
IPV6_AUTOCONF="no"
DHCPV6C="yes"
IPV6ADDR="2001:db8:ca2:2::1/64"
[root@localhost ~]# 
[root@localhost ~]# virsh iface-undefine eth1
Interface eth1 undefined

[root@localhost ~]# ncftool define eth1.xml 
Defined interface eth1
[root@localhost ~]# 
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1 
DEVICE="eth1"
HWADDR="00:1B:21:27:4E:CE"
ONBOOT="no"
MTU="1500"
BOOTPROTO="dhcp"
IPADDR="192.168.1.111"
NETMASK="255.255.255.0"
IPV6INIT="yes"
IPV6_AUTOCONF="no"
DHCPV6C="yes"
IPV6ADDR="2001:db8:ca2:2::1/64"

netcf can configure with both DHCPv4 and static IPv4 addresses.

Comment 14 errata-xmlrpc 2015-11-19 08:58:16 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2015-2248.html


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