odhcpd icon indicating copy to clipboard operation
odhcpd copied to clipboard

ip=ignore is ignored

Open rgl opened this issue 2 years ago • 1 comments

I'm trying to configure odhcpd to ignore a specific machine MAC address and I think there is a bug somewhere.

The static leases documentation states:

ip | the IP address to be used for this host, or ignore to ignore any DHCP request from this host

But the odhcpd host section does not state ignore is supported, which is somewhat odd?

I've configured a static lease like:

# see https://openwrt.org/docs/guide-user/base-system/dhcp#static_leases
# see https://openwrt.org/docs/techref/odhcpd#host_section
# see /etc/config/dhcp
# see /tmp/hosts/odhcpd
ssh [email protected]
#uci delete dhcp.@host[-1]
id="$(uci add dhcp host)"
uci set "dhcp.$id.mac=08:00:27:00:00:46"
# XXX even with this configuration, the host is not being ignored :-(
uci set "dhcp.$id.ip=ignore"
uci set "dhcp.$id.name=t1"
uci changes dhcp
uci commit dhcp
uci show dhcp
service odhcpd reload
exit

But I can still see DHCP traffic, and odhcpd is still assigning/replying to the configured MAC address.

Can you help understand why odhcpd is not ignoring the defined MAC address?

Am I doing something wrong?

rgl avatar Apr 26 '23 11:04 rgl

Probably because those are controlled by dnsmasq (and not odhcpd). Recommend you close this as unrelated to odhcpd.

systemcrash avatar Nov 02 '23 00:11 systemcrash

@systemcrash Static leases are controlled by odhcpd if the maindhcp option is used, therefore it seems like odhcpd should respect the same config options available for dnsmasq in those cases.

I've added a PR which implements this functionality.

Kasoo avatar Apr 02 '25 13:04 Kasoo