[Kimchi-devel] [PATCH] [Kimchi 1/5] Fix range for network of NAT and isolated types.

pvital at linux.vnet.ibm.com pvital at linux.vnet.ibm.com
Sat Dec 5 19:22:32 UTC 2015


From: Paulo Vital <pvital at linux.vnet.ibm.com>

The calculations to create the range of IP addresses when creating a virtual
network of NAT and isolated types, was discounting only 2 number of hosts
when it's necessary to discount 3 to not use the broadcast address as possible
address.

This fix, solves the Libvirt error:
"end of range 192.168.0.129 - 192.168.0.255 in network 192.168.0.1/24 is the
broadcast address"

Signed-off-by: Paulo Vital <pvital at linux.vnet.ibm.com>
---
 model/networks.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/model/networks.py b/model/networks.py
index 2856291..d0186a7 100644
--- a/model/networks.py
+++ b/model/networks.py
@@ -143,7 +143,7 @@ class NetworksModel(object):
             ip.ip = ip.ip + 1
 
         dhcp_start = str(ip.ip + ip.numhosts / 2)
-        dhcp_end = str(ip.ip + ip.numhosts - 2)
+        dhcp_end = str(ip.ip + ip.numhosts - 3)
         params.update({'net': str(ip),
                        'dhcp': {'range': {'start': dhcp_start,
                                 'end': dhcp_end}}})
-- 
2.5.0




More information about the Kimchi-devel mailing list