Modify

Opened 5 years ago

Last modified 4 years ago

#13781 reopened defect

wrong dnsmasq-dhcp subnetmask

Reported by: Oluf Lorenzen <finkregh@…> Owned by: developers
Priority: response-needed Milestone:
Component: packages Version: Attitude Adjustment 12.09
Keywords: dnsmasq-dhcp Cc: jochen.krauss@…, support@…

Description

Hi,

tl;dr: having different subnetmasks on (not-) DHCPd-enabled interfaces creates a mixed/not working dhcp-config.

I am running OpenWRT 12.09 on TP-Link tl-wr1043nd, HW-version 1.1, with two ESSIDs/WLANS with DHCPd active, no DHCPd on LAN.

network-config

config 'interface' 'lan'
        option 'ifname' 'eth0.1'
        option 'type' 'bridge'
        option 'proto' 'static'
        option 'ipaddr' '192.168.1.1'
        option 'netmask' '255.255.252.0'

config 'interface' 'wan'
        option 'ifname' 'eth0.2'
        option '_orig_ifname' 'eth0.2'
        option '_orig_bridge' 'false'
        option 'proto' 'static'
        option 'ipaddr' '62.'
        option 'netmask' '255.255.255.240'
        option 'gateway' '62.'
        option 'dns' '8.8.8.8 8.8.4.4'
[...]
config 'interface' 'wlan'
        option '_orig_ifname' 'radio0.network1'
        option '_orig_bridge' 'false'
        option 'proto' 'static'
        option 'ipaddr' '10.4.41.1'
        option 'netmask' '255.255.255.0'

config 'interface' 'gast_wlan'
        option '_orig_ifname' 'wlan0-1'
        option '_orig_bridge' 'false'
        option 'proto' 'static'
        option 'ipaddr' '10.4.42.1'
        option 'netmask' '255.255.255.0'

dnsmasq-config

# cat /var/etc/dnsmasq.conf 
# auto-generated config file from /etc/config/dhcp
conf-file=/etc/dnsmasq.conf
dhcp-authoritative
domain-needed
localise-queries
read-ethers
bogus-priv
expand-hosts
domain=lan
server=/lan/
dhcp-leasefile=/tmp/dhcp.leases
resolv-file=/tmp/resolv.conf.auto
stop-dns-rebind

dhcp-range=gast_wlan,10.4.40.100,10.4.40.249,255.255.252.0,12h
dhcp-option=gast_wlan,6,8.8.8.8,8.8.4.4
no-dhcp-interface=eth0.2
no-dhcp-interface=wlan0

address=/fpp/192.168.11.21
ptr-record=21.11.168.192.in-addr.arpa,foo

Everything works as expected (DHCP on wifi-interfaces, no DHCP on LAN) when i change the subnetmask on the lan-interface to /24 / 255.255.255.0.

I will post /etc/config/dhcp on monday :o

Attachments (0)

Change History (14)

comment:1 Changed 5 years ago by jow

  • Priority changed from high to response-needed

Whats in logread?

comment:2 Changed 5 years ago by Oluf Lorenzen <finkregh@…>

The missing config

# cat /etc/config/dhcp

config dnsmasq
        option domainneeded '1'
        option boguspriv '1'
        option localise_queries '1'
        option rebind_protection '1'
        option local '/lan/'
        option domain 'lan'
        option expandhosts '1'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.auto'

config dhcp 'lan'
        option interface 'gast_wlan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option force '1'
        list dhcp_option '6,8.8.8.8,8.8.4.4'

config dhcp 'wan'
        option interface 'wan'
        option ignore '1'

config dhcp

config dhcp
        option interface 'wlan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option force '1'
        list dhcp_option '6,8.8.8.8,8.8.4.4'

logread

daemon.warn dnsmasq-dhcp[13071]: no address range available for DHCP request via br-lan
daemon.info hostapd: wlan0-1: STA 64:20:0c:beef IEEE 802.11: authenticated
daemon.info hostapd: wlan0-1: STA 64:20:0c:beef IEEE 802.11: associated (aid 1)
daemon.info hostapd: wlan0-1: STA 64:20:0c:beef WPA: pairwise key handshake completed (RSN)
daemon.info dnsmasq-dhcp[13071]: DHCPDISCOVER(wlan0-1) 64:20:0c:beef
daemon.info dnsmasq-dhcp[13071]: DHCPOFFER(wlan0-1) 10.4.40.122 64:20:0c:beef

comment:3 follow-up: Changed 5 years ago by jow

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

Well none of your dhcp pools covers the lan interface, therefore no dhcp on lan.

comment:4 in reply to: ↑ 3 Changed 5 years ago by Oluf Lorenzen <finkregh@…>

Replying to jow:

Well none of your dhcp pools covers the lan interface, therefore no dhcp on lan.

I did not set anything by cli/config-file, but only via GUI. I think this is still a valid bug as there is no way to change this via GUI.

The GUI somehow mixes the subnetmasks of the interfaces and creates a not-working dhcp-config.

comment:5 Changed 5 years ago by Oluf Lorenzen <finkregh@…>

  • Resolution worksforme deleted
  • Status changed from closed to reopened

comment:6 Changed 5 years ago by jow

  • Resolution set to worksforme
  • Status changed from reopened to closed

The gui does not even care about netmask settings, it also does not simply change dhcp pool interfaces by itself. Furthermore I am unable to reproduce this on current LuCI versions.

If you can still reproduce it from a *default config* state, then reopen the ticket and tell the exact steps to reproduce it.

comment:7 Changed 5 years ago by neryba@…

your 'gast_wlan' and 'wlan' use 255.255.255.0, need replace to 255.255.252.0

comment:8 Changed 5 years ago by Oluf Lorenzen <finkregh@…>

:-/ I was not able to reproduce this problem on a new AP.

I'll reopen this ticket if i find a way to reproduce this on a clean device :-)

comment:9 Changed 4 years ago by anonymous

I am experiencing the exact same issue.
Barrier Breaker r39050 (hnyman's IPv6 oriented Openwrt build for WNDR3700/WNDR3800 build).

The problem is, the /var/etc/dnsmasq.conf that is generated doesn't contain the DHCP range for the Guest Wifi Subnet. Hence there are no ip's within that range to hand out.

This problem is still occuring for me on the latest build.

comment:10 Changed 4 years ago by anonymous

  • Resolution worksforme deleted
  • Status changed from closed to reopened

comment:11 Changed 4 years ago by anonymous

The UCI configuration is generated via LuCi.

/etc/config/network

config interface 'lan'

option ifname 'eth0.1'
option type 'bridge'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'

config interface 'guest'

option _orig_ifname 'wlan0-1'
option _orig_bridge 'false'
option proto 'static'
option ipaddr '192.168.3.1'
option netmask '255.255.255.0'

/etc/config/dhcp

config dhcp 'lan'

option interface 'lan'
option start '100'
option limit '150'
option leasetime '12h'

config dhcp

option start '100'
option leasetime '12h'
option limit '150'
option interface 'guest'

/var/etc/dnsmasq.conf

only contains dhcp range for one subnet :(

dhcp-range=lan,192.168.1.100,192.168.1.249,255.255.255.0,12h
no-dhcp-interface=pppoe-wan

Any ideas?

comment:12 Changed 4 years ago by jow

Should be fixed with r39099, r39100, r39101. Please test.

comment:13 Changed 4 years ago by anonymous

hi jow,
I can confirm the changes you made have now fixed the DHCP Range allocation for Wifi Guest Network :)

Thankyou so much!
Ticket can be closed.

comment:14 Changed 4 years ago by anonymous

Meanwhile it may have broken dnsmasq for a lot of other users, see ticket 14629.

/ticket/14629.html

Add Comment

Modify Ticket

Action
as reopened .
Author


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

 
Note: See TracTickets for help on using tickets.