libvirt/tests/networkxml2confdata
Laine Stump 82fe58ff26 network: add netmask to dhcp range of dnsmasq conf file for IPv4
dnsmasq documentation says that the *IPv4* prefix/network
address/broadcast address sent to dhcp clients will be automatically
determined by dnsmasq by looking at the interface it's listening on,
so the original libvirt code did not add a netmask to the dnsmasq
commandline (or later, the dnsmasq conf file).

For *IPv6* however, dnsmasq apparently cannot automatically determine
the prefix (functionally the same as a netmask), and it must be
explicitly provided in the conf file (as a part of the dhcp-range
option). So many years after IPv4 DHCP support had been added, when
IPv6 dhcp support was added the prefix was included at the end of the
dhcp-range setting, but only for IPv6.

A user had reported a bug on a host where one of the interfaces was a
superset of the libvirt network where dhcp is needed (e.g., the host's
ethernet is 10.0.0.20/8, and the libvirt network is 10.10.0.1/24). For
some reason dnsmasq was supplying the netmask for the /8 network to
clients requesting an address on the /24 interface.

This seems like a bug in dnsmasq, but even if/when it gets fixed
there, it looks like there is no harm in just always adding the
netmask to all IPv4 dhcp-range options similar to how prefix is added
to all IPv6 dhcp-range options.

Signed-off-by: Laine Stump <laine@laine.org>
Reviewed-by: John Ferlan <jferlan@redhat.com>
2019-02-21 13:06:16 -05:00
..
dhcp6-nat-network.conf network: add netmask to dhcp range of dnsmasq conf file for IPv4 2019-02-21 13:06:16 -05:00
dhcp6-nat-network.xml schema: Let elements in /network/ip be specified in any order 2016-12-14 16:20:23 +01:00
dhcp6-network.conf network: fix DHCPv6 on networks with prefix != 64 2016-04-21 15:06:25 -04:00
dhcp6-network.xml
dhcp6host-routed-network.conf network: add dnsmasq option 'dhcp-authoritative' 2016-10-10 15:15:11 -04:00
dhcp6host-routed-network.xml
isolated-network.conf network: add netmask to dhcp range of dnsmasq conf file for IPv4 2019-02-21 13:06:16 -05:00
isolated-network.xml
nat-network-dns-forward-plain.conf
nat-network-dns-forward-plain.xml
nat-network-dns-forwarder-no-resolv.conf network: don't add "no-resolv" if we still need DNS servers from resolv.conf 2017-03-21 11:25:59 -04:00
nat-network-dns-forwarder-no-resolv.xml network: don't add "no-resolv" if we still need DNS servers from resolv.conf 2017-03-21 11:25:59 -04:00
nat-network-dns-forwarders.conf network: don't add "no-resolv" if we still need DNS servers from resolv.conf 2017-03-21 11:25:59 -04:00
nat-network-dns-forwarders.xml network: allow limiting a <forwarder> element to certain domains 2016-08-19 21:34:51 -04:00
nat-network-dns-hosts.conf
nat-network-dns-hosts.xml
nat-network-dns-local-domain.conf network: Let domains be restricted to local DNS 2015-01-20 01:07:18 -05:00
nat-network-dns-local-domain.xml network: Let domains be restricted to local DNS 2015-01-20 01:07:18 -05:00
nat-network-dns-srv-record-minimal.conf network: add netmask to dhcp range of dnsmasq conf file for IPv4 2019-02-21 13:06:16 -05:00
nat-network-dns-srv-record-minimal.xml
nat-network-dns-srv-record.conf network: add netmask to dhcp range of dnsmasq conf file for IPv4 2019-02-21 13:06:16 -05:00
nat-network-dns-srv-record.xml network: fix problems with SRV records 2014-03-26 16:42:43 +02:00
nat-network-dns-txt-record.conf network: add netmask to dhcp range of dnsmasq conf file for IPv4 2019-02-21 13:06:16 -05:00
nat-network-dns-txt-record.xml
nat-network-mtu.conf network: add netmask to dhcp range of dnsmasq conf file for IPv4 2019-02-21 13:06:16 -05:00
nat-network-mtu.xml network: set mtu as a DHCP option when specified 2019-01-31 17:45:41 +01:00
nat-network-name-with-quotes.conf network: add netmask to dhcp range of dnsmasq conf file for IPv4 2019-02-21 13:06:16 -05:00
nat-network-name-with-quotes.xml network: escape quotes for dsmasq conf contents 2015-06-09 13:56:00 -04:00
nat-network.conf network: add netmask to dhcp range of dnsmasq conf file for IPv4 2019-02-21 13:06:16 -05:00
nat-network.xml
netboot-network.conf network: add netmask to dhcp range of dnsmasq conf file for IPv4 2019-02-21 13:06:16 -05:00
netboot-network.xml schema: Let elements in /network/ip be specified in any order 2016-12-14 16:20:23 +01:00
netboot-proxy-network.conf network: add netmask to dhcp range of dnsmasq conf file for IPv4 2019-02-21 13:06:16 -05:00
netboot-proxy-network.xml
open-network.conf network: new network forward mode 'open' 2016-08-19 21:05:15 -04:00
open-network.xml network: new network forward mode 'open' 2016-08-19 21:05:15 -04:00
ptr-domains-auto.conf network: add netmask to dhcp range of dnsmasq conf file for IPv4 2019-02-21 13:06:16 -05:00
ptr-domains-auto.xml network: Add support for local PTR domains 2016-12-19 09:03:29 +01:00
routed-network-no-dns.conf network: allow disabling dnsmasq's DNS server 2016-08-19 21:10:34 -04:00
routed-network-no-dns.xml network: allow disabling dnsmasq's DNS server 2016-08-19 21:10:34 -04:00
routed-network.conf network: change default of forwardPlainNames to 'yes' 2014-02-04 12:00:26 +02:00
routed-network.xml