openwrt / odhcpd

This repository is a mirror of https://git.openwrt.org/?p=project/odhcpd.git. Pull requests will be accepted which will be merged in odhcpd.git
GNU General Public License v2.0
160 stars 96 forks source link

ip=ignore is ignored #198

Open rgl opened 1 year ago

rgl commented 1 year ago

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 root@192.168.1.254
#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?

systemcrash commented 8 months ago

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