Bug 1497395

Summary: client get ipv6 address which do not in the dnsmasq dhcp range
Product: Red Hat Enterprise Linux 7 Reporter: yalzhang <yalzhang>
Component: dnsmasqAssignee: Petr Menšík <pemensik>
Status: CLOSED WONTFIX QA Contact: qe-baseos-daemons
Severity: medium Docs Contact:
Priority: low    
Version: 7.4CC: thozza, yalzhang
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-05-27 14:33:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1534569    
Attachments:
Description Flags
the output from "# tcpdump ip6 -i virbr1" none

Description yalzhang@redhat.com 2017-09-30 05:31:52 UTC
Description of problem:
client get ipv6 address which do not in the dnsmasq dhcp range.

Version-Release number of selected component (if applicable):
# rpm -q libvirt dnsmasq
libvirt-3.7.0-2.el7.x86_64
dnsmasq-2.76-4.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. As libvirt use dnsmasq as a dhcp server, start a guest connected to a network 'net', the guest can get  ipv6 address which in the defined range.
# virsh net-dumpxml net
<network connections='1' ipv6='yes'>
  <name>net</name>
  <uuid>ca9ea2a9-eed4-431d-b281-90458b7d83ea</uuid>
  <forward mode='nat'>
    <nat>
      <port start='1024' end='65535'/>
    </nat>
  </forward>
  <bridge name='virbr1' stp='on' delay='0'/>
  <mac address='52:54:00:7a:9e:b1'/>
  <ip address='192.168.100.1' netmask='255.255.255.0'>
  </ip>
  <ip family='ipv6' address='2001:db8:ca2:2::1' prefix='64'>
    <dhcp>
      <range start='2001:db8:ca2:2:5::100' end='2001:db8:ca2:2:5::1ff'/>
    </dhcp>
  </ip>
</network>

# ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 2001:db8:ca2:2:5::1e7  prefixlen 64  scopeid 0x0<global>
        inet6 fe80::5054:ff:fe7b:5191  prefixlen 64  scopeid 0x20<link>
        ether 52:54:00:7b:51:91  txqueuelen 1000  (Ethernet)

# cat /var/lib/libvirt/dnsmasq/net.conf
##WARNING:  THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
##OVERWRITTEN AND LOST.  Changes to this configuration should be made using:
##    virsh net-edit net
## or other application using the libvirt API.
##
## dnsmasq conf file created by libvirt
strict-order
pid-file=/var/run/libvirt/network/net.pid
except-interface=lo
bind-dynamic
interface=virbr1
dhcp-range=2001:db8:ca2:2:5::100,2001:db8:ca2:2:5::1ff,64
dhcp-lease-max=256
dhcp-hostsfile=/var/lib/libvirt/dnsmasq/net.hostsfile
addn-hosts=/var/lib/libvirt/dnsmasq/net.addnhosts
enable-ra

2.  destroy the 'dhcp server' and 'client' for step 3 to make the changes.
# virsh destroy yal; virsh net-destroy net
Domain yal destroyed

Network net destroyed


3. change the ipv6 ip-dhcp-range for the network, then start the network and vm

# virsh net-start net; virsh net-dumpxml net
Network net started

<network ipv6='yes'>
  <name>net</name>
  <uuid>ca9ea2a9-eed4-431d-b281-90458b7d83ea</uuid>
  <forward mode='nat'>
    <nat>
      <port start='1024' end='65535'/>
    </nat>
  </forward>
  <bridge name='virbr1' stp='on' delay='0'/>
  <mac address='52:54:00:7a:9e:b1'/>
  <ip address='192.168.100.1' netmask='255.255.255.0'>
  </ip>
  <ip family='ipv6' address='2001:db8:ca2:2::1' prefix='64'>
    <dhcp>
      <range start='2001:db8:ca2:2:7::200' end='2001:db8:ca2:2:7::2ff'/>
    </dhcp>
  </ip>
</network>

# virsh start yal
Domain yal started

# cat /var/lib/libvirt/dnsmasq/net.conf
##WARNING:  THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
##OVERWRITTEN AND LOST.  Changes to this configuration should be made using:
##    virsh net-edit net
## or other application using the libvirt API.
##
## dnsmasq conf file created by libvirt
strict-order
pid-file=/var/run/libvirt/network/net.pid
except-interface=lo
bind-dynamic
interface=virbr1
dhcp-range=2001:db8:ca2:2:7::200,2001:db8:ca2:2:7::2ff,64
dhcp-lease-max=256
dhcp-hostsfile=/var/lib/libvirt/dnsmasq/net.hostsfile
addn-hosts=/var/lib/libvirt/dnsmasq/net.addnhosts
enable-ra


4. log in guest and check the ipv6 address do not change, but it is not in the current range
# ifconfig -a
eth0: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether 52:54:00:7b:51:91  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
....
# dhclient -6 
# ifconfig 
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 2001:db8:ca2:2:5::1e7  prefixlen 64  scopeid 0x0<global>
        inet6 fe80::5054:ff:fe7b:5191  prefixlen 64  scopeid 0x20<link>
        ether 52:54:00:7b:51:91  txqueuelen 1000  (Ethernet)

Actual results:
client get ipv6 address which do not in the current dnsmasq dhcp range.

Expected results:
the guest should get a ipv6 address in the range of  "<range start='2001:db8:ca2:2:7::200' end='2001:db8:ca2:2:7::2ff'/>"

Additional info:
It seems the guest or host will remember what he has got or allocated last time until the lease time even the range changed.

Comment 2 yalzhang@redhat.com 2017-09-30 05:34:23 UTC
Created attachment 1332574 [details]
the output from "# tcpdump ip6  -i virbr1"

Comment 7 RHEL Program Management 2020-05-27 14:33:32 UTC
Development Management has reviewed and declined this request. You may appeal this decision by using your Red Hat support channels, who will make certain  the issue receives the proper prioritization with product and development management.

https://www.redhat.com/support/process/production/#howto