I also had this problem. I wanted to use the LAN interface on a network with an existing DHCP server.
I did something slightly different in the /etc/config/dhcp func:
[ "$(uci get dhcp.lan.ignore 2> /dev/null)" == 1 ] && return 0
My proposed fix is to add a option ignore '1'
to the config dhcp 'lan'
section of /etc/config/dhcp
. This solution can also be done in Luci.
Another test which probably needs to be run is the existence of the LAN interface. If the user changes the name of that bridge interface, it will mess everything up that way too.
So there probably also needs to be a test for “uci get dhcp.lan.interface” as well.