DNSMasq as DHCP server
From DD-WRT Wiki
Revision as of 22:08, 18 February 2006 (edit) 209.66.124.150 (Talk) ← Previous diff |
Revision as of 22:43, 18 February 2006 (edit) (undo) Joshua7878 (Talk | contribs) Next diff → |
||
Line 1: | Line 1: | ||
+ | __TOC__ | ||
+ | |||
=Introduction= | =Introduction= | ||
DD-WRT supports using DNSMasq "as local DNS server" and in additional also uses the DHCP service "udhcpd". This is a waste of RAM (router has 16MB total and only 3MB free). | DD-WRT supports using DNSMasq "as local DNS server" and in additional also uses the DHCP service "udhcpd". This is a waste of RAM (router has 16MB total and only 3MB free). | ||
Line 8: | Line 10: | ||
*Using DMSMasq parameters | *Using DMSMasq parameters | ||
'''You can NOT use both''' | '''You can NOT use both''' | ||
- | + | ||
+ | =Setting it up= | ||
+ | |||
+ | ==Using Web-Admin== | ||
+ | This is the easiest way to setup DNSMasq as DHCP Server | ||
+ | |||
+ | |||
+ | *Go to your Web-Interfaceand log in | ||
+ | *Go to Setup->Basic Setup | ||
+ | **Make sure that | ||
+ | ***'''DHCP Type''' = DHCP Server | ||
+ | ***'''DHCP Server''' = enabled | ||
+ | ***'''Use DNSMasq for DHCP''' = checked | ||
+ | |||
+ | |||
+ | [[Image:Setup_basic_dhcp.jpg]] | ||
+ | |||
+ | |||
+ | *Go to Administration->Services | ||
+ | **Make sure that | ||
+ | ***'''DHCP Daemon''' = enabled | ||
+ | *You can add static allocations the same way when you're using DHCPd | ||
+ | |||
+ | |||
+ | [[Image:Administration_services_dhcpd.jpg]] | ||
+ | |||
+ | |||
+ | ==Using DNSMasq parameters== | ||
+ | Following steps are necessary: | ||
+ | |||
+ | *deactivate the DHCPD service on the "Setup" page. | ||
+ | |||
+ | *add in the options of the DNSMasq under "administration" (this must be also activated): | ||
+ | |||
+ | dhcp-range=192.168.0.100,192.168.0.150,255.255.255.0,12h | ||
+ | |||
+ | |||
+ | Static allocation: | ||
+ | |||
+ | dhcp-host=AB:CD:EF:11:22:33,192.168.0.10,host,host.domain,12h | ||
+ | |||
+ | |||
+ | AB:CD:EF:11:22:33 is the MAC of the network, 192.168.0.10 will indicate the desired IP, host and host.domain the hostname (e.g. Computer1.lan) and finally 12h the DHCP release of 12 hours. | ||
+ | |||
+ | If you want to identify devices via name resolution and it's not possible to assign an IP with DNSMasq you must add the following lines: | ||
+ | |||
+ | no-hosts | ||
+ | add-hosts=/tmp/hosts | ||
+ | |||
+ | You must also add this computer to the /tmp/hosts: | ||
+ | 192.168.0.5 printers drucker.lan | ||
+ | |||
+ | |||
+ | Original Thread: http://blog.ptch.de/index.php?/archives/33-WRT54G-DNSMasq-als-DHCPD.html (german) | ||
+ | |||
+ | |||
+ | =Extra DNSMasq options= | ||
+ | There are some extra options you can set by entering them in '''Additional DHCPD Options''' | ||
+ | |||
+ | |||
+ | ==ISP DNS-Servers== | ||
+ | If you wish to passthru the DNS-Servers from your ISP, you can use the folowing parameters: | ||
+ | <pre> | ||
+ | dhcp-option=6,x.x.x.x,y.y.y.y | ||
+ | |||
+ | x.x.x.x = DNS1 | ||
+ | y.y.y.y = DNS2</pre> | ||
+ | |||
+ | |||
+ | ==Never offer DHCP service to specific MAC-Addresses== | ||
+ | You can ignore request from specific MAC-Addresses, so no IP-Address will be leased to that machine | ||
+ | <pre> | ||
+ | dhcp-host=11:22:33:44:55:66,ignore | ||
+ | |||
+ | 11:22:33:44:55:66 = MAC-Address of the machine you wish to ignore</pre> | ||
+ | |||
+ | |||
+ | For more options take a look at http://www.faqs.org/rfcs/rfc2132.html |
Revision as of 22:43, 18 February 2006
Contents |
Introduction
DD-WRT supports using DNSMasq "as local DNS server" and in additional 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 PPTP tunnel more with the inserted PPTPD server.
There are two ways to accomplish this
- Using the Web-Interface
- Using DMSMasq parameters
You can NOT use both
Setting it up
Using Web-Admin
This is the easiest way to setup DNSMasq as DHCP Server
- Go to your Web-Interfaceand log in
- Go to Setup->Basic Setup
- Make sure that
- DHCP Type = DHCP Server
- DHCP Server = enabled
- Use DNSMasq for DHCP = checked
- Make sure that
- Go to Administration->Services
- Make sure that
- DHCP Daemon = enabled
- Make sure that
- You can add static allocations the same way when you're using DHCPd
Using DNSMasq parameters
Following steps are necessary:
- deactivate the DHCPD service on the "Setup" page.
- add in the options of the DNSMasq under "administration" (this must be also activated):
dhcp-range=192.168.0.100,192.168.0.150,255.255.255.0,12h
Static allocation:
dhcp-host=AB:CD:EF:11:22:33,192.168.0.10,host,host.domain,12h
AB:CD:EF:11:22:33 is the MAC of the network, 192.168.0.10 will indicate the desired IP, host and host.domain the hostname (e.g. Computer1.lan) and finally 12h the DHCP release of 12 hours.
If you want to identify devices via name resolution and it's not possible to assign an IP with DNSMasq you must add the following lines:
no-hosts add-hosts=/tmp/hosts
You must also add this computer to the /tmp/hosts:
192.168.0.5 printers drucker.lan
Original Thread: http://blog.ptch.de/index.php?/archives/33-WRT54G-DNSMasq-als-DHCPD.html (german)
Extra DNSMasq options
There are some extra options you can set by entering them in Additional DHCPD Options
ISP DNS-Servers
If you wish to passthru the DNS-Servers from your ISP, you can use the folowing parameters:
dhcp-option=6,x.x.x.x,y.y.y.y x.x.x.x = DNS1 y.y.y.y = DNS2
Never offer DHCP service to specific MAC-Addresses
You can ignore request from specific MAC-Addresses, so no IP-Address will be leased to that machine
dhcp-host=11:22:33:44:55:66,ignore 11:22:33:44:55:66 = MAC-Address of the machine you wish to ignore
For more options take a look at http://www.faqs.org/rfcs/rfc2132.html