[2.0] MAAS enabling DHCP against the wrong interface

Bug #1551378 reported by Andres Rodriguez
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Critical
Blake Rouse

Bug Description

I used the following commands to enable DHCP:

# add a subnet because it wasn't automatically added.
maas admin subnets create cidr=192.168.122.1/24 gateway_ip=192.168.122.1

# create an ip range whree to provide DHCP
maas admin ipranges create type=dynamic start_ip=192.168.122.10 end_ip=192.168.122.100

# add an interface to rack controller, because it wasn't automatically added.
maas admin interfaces create-physical 4y3h7n name=virbr0 mac_address=52:54:00:d3:1a:ac vlan=1

# link an interface to a subnet.
maas admin interface link-subnet 4y3h7n virbr0 mode=static ip_address=192.168.122.1 subnet=192.168.122.1/24

# enable dhcp.
- Went to the WebUI to enable DHCP in the primary rack!

This should have enabled DHCP on virbr0, unfortunately, the config file below was enabled against 'wlan0'

=============================================

virbr0 Physical 192.168.122.1 (Static assign)
virbr1 Physical (Unconfigured)
wlan0 Physical (Unconfigured)

=============================================

Feb 29 13:29:36 unleashed systemd[1]: Starting MAAS instance of ISC DHCP server for IPv4...
Feb 29 13:29:36 unleashed systemd[1]: Started MAAS instance of ISC DHCP server for IPv4.
Feb 29 13:29:36 unleashed dhcpd[26917]: WARNING: Host declarations are global. They are not limited to the scope you declared them in.
Feb 29 13:29:36 unleashed dhcpd[26917]: Wrote 0 class decls to leases file.
Feb 29 13:29:36 unleashed dhcpd[26917]: Wrote 0 deleted host decls to leases file.
Feb 29 13:29:36 unleashed dhcpd[26917]: Wrote 0 new dynamic host decls to leases file.
Feb 29 13:29:36 unleashed dhcpd[26917]: Wrote 0 leases to leases file.
Feb 29 13:29:36 unleashed systemd[1]: maas-dhcpd.service: Main process exited, code=exited, status=1/FAILURE
Feb 29 13:29:36 unleashed systemd[1]: maas-dhcpd.service: Unit entered failed state.
Feb 29 13:29:36 unleashed systemd[1]: maas-dhcpd.service: Failed with result 'exit-code'.

==========================================================================

Feb 29 13:41:56 unleashed sh[12568]: 2016-02-29 13:41:56 [-] 127.0.0.1 - - [29/Feb/2016:18:41:56 +0000] "GET /MAAS/rpc/ HTTP/1.0" 200 596 "-" "provisioningserver.rpc.clusterservice.ClusterClientService"
Feb 29 13:41:57 unleashed systemd[1]: Starting MAAS instance of ISC DHCP server for IPv4...
Feb 29 13:41:57 unleashed systemd[1]: Started MAAS instance of ISC DHCP server for IPv4.
Feb 29 13:41:57 unleashed dhcpd[9817]: Wrote 0 class decls to leases file.
Feb 29 13:41:57 unleashed dhcpd[9817]: Wrote 0 deleted host decls to leases file.
Feb 29 13:41:57 unleashed dhcpd[9817]: Wrote 0 new dynamic host decls to leases file.
Feb 29 13:41:57 unleashed dhcpd[9817]: Wrote 0 leases to leases file.
Feb 29 13:41:57 unleashed dhcpd[9817]:
Feb 29 13:41:57 unleashed dhcpd[9817]: No subnet declaration for wlan0 (192.168.1.72).
Feb 29 13:41:57 unleashed dhcpd[9817]: ** Ignoring requests on wlan0. If this is not what
Feb 29 13:41:57 unleashed dhcpd[9817]: you want, please write a subnet declaration
Feb 29 13:41:57 unleashed dhcpd[9817]: in your dhcpd.conf file for the network segment
Feb 29 13:41:57 unleashed dhcpd[9817]: to which interface wlan0 is attached. **
Feb 29 13:41:57 unleashed dhcpd[9817]:
Feb 29 13:41:57 unleashed dhcpd[9817]:
Feb 29 13:41:57 unleashed dhcpd[9817]: Not configured to listen on any interfaces!
Feb 29 13:41:57 unleashed dhcpd[9817]:
Feb 29 13:41:57 unleashed dhcpd[9817]: If you think you have received this message due to a bug rather
Feb 29 13:41:57 unleashed dhcpd[9817]: than a configuration issue please read the section on submitting
Feb 29 13:41:57 unleashed dhcpd[9817]: bugs on either our web page at www.isc.org or in the README file
Feb 29 13:41:57 unleashed dhcpd[9817]: before submitting a bug. These pages explain the proper
Feb 29 13:41:57 unleashed dhcpd[9817]: process and the information we find helpful for debugging..
Feb 29 13:41:57 unleashed dhcpd[9817]:
Feb 29 13:41:57 unleashed dhcpd[9817]: exiting.
Feb 29 13:41:57 unleashed systemd[1]: maas-dhcpd.service: Main process exited, code=exited, status=1/FAILURE
Feb 29 13:41:57 unleashed systemd[1]: maas-dhcpd.service: Unit entered failed state.
Feb 29 13:41:57 unleashed systemd[1]: maas-dhcpd.service: Failed with result 'exit-code'.

==========================================================================

# WARNING: Do not edit /var/lib/maas/dhcpd.conf yourself. MAAS will overwrite any
# changes made there.
#
# Instead, edit /etc/maas/templates/dhcp/dhcpd.conf.template and your changes
# will be present whenever MAAS rewrites the DHCP configuration. Update and save
# the cluster's configuration in MAAS to trigger an update to this file.

option arch code 93 = unsigned integer 16; # RFC4578
option path-prefix code 210 = text; #RFC5071
subnet 192.168.122.0 netmask 255.255.255.0 {
       if option arch = 00:07 {
          filename "bootx64.efi";
       } elsif option arch = 00:0C {
          filename "bootppc64.bin";
       } elsif option arch = 00:0B {
          filename "grubaa64.efi";
       } elsif option arch = 00:0E {
          filename "pxelinux.0";
          option path-prefix "b'ppc64el/'";
       } else {
          filename "pxelinux.0";
       }
       interface "wlan0";
       ignore-client-uids true;
       option subnet-mask 255.255.255.0;
       option broadcast-address 192.168.122.255;
       option domain-name-servers 192.168.1.72;
       option domain-name "maas";
       option routers 192.168.122.1;
       option ntp-servers ntp.ubuntu.com;
       class "PXE" {
          match if substring (option vendor-class-identifier, 0, 3) = "PXE";
          default-lease-time 30;
          max-lease-time 30;
       }

       pool {
          range 192.168.122.10 192.168.122.100;
       }

       on commit {
          set clhw = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
          set clip = binary-to-ascii(10, 8, ".", leased-address);
          set cllt = binary-to-ascii(10, 32, "", encode-int(lease-time, 32));
          set clht = pick-first-value(option host-name, "(none)");
          execute(
              "sudo", "maas-provision", "dhcp-notify",
              "--action", "commit", "--mac", clhw,
              "--ip-family", "ipv4", "--ip", clip,
              "--lease-time", cllt, "--hostname", clht);
       }

       on expiry {
          set clhw = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
          set clip = binary-to-ascii(10, 8, ".", leased-address);
          execute(
              "sudo", "maas-provision", "dhcp-notify",
              "--action", "expiry", "--mac", clhw,
              "--ip-family", "ipv4", "--ip", clip);
       }

       on release {
          set clhw = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
          set clip = binary-to-ascii(10, 8, ".", leased-address);
          execute(
              "sudo", "maas-provision", "dhcp-notify",
              "--action", "release", "--mac", clhw,
              "--ip-family", "ipv4", "--ip", clip);
       }

       host unleashed-virbr0 {
          hardware ethernet 52:54:00:d3:1a:ac;
          fixed-address 192.168.122.1;
       }
}

omapi-port 7911;
key omapi_key {
    algorithm HMAC-MD5;
    secret "E3h7s8W18yUFBwhyeF6f0b8r5kO5Xwc5O/4PShFrYCAUrV2SVHN0aG4tGv1eCn+YGEjuAZHXWl/urTwKBgGbWA==";
};
omapi-key omapi_key;

Related branches

Changed in maas:
milestone: none → 2.0.0
importance: Undecided → Critical
description: updated
description: updated
summary: - maas-dhcpd is not started after enabling DHCP
+ MAAS enabling DHCP against the wrong interface
description: updated
summary: - MAAS enabling DHCP against the wrong interface
+ [2.0] MAAS enabling DHCP against the wrong interface
description: updated
description: updated
Changed in maas:
assignee: nobody → Blake Rouse (blake-rouse)
Changed in maas:
status: New → In Progress
Changed in maas:
status: In Progress → Fix Committed
Changed in maas:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.