OpenWrt Forum Archive

Topic: WRT54GL: DHCP Not Working with Wireless

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

My problem is that wireless connections are not getting DHCP addresses.  Statically assigning the client an address resolves the issue.  NAS is installed.  I'm up for whatever you guys have.

/etc/config/network:

#### VLAN configuration
config switch eth0
        option vlan0    "0 1 2 3 5*"
        option vlan1    "4 5"


#### Loopback configuration
config interface loopback
        option ifname   "lo"
        option proto    static
        option ipaddr   127.0.0.1
        option netmask  255.0.0.0


#### LAN configuration
config interface lan
        option type     bridge
        option ifname   "eth0.0"
        option proto    static
        option ipaddr   192.168.128.1
        option netmask  255.255.255.0
        option gateway  192.168.1.1


#### WAN configuration
config interface        wan
        option ifname   "eth0.1"
        option proto    static
        option ipaddr   192.168.1.2
        option netmask  255.255.255.242
        option dns      166.102.165.11 166.102.165.13

/etc/config/wireless:

config wifi-device  wl0
        option type     broadcom
        option channel  5
        option maclist  'XXXXXXXXXXXXXXX'
        option macfilter        '2'

config wifi-iface
        option device   wl0
        option network  lan
        option mode     ap
        option ssid     XXXXXXXXXXXXX
        option encryption psk2
        option key      XXXXXXXXXXXXX

/etc/config/dhcp:

config dhcp
        option interface        lan
        option start    100
        option limit    150
        option leasetime        12h

#config dhcp
#       option interface        wan
#       option ignore   1

What is in your /etc/dnsmasq.conf

adyb wrote:

What is in your /etc/dnsmasq.conf

# filter what we send upstream
domain-needed
bogus-priv
filterwin2k
localise-queries

# allow /etc/hosts and dhcp lookups via *.lan
local=/lan/
domain=lan
expand-hosts
no-negcache
resolv-file=/tmp/resolv.conf.auto

dhcp-authoritative
dhcp-leasefile=/tmp/dhcp.leases

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

# other useful options:
# default route(s): dhcp-option=3,192.168.1.1,192.168.1.2
#    dns server(s): dhcp-option=6,192.168.1.1,192.168.1.2

Okay, now it doesn't work altogether.  I can't "ipconfig /renew" on wired connections anymore, either.

Use "logread | less" to view the system log of the openwrt box. There should be some output from dnsmasq. If you cant' spot the error, post the output from logread here.

I'm having the same problem. I changed something innocuous (like the range) and now dnsmasq does not even have args in `ps w`, just:

Before:
5307 nobody      440 S   /usr/sbin/dnsmasq --dhcp-range=lan,192.168.20.100,192.168.20.249,255.255.255  

After:
390 nobody      420 S   /usr/sbin/dnsmasq

/etc/config/dhcp

root@wap1:/etc/init.d# cat /etc/config/dhcp
config dhcp
        option interface        lan
        option start    200
        option limit    '248'
        option leasetime        '1m'
        option ignore   '0'

/etc/dnsmasq.conf
wswartzendruber's is the default and the same as mine.

/etc/config/network

#### VLAN configuration
config switch eth0
        option vlan0    "1 2 3 4 5*"
        option vlan1    "0 5"


#### Loopback configuration
config interface loopback
        option ifname   "lo"
        option proto    static
        option ipaddr   127.0.0.1
        option netmask  255.0.0.0


#### LAN configuration
config interface lan
        option type     'bridge'
        option ifname   "eth0.0"
        option proto    static
        option ipaddr   '192.168.20.254'
        option netmask  255.255.255.0
        option gateway  192.168.20.1

Huh...

Jan  1 01:44:20 router daemon.info dnsmasq[384]: DHCPDISCOVER(br-lan) 00:16:41:15:85:bf
Jan  1 01:44:20 router daemon.info dnsmasq[384]: DHCPOFFER(br-lan) 192.168.128.248 00:16:41:15:85:bf
Jan  1 01:44:21 router daemon.info dnsmasq[384]: DHCPDISCOVER(br-lan) 00:16:41:15:85:bf
Jan  1 01:44:21 router daemon.info dnsmasq[384]: DHCPOFFER(br-lan) 192.168.128.248 00:16:41:15:85:bf
Jan  1 01:44:28 router daemon.info dnsmasq[384]: DHCPDISCOVER(br-lan) 00:16:41:15:85:bf
Jan  1 01:44:28 router daemon.info dnsmasq[384]: DHCPOFFER(br-lan) 192.168.128.248 00:16:41:15:85:bf
Jan  1 01:44:43 router daemon.info dnsmasq[384]: DHCPDISCOVER(br-lan) 00:16:41:15:85:bf
Jan  1 01:44:43 router daemon.info dnsmasq[384]: DHCPOFFER(br-lan) 192.168.128.248 00:16:41:15:85:bf
Jan  1 01:50:13 router daemon.info dnsmasq[384]: DHCPDISCOVER(br-lan) 00:16:41:15:85:bf
Jan  1 01:50:13 router daemon.info dnsmasq[384]: DHCPOFFER(br-lan) 192.168.128.248 00:16:41:15:85:bf
Jan  1 01:50:14 router daemon.info dnsmasq[384]: DHCPDISCOVER(br-lan) 00:16:41:15:85:bf
Jan  1 01:50:14 router daemon.info dnsmasq[384]: DHCPOFFER(br-lan) 192.168.128.248 00:16:41:15:85:bf
Jan  1 01:50:21 router daemon.info dnsmasq[384]: DHCPDISCOVER(br-lan) 00:16:41:15:85:bf
Jan  1 01:50:21 router daemon.info dnsmasq[384]: DHCPOFFER(br-lan) 192.168.128.248 00:16:41:15:85:bf
Jan  1 01:50:36 router daemon.info dnsmasq[384]: DHCPDISCOVER(br-lan) 00:16:41:15:85:bf
Jan  1 01:50:36 router daemon.info dnsmasq[384]: DHCPOFFER(br-lan) 192.168.128.248 00:16:41:15:85:bf
Jan  1 01:55:56 router daemon.info dnsmasq[384]: DHCPDISCOVER(br-lan) 00:16:41:15:85:bf
Jan  1 01:55:56 router daemon.info dnsmasq[384]: DHCPOFFER(br-lan) 192.168.128.248 00:16:41:15:85:bf
Jan  1 01:55:57 router daemon.info dnsmasq[384]: DHCPDISCOVER(br-lan) 00:16:41:15:85:bf
Jan  1 01:55:57 router daemon.info dnsmasq[384]: DHCPOFFER(br-lan) 192.168.128.248 00:16:41:15:85:bf
Jan  1 01:56:05 router daemon.info dnsmasq[384]: DHCPDISCOVER(br-lan) 00:16:41:15:85:bf
Jan  1 01:56:05 router daemon.info dnsmasq[384]: DHCPOFFER(br-lan) 192.168.128.248 00:16:41:15:85:bf
Jan  1 01:56:20 router daemon.info dnsmasq[384]: DHCPDISCOVER(br-lan) 00:16:41:15:85:bf
Jan  1 01:56:20 router daemon.info dnsmasq[384]: DHCPOFFER(br-lan) 192.168.128.248 00:16:41:15:85:bf

And there's way more of those messages than what I posted.

Comment the option ignore line.

Restart dnsmasq with
/etc/init.d/dnsmasq stop
rm -fv /tmp/dhcp.leases
/etc/init.d/dnsmasq start
then check logread output again.

The discussion might have continued from here.