Posted: Sat Feb 25, 2012 16:58 Post subject: DD-WRT + DNSMasq with alternate gateway
Hello,
I'm running 'DD-WRT v24-sp2 (08/12/10) mini' and I need the router to do ONLY DHCP and DNS, and Using ONLY the LAN ports, not WAN.
I need to configure the router to not use itself as the gateway, or have any traffic pass through it. I have 50Mb download speed if I bypass the router and if I go through the router I'm limited to 20Mb.
In Swtup -> Basic setup:
Disable the WAN port to stop the forwarding. The WAN port will then act as a normal LAN port.
Set the router's IP that will serve as DHCP and DNS server IP for the clients.
Set the subnet.
Set the gateway to the global gateway.
Leave "Local DNS" 0.0.0.0
Set your DHCP type to DHCP server.
Enable the server.
Set the scope, users and lease time.
Leave the WINS server to 0.0.0.0.
Set the DNSmasq options if you use DNSmasq instead of DHCPd.(preffered with your router type) You need both.
Don't set DHCP authorative.
In Services -> Services:
Uncheck "Use NVRAM for client lease DB".
Set used domain to "LAN and WAN".
Set the LAN Domain to the global domain if it permits it and all DHCP clients will have resolvable names. Otherwise use something like "localnet". (don't set it to "local" or "lan")
Set any static leases if you need them.
Leave the DHCPd options blank.
Enable DNSmasq with local DNS and no rebind.
In it's options add:
local=your LAN domain that you set up earlier expand-hosts
dhcp-option=3,your global gateway dhcp-option=6,your global primary DNS server IP, your global secondary DNS server IP
/I'd use 8.8.8.8, which is Google's global DNS as a secondary DNS/
domain-needed
bogus-priv
dhcp-option=19,0 /Disable IP forwarding/
dhcp-option=20,0 /Source routing/
For windows clients
dhcp-option=46,1 /Make all nodes broadcast themselves so they're visible in the neighbourhood/
Don't disable NetBIOS in windows environment unless you know exactly what you're doing.
As OP never posted back and I have wasted some time getting this to work so I will add a little feedback. I followed the steps outlined by Hadji with the exception of all the DNSmasq options, as this we causing other issues (still, it was an excellent guide).
No matter what I did my devices were still picking up my router with DHCP as the gateway and not the true gateway.