WAN DHCP - "reject leases from" not working for me for a subnet

Started by jonm, October 27, 2021, 12:54:48 PM

Previous topic - Next topic
Can I check if I have this configuration option correct please? I have an Arris cable modem and when if it disconnects it often presents a dodgy IP address until it reconnects.

I have "Reject leases from" set to 192.168.100.0 but this morning when my WAN connection was lost due to ISP maintenance work, the following happened when the cable modem reconnected:


Oct 27 01:09:42 OPNsense kernel: igb0: link state changed to UP
Oct 27 01:09:43 OPNsense opnsense[66555]: /usr/local/etc/rc.linkup: DEVD Ethernet attached event for wan
Oct 27 01:09:43 OPNsense opnsense[66555]: /usr/local/etc/rc.linkup: HOTPLUG: Configuring interface wan
Oct 27 01:09:43 OPNsense dhclient[65263]: DHCPREQUEST on igb0 to 255.255.255.255 port 67
Oct 27 01:09:43 OPNsense dhclient[65263]: DHCPNAK from 192.168.100.254
Oct 27 01:09:43 OPNsense dhclient[65263]: DHCPDISCOVER on igb0 to 255.255.255.255 port 67 interval 4
Oct 27 01:09:46 OPNsense dhclient[65263]: DHCPOFFER from 192.168.100.254
Oct 27 01:09:48 OPNsense dhclient[65263]: DHCPREQUEST on igb0 to 255.255.255.255 port 67
Oct 27 01:09:48 OPNsense dhclient[65263]: DHCPACK from 192.168.100.254
Oct 27 01:09:48 OPNsense dhclient[69568]: New IP Address (igb0): 192.168.100.51
Oct 27 01:09:48 OPNsense dhclient[24805]: New Subnet Mask (igb0): 255.255.255.0
Oct 27 01:09:48 OPNsense dhclient[72962]: New Broadcast Address (igb0): 192.168.100.255
Oct 27 01:09:48 OPNsense dhclient[10646]: New Routers (igb0): 192.168.100.254
Oct 27 01:09:48 OPNsense dhclient[77551]: route add default 192.168.100.254
Oct 27 01:09:48 OPNsense dhclient[10946]: Creating resolv.conf


... i.e. the lease was not rejected. So do I have this configured correctly or is there some other way I should be specifying the 192.168.100.x subnet?

Thanks

Jon.

It only takes an IP address to reject leases from if I recall correctly from the manual page.


Cheers,
Franco

Ah, ok, thanks.

The help text is misleading/wrong then as it says: "If there is a certain upstream DHCP server that should be ignored, place the IP address or subnet of the DHCP server to be ignored here. This is useful for rejecting leases from cable modems that offer private IPs when they lose upstream sync."

Well, FreeBSD manual isn't very elaborate, but ISC dhclient.conf is...

https://www.freebsd.org/cgi/man.cgi?query=dhclient.conf&sektion=5&n=1

reject 192.33.137.209;

https://kb.isc.org/docs/isc-dhcp-41-manual-pages-dhclientconf

reject 192.168.0.0/16, 10.0.0.5;

Without looking at the code it's impossible to tell how much it supports, but "192.168.100.0" is basically a single address and not a CIDR subnet. Maybe there is an issue too...


Cheers,
Franco

Thanks Franco. I suspected I had it wrong tbh! Will try with proper notation. Actually it's probably just the .254 address every time, but I will test it and see...

Cheers,

Jon.