DNSMasq as DHCP server

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 02:44, 15 February 2007 (edit)
Whiteboy (Talk | contribs)

← Previous diff
Revision as of 02:44, 15 February 2007 (edit) (undo)
Whiteboy (Talk | contribs)
Next diff →
Line 85: Line 85:
=References= =References=
http://blog.ptch.de/index.php?/archives/33-WRT54G-DNSMasq-als-DHCPD.html http://blog.ptch.de/index.php?/archives/33-WRT54G-DNSMasq-als-DHCPD.html
-[[Category:basic HOWTO]] 
[[Category:English documentation]] [[Category:English documentation]]
 +[[Category:Basic tutorials]]

Revision as of 02:44, 15 February 2007

DD-WRT supports using DNSMasq "as local DNS server" and also uses the DHCP service "udhcpd". This is a waste of RAM (router has 16MB total and only 3MB free). With DNSMasq as the sole DHCP server you can save 300kB (udhcpd deactivated!). With this savings you can create one more PPTP tunnel with the inserted PPTPD server.

There are two ways to accomplish this

  • Using the Web-Interface (for beginners who want to use the default options)
  • Using DNSMasq parameters (for advanced users who can understand dnsmasq.conf file layout, and know where to find the manual page for it)

You can NOT use both



Using Web-Admin

This is the easiest way to setup DNSMasq as DHCP Server

  • Go to your Web-Interface and log in
  • Go to Setup->Basic Setup
    • Make sure that
      • DHCP Type = DHCP Server
      • DHCP Server = enabled
      • Use DNSMasq for DHCP = checked


  • Go to Administration->Services
    • Make sure that
      • DHCP Daemon = enabled
  • You can add static allocations the same way when you're using DHCPd


DNSMasq parameters

This provides access to more functionality at the expense of not being able to use the structured web interface.

Following steps are necessary:

  • Deactivate the DHCPD service on the "Setup" page.
  • Under the "Administration" tab in the "Services" sub tab, you will find a "DNSMasq" section. Enable "DNSMasq", and "Local DNS", then under "Additional DNS Options", you need to set some parameters.
 * To setup the default options for Dynamic IP Allocation, add:
 * To setup machines to have a Static IP assigned by the router, add either:

AB:CD:EF:11:22:33 is the MAC of the network, computername is the NetBIOS name of the computer on the network, indicates the desired IP, and finally 24h the DHCP lease of 24 hours, however if you wish to have the lease for the machine never expire, you may do so by changing 24h to infinite.

If it's not possible to assign an IP with DNSMasq and you want to identify devices via name resolution, you must add the following lines:


You must also add this computer to /tmp/hosts: printers drucker.lan 

Extra DNSMasq options

There are some extra options you can set by entering them in Additional DNS Options

If you are using the Web-Admin method then you can enter additional options in the Administration/Management tab under Additional DHCPD Options

ISP DNS-Servers

If you wish to pass through the DNS servers from your ISP, you can use the following parameters:


x.x.x.x = DNS1
y.y.y.y = DNS2

Denying DHCP service to specific MAC addresses

You can ignore requests from specific MAC addresses, so that no IP address will be leased to those specific MAC addresses/machines


11:22:33:44:55:66 = MAC address of the machine you wish to ignore

Disable NetBIOS over TCP/IP

Since DNSMasq acting as a local DNS server suitably takes care of host name resolution, disabling NetBT on appropriately configured Microsoft DHCP clients, such as Windows 2000 and XP, can be accomplished with the following:


External Links

http://www.faqs.org/rfcs/rfc2132.html Options on MAC addresses