Run dhcpd service on multiple interfaces

MAAS : 3.1.0~beta5

We would like to run the MAAS provided dhcpd service on multiple interfaces, instead of just one or even just change the interface it runs on.

Details

Originally, we had one interface eno1 and MAAS worked very well with it. Adding VLANs to our network topology, seems to break MAAS dhcpd service. The Netplan configurations for both these scenarios are given below.

# Original Configuration MAAS likes
network:
  ethernets:
    eno1:
      addresses: [10.40.1.1/16]
      nameservers:
        addresses: []
        search: []
  version: 2
# New Netplan configuration MAAS Dislikes
network:
  ethernets:
    eno1:
  vlans:
    vcluster:
    id: 40
    link: eno1
    addresses: [10.40.1.1/16]
    vfpga:
      id: 60
      link: eno1
      addresses: [10.60.1.1/16]
    vdata:
      id: 50
      link: eno1
      addresses: [10.50.1.1/16]
  version: 2

More Details

MAAS continuously overwrites the file /var/snap/maas/common/maas/dhcpd-interfaces with the old interface and also references it explicitly when starting the dhcpd service.

#Contents of /snap/maas/current/bin/run-dhcpd

...

DHCP_DIR="$SNAP_COMMON/maas/dhcp"
DHCP_CONFIG="$SNAP_COMMON/maas/dhcpd.conf"
INTERFACES_FILE="$SNAP_COMMON/maas/dhcpd-interfaces"
LEASES_FILE="$SNAP_COMMON/maas/dhcp/dhcpd.leases"

...

INTERFACES=$(cat "$INTERFACES_FILE")
# shellcheck disable=SC2086
exec "$SNAP/usr/sbin/dhcpd" -f -4 -pf "$DHCP_DIR/dhcpd.pid" -cf "$DHCP_CONFIG" -lf "$LEASES_FILE" $INTERFACES

Questions

  • Where is this eno1 value in the dhcpd-interfaces coming from?
  • Can we change it to use multiple interfaces?
  • Are there technical reasons as why this is not possible?
  • As a last resort, is it advisable to just manually change run-dhcpd file?

Hi there @shinybrar,
So MAAS’ dhcpd does in fact listen on multiple interfaces. It listens on a given interface when you enable MAAS’ dhcp for a given vlan that the interface in question is configured for. You can see what interface is configured for which vlan in the rack controller’s network tab. Once you’ve identified which VLAN is paired with each interface, you can go to MAAS’ subnets tab, select the VLAN, and enable DHCP for that given VLAN. At which point, you should that interface within dhcpd-interfaces and see DHCP now being handled by MAAS for that VLAN.

@cgrabowski For the solution you proposed, all the interfaces need to configured before the rack controller is activated. Is that correct to assume?

Is it possible to add interfaces to a rack controller post initialization?

All interfaces need to be present at the start of the maas-rackd process, this will collect the necessary info, which also means that process can be restarted if a new interface has been added. As to which fabric and VLAN said interface is within, that can be configured in the rack controller tab.

Hello @cgrabowski,

Apologies on the delay in replying. But I looked at your suggested actions and tried to follow them to the tee, but we cannot seem to get MAAS provided DHCP run on multiple VLANS.

Shown below is the configuration of the system, with specific directed questions:

MAAS Version: 3.1.0

Netplan Configuration

Here is the netplan configuration of the node which runs the rackd process

network:
  ethernets:
    eno1:
      addresses: [10.40.1.1/16]
      nameservers:
        addresses: []
        search: []
    eno2:
      addresses:
      - <REDACTED>/24
      gateway4: <REDACTED>
      nameservers:
        addresses:
        - 127.0.0.1
        search:
        - mcgill.ca
        - allenby
        - maas
  vlans:
    vlan-fpga:
      id: 60
      link: eno1
      addresses: [10.60.1.1/16]
    vlan-data:
      id: 50
      link: eno1
      addresses: [10.50.1.1/16]
  version: 2

Questions

  • Is the Netplan configuration look sound and conforms with what MAAS expects?

DHCP Configuration

  • We want the DHCP server to run on eno1, vlan-data, vlan-fpga interfaces.

  • The interfaces were configured before the rackd process started.

  • All the interfaces are up and running, with valid IP Addresses, as seen in ifconfig

     eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
             inet 10.40.1.1  netmask 255.255.0.0  broadcast 10.40.255.255
             ...
     vlan-data: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
             inet 10.50.1.1  netmask 255.255.0.0  broadcast 10.50.255.255
             ...
     vlan-fpga: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
             inet 10.60.1.1  netmask 255.255.0.0  broadcast 10.60.255.255
             ....
    
  • However when the snap runs, it only picks up eno1. Here is the exact command that the snap runs

    /snap/maas/17694/usr/sbin/dhcpd -f -4 -pf /var/snap/maas/common/maas/dhcp/dhcpd.pid -cf /var/snap/maas/common/maas/dhcpd.conf -lf /var/snap/maas/common/maas/dhcp/dhcpd.leases eno1
    
  • The interfaces also don’t show up on the Network tab for the Rack Controller. Only the 10.40.x.x interfaces mapping to eno1 shows up.

Questions

  • We feel like we are missing something quite obvious or we have encountered a possible bug in the system?
  • Is there something else we can try?

I am also tagging @anton5mith for added visibility, since this was issue was an action item from our meeting.

@shinybrar - I think you need to raise a bug for this in LP please.