OpenWrt Forum Archive

Topic: getting openwrt to pass out IP addresses via DHCP

The content of this topic has been archived on 30 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Good afternoon,

I'm running White Russian RC3 and for a couple reasons cannot upgrade it quite yet. But I really need to start handing out IP info via DHCP (currently user machines have to hard code all of their IP info). I thought this would be quite simple to research and implement, but for the life of me I can't even find a starting point. Would someone mind explaining the obvious, or at least poing me in the correct direction.

Thanks,
festus

configure dnsmasq?

OK - dnsmasq is handing out IP's just fine, but I can't get it to pass along its DNS info, which is in /tmp/resolv.conf.

Here's my dnsmasq. Does anyone know what I might be missing?

# filter what we send upstream
domain-needed           # Never forward plain names (without a dot or domain part)
bogus-priv              # Never forward addresses in the non-routed address spaces.
filterwin2k             # filter useless windows-originated DNS requests
localise-queries        # ?

# allow /etc/hosts and dhcp lookups via *.lan
local=/lan/
domain=lan

# added 2006-07-18 (jjf)
expand-hosts
domain=festusandsimone.org

# enable dhcp (start,end,netmask,leasetime)
dhcp-authoritative
dhcp-range=192.168.1.100,192.168.1.250,255.255.255.0,12h
dhcp-leasefile=/tmp/dhcp.leases

# use /etc/ethers for static hosts; same format as --dhcp-host
# <hwaddr> [<hostname>] <ipaddr>
# read-ethers

# other useful options:
resolv-file=/tmp/resolv.conf


Thanks,
festus

All right, excellent site. But I'm still missing something. If I put

dhcp-option=6,192.168.1.1 #(which is my wrt's inside address)

in dnsmasq.conf, then my DHCP clients do get that as their DSN server. But I don't get name resolution. Isn't dnsmasq supposed to forward that request to a real, recursive DNS server?

If I put

dhcp-option=6,12.213.80.61   #(which is my current ISP's nameserver)

in dnsmasq.conf, then my clients get that and everything is fine. But what if my ISP changes their nameserver, or I change my ISP? I hook up to the net through various ISP's (work, home, on the road at campgrounds, hotels, etc...) and want whatever is in resolv.conf, which is dynamic, to be passed to clients. Isn't this possible?

Thanks,
festus

How do you get dns from your ISP? DHCP, PPPoE? Make sure that /tmp/resolv.conf (which you specified in the dnsmasq conf file) contains the right server and that dns resolution works on the router. Then it should also work for your clients that have dnsmasq ip specified as the dns server.

# cat /tmp/resolv.conf
search wildblue.com
nameserver 12.213.80.61

I'm not sure how I get dns from my ISP, but I think it's DHCP (Wildblue satellite service). And yes, dns resolution works on the router. Is it possible that the routers firewall (configured with fwbuilder on a gentoo box) is blocking the router from forwarding these requests?

Thanks for helping,
festus

The discussion might have continued from here.