I am setting up openwrt in a VM. I upload the image, boot the vm, edit /etc/config/network
, restart network and everything is fine, until it reboots when dnsmasq fails to start
Sun Aug 6 20:20:46 2023 daemon.crit dnsmasq[1]: bad dhcp-range at line 32 of /var/etc/dnsmasq.conf.cfg01411c
Sun Aug 6 20:20:46 2023 daemon.crit dnsmasq[1]: FAILED to start up
The line being referred to is
dhcp-range=set:lan,19,,,12h
which wasn't there before the reboot.
/etc/config/dhcp
has the following content:
config dnsmasq
option domainneeded '1'
option boguspriv '1'
option filterwin2k '0'
option localise_queries '1'
option rebind_protection '1'
option rebind_localhost '1'
option local '/lan/'
option domain 'lan'
option expandhosts '1'
option nonegcache '0'
option cachesize '1000'
option authoritative '1'
option readethers '1'
option leasefile '/tmp/dhcp.leases'
option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
option nonwildcard '1'
option localservice '1'
option ednspacket_max '1232'
option filter_aaaa '0'
option filter_a '0'
config dhcp 'lan'
option interface 'lan'
option start '100'
option limit '150'
option leasetime '12h'
option dhcpv4 'server'
option dhcpv6 'server'
option ra 'server'
option ra_slaac '1'
list ra_flags 'managed-config'
list ra_flags 'other-config'
config dhcp 'wan'
option interface 'wan'
option ignore '1'
config odhcpd 'odhcpd'
option maindhcp '0'
option leasefile '/tmp/hosts/odhcpd'
option leasetrigger '/usr/sbin/odhcpd-update'
which I think should translate to something like dhcp-range=set:lan,192.168.1.100,192.168.1.249,12h
. Pretty much all default values. I don't understand why this simple configuration is parsed as dhcp-range=set:lan,19,,,12h
.
I am not sure if this is needed, but /etc/config/network
has the following content:
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fdfa:ccdc:1ef5::/48'
config device
option name 'br-lan'
option type 'bridge'
list ports 'eth1'
config interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'
config interface 'wan'
option device 'eth0'
option proto 'dhcp'
wan
connects to my modem, lan
connects to a virtual bridge on the host machine and then connects my PC and a wireless router configured as an AP only.