Author Topic: DHCP Server Multiple VLANs  (Read 2525 times)

Durkensa

  • Zen Apprentice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
DHCP Server Multiple VLANs
« on: August 22, 2019, 03:29:21 am »
Can Zentyal only do DHCP on the internal interface when it has an IP on? I want to use it as and DHCP server for multiple VLANs from a Core switch that relay teh request t Zentyal that will the assign the IP addresses for each VLAN. From the documentation it looks like Zentyal can't be a DCHP server without an IP address in the subnet on a interface locally?

If there is any way of doing this please let me know. 

doncamilo

  • Zen Samurai
  • ****
  • Posts: 478
  • Karma: +165/-1
    • View Profile
Re: DHCP Server Multiple VLANs
« Reply #1 on: August 22, 2019, 10:51:54 am »
 :)

Hi!

Zentyal implements a VLAN trunk type interface so, the only needed condition is that it has to have configured an static ip for his interface (documentation https://doc.zentyal.org/en/dhcp.html#dhcp-server-configuration-with-zentyal tell us "The DHCP service needs to be deployed on an interface configured with a static IP address. This interface should also be internal." but, actually the code checks only the static IP condition)

See /usr/share/perl5/EBox/DHCP.pm

Code: [Select]
sub defaultGateway # (iface)
{
    my ($self, $iface) = @_;

    my $network = $self->global()->modInstance('network');

    #if iface doesn't exists throw exception
    if (not $iface or not $network->ifaceExists($iface)) {
        throw EBox::Exceptions::DataNotFound(data => __('Interface'),
                value => $iface);
    }

    #if iface is not static, throw exception
    if($network->ifaceMethod($iface) ne 'static') {
        throw EBox::Exceptions::External(__x("{iface} is not static",
            iface => $iface));
    }

    return $self->_getModel('Options', $iface)->defaultGateway();
})

You shouldn't have problems.

Cheers!
- Do my pigeons bother you passing over your land?
- They block the sun!

G. Guareschi., Don Camillo.,