From 03daacce56674cdf12081d52d1d61b919b3fb268 Mon Sep 17 00:00:00 2001 From: Benjamin Bertrand <benjamin.bertrand@esss.se> Date: Fri, 16 Mar 2018 13:43:53 +0100 Subject: [PATCH] Fix default available IPs We should reserve 10 addresses at the beginning and 5 at the end. Meaning for a /24 network, we should start at 11 and end at 249. --- app/network/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/network/views.py b/app/network/views.py index 258c680..a4e8da9 100644 --- a/app/network/views.py +++ b/app/network/views.py @@ -415,9 +415,9 @@ def retrieve_ips(subnet, prefix): data = {'ips': [], 'first': '', 'last': ''} else: hosts = [str(ip) for ip in address.hosts()] - if len(hosts) > 15: - first = hosts[9] - last = hosts[-5] + if len(hosts) > 17: + first = hosts[10] + last = hosts[-6] else: first = hosts[0] last = hosts[-1] -- GitLab