Opened 6 years ago

Closed 6 years ago

Last modified 4 years ago

#10760 closed defect (invalid)

DHCP Problem with LAN and WLAN

Reported by: Maarten Bezemer <m.m.bezemer@…> Owned by: developers
Priority: response-needed Milestone: Barrier Breaker 14.07
Component: packages Version: Trunk
Keywords: Cc:


When I try to configure a LAN and a WLAN for the same IP range I have the following problem when a IP address is requested over the WLAN: hostapd: wlan0: STA 00:16:ea:b1:8d:e4 IEEE 802.11: authenticated hostapd: wlan0: STA 00:16:ea:b1:8d:e4 IEEE 802.11: associated (aid 1) hostapd: wlan0: STA 00:16:ea:b1:8d:e4 WPA: pairwise key handshake completed (RSN) dnsmasq-dhcp[17274]: DHCPREQUEST(wlan0) 00:16:ea:b1:8d:e4 dnsmasq-dhcp[17274]: DHCPNAK(wlan0) 00:16:ea:b1:8d:e4 wrong network

The wrong network error disappears when I pick two separate IP ranges for LAN and WLAN.

My router is a WRT350n v2 and I have the following configuration (relevant parts only).

config 'interface' 'lan'
        option 'ifname' 'lan1 lan2 lan3 lan4'
        option 'type' 'bridge'
        option 'proto' 'static'
        option 'netmask' ''
        option 'macaddr' '00:1e:e5:93:e1:56'
        option 'ipaddr' ''

config 'interface' 'wlan'
        option 'proto' 'static'
        option 'netmask' ''
        option 'gateway' ''
        option 'ipaddr' ''


config 'wifi-device' 'radio0'
        option 'type' 'mac80211'
        option 'channel' '11'
        option 'macaddr' '00:c0:02:00:06:1c'
        list 'ht_capab' 'SHORT-GI-40'
        list 'ht_capab' 'DSSS_CCK-40'
        option 'hwmode' '11g'
        option 'country' 'NL'
        option 'txpower' '20'

config 'wifi-iface'
        option 'device' 'radio0'
        option 'mode' 'ap'
        option 'ssid' 'OpenWrt'
        option 'encryption' 'psk2+ccmp'
        option 'key' 'testtesttest'
        option 'network' 'wlan'

I tried lots of configurations and this is the only (suboptimal) working one. So I suppose there is some bug in the system?

PS On the forum is some more background info on this topic post #1049 to 1058

Attachments (0)

Change History (7)

comment:1 Changed 6 years ago by jow

  • Priority changed from normal to response-needed

Did you define a new dhcp pool for wlan? Also the gateway option of the wlan network makes no sense, remove it.

comment:2 Changed 6 years ago by Maarten Bezemer <m.m.bezemer@…>

I indeed did create a new DHCP pool for the WLAN network. I would rather have the LAN pool shared... But defining two pools with their own ranges is fine by me as well.

I'll remove the gateway, although it does not seem to interfere... But I tried it on my test router which does not have the internet access, So maybe on a later stadium, when trying my production router, it gives problems...?

comment:3 Changed 6 years ago by jow

Simply stick to this rule of thumb: if a gateway points to an ip which belongs to any interface on the same machine, then it is uneeded. Do you still see the wrong network errors after adding a dedicated pool for wlan?

comment:4 Changed 6 years ago by Maarten Bezemer <m.m.bezemer@…>

I only see the wrong network errors when I use the same IP range for the WLAN and LAN networks. In the configuration above I have two separate ranges and everything works fine. In both cases have the separate DHCP pools.

The separate WLAN network is used, because WLAN is not working when I add the interface to the LAN network... (My laptop does not see the wireless network/SSID at all)

comment:5 Changed 6 years ago by jow

  • Resolution set to invalid
  • Status changed from new to closed

Well having the same ip range on two different interfaces is undefined behaviour, neither would the routing work properly, nor the dhcp setup.

So there isn't a bug after all, only a misconfiguration. Please consider opening a ticker for the actual problem of bridging wlan0 and ethernet.

For general instructions on how to separate wifi, refer to

comment:6 Changed 6 years ago by Maarten Bezemer <m.m.bezemer@…>

I opened a new ticket: #10762

@jow: Thanks for your help!

comment:7 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

as closed .
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.