Commit 59af5705 by Bach Dániel

firewall: remove hardcoded prefix

parent eb9047bb
......@@ -278,6 +278,12 @@ class Vlan(AclBase, models.Model):
'valid address of the subnet, '
'for example '
'10.4.255.254/16 for 10.4.0.0/16.'))
host_ipv6_prefixlen = models.IntegerField(
verbose_name=_('IPv6 prefixlen/host'),
help_text=_('The prefix length of the subnet assigned to a host. '
'For example /112 = 65536 addresses/host.'),
default=112,
validators=[MinValueValidator(1), MaxValueValidator(128)])
network6 = IPNetworkField(unique=False,
version=6,
null=True,
......@@ -511,7 +517,7 @@ class Host(models.Model):
def ipv6_with_prefixlen(self):
try:
net = IPNetwork(self.ipv6)
net.prefixlen = 112
net.prefixlen = self.vlan.host_ipv6_prefixlen
return net
except TypeError:
return None
......
......@@ -234,6 +234,7 @@ class VlanForm(ModelForm):
'IPv6',
'network6',
'ipv6_template',
'host_ipv6_prefixlen',
),
Fieldset(
'Domain name service',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment