'Start the dhcp server
:param self: An AccessPoint object
:type self: AccessPoint
:return: None
:rtype: None'

def start_dhcp_dns(self):

    config = 'no-resolv\ninterface=%s\ndhcp-range=%s\n'
    with open('/tmp/dhcpd.conf', 'w') as dhcpconf:
        dhcpconf.write((config % (self.interface, constants.DHCP_LEASE)))
    with open('/tmp/dhcpd.conf', 'a+') as dhcpconf:
        if self.internet_interface:
            dhcpconf.write(('server=%s' % (constants.PUBLIC_DNS,)))
        else:
            dhcpconf.write(('address=/#/%s' % (constants.NETWORK_GW_IP,)))
    subprocess.Popen(['dnsmasq', '-C', '/tmp/dhcpd.conf'], stdout=subprocess.PIPE, stderr=constants.DN)
    subprocess.Popen(['ifconfig', str(self.interface), 'mtu', '1400'], stdout=constants.DN, stderr=constants.DN)
    subprocess.Popen(['ifconfig', str(self.interface), 'up', constants.NETWORK_GW_IP, 'netmask', constants.NETWORK_MASK], stdout=constants.DN, stderr=constants.DN)
    time.sleep(0.5)
    proc = subprocess.check_output(['ifconfig', str(self.interface)])
    if (constants.NETWORK_GW_IP not in proc):
        return False
    subprocess.call(('route    add    -net    %s    netmask    %s    gw    %s' % (constants.NETWORK_IP, constants.NETWORK_MASK, constants.NETWORK_GW_IP)), shell=True)
