I've been sitting here a few hours now trying to troubleshoot something and i'm running out of ideas and needing to ask for help (something I do very reluctantly as I like to think I should be able to figure this out on my own). But at this point, i'm giving in and accepting the fact that i'm probably doing something stupid and missing/overlooking something probably simple..
I have a client on my network, my laptop, it has reachability issues trying to get to a host on another network. Or so i thought it was configured that way, see i figured out the issue is the laptop has the wrong subnet being set, and thinks the other host is on the same network. as if that wasn't a big enough facepalm...
So while I could manually set the right IP and subnet, but i'm trying to rely on DHCP and i cannot for the life of me figure out why my laptop keeps getting the wrong subnet (and also not the IP i have configured in the static lease).
things i've tried:
- checking /etc/config/dhcp (included below)
- releasing/renewing the DHCP lease on the laptop
- removing the /tmp/dhcp.leases.lan file
- rebooting the laptop
- rebooting the router
- lowering the client lease to 5m
- lowering ALL leases times on that subnet to 2m
- running tcpdump/dhcpdump both on the router and on the client (output below)
Still I keep getting the same IP (final octet being .218) and the wrong subnet mask appears to be configured on my laptop's interface. AND I can't figure out why!
I am not sure what to do next? this is an OpenWRT build SNAPSHOT r23935+13-c1206675a4 w/ kernel 6.1.53 - the mac is running macOS monterey 12.3.1
Here's the relevant bits of my /etc/config/dhcp file:
config dnsmasq 'lan_dns'
option domainneeded '1'
option localise_queries '1'
option rebind_protection '1'
option rebind_localhost '1'
option local '/lan.home.mydomain/'
option domain 'lan.home.mydomain'
option expandhosts '1'
option cachesize '1000'
option authoritative '1'
option readethers '1'
option leasefile '/tmp/dhcp.leases.lan'
option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
list interface 'lan'
list notinterface 'loopback'
list server '208.67.222.222'
list server '208.67.220.220'
list rebind_domain '/mydomain/'
option localservice '1'
config dhcp 'lan'
option instance 'lan_dns'
option interface 'lan'
option start '100'
option limit '150'
option leasetime '2m'
option dhcpv4 'server'
option dhcpv6 'server'
option ra 'server'
list dhcp_option '15,lan.home.mydomain'
list dhcp_option '119,lan.home.mydomain,mgmt.home.mydomain'
list dhcp_option_force '1'
list ra_flags 'managed-config'
list ra_flags 'other-config'
[...]
config host
option name 'aleksWorkMBP-docked'
option ip '10.22.20.20'
option mac '8C:AE:4C:XX:XX:XX'
option dns '1'
option duid 'XXXXX'
option instance '1'
option hostid '00000001'
option leasetime '5m'
and /etc/config/network:
config interface 'lan'
option device 'br-lan.2220'
option proto 'static'
option ipaddr '10.22.20.1'
option netmask '255.255.255.0'
option ip6assign '64'
option ip6hint '2220'
option ip6ifaceid '::'
list ip6class 'wan_6'
And here's what the output of dhcpdump looks like:
TIME: 2023-09-19 00:25:56.680
IP: 0.0.0.0 (8c:ae:4c:xx:xx:xx) > 255.255.255.255 (ff:ff:ff:ff:ff:ff)
OP: 1 (BOOTPREQUEST)
HTYPE: 1 (Ethernet)
HLEN: 6
HOPS: 0
XID: 91b8a7d0
SECS: 2
FLAGS: 0
CIADDR: 0.0.0.0
YIADDR: 0.0.0.0
SIADDR: 0.0.0.0
GIADDR: 0.0.0.0
CHADDR: 8c:ae:4c:xx:xx:xx:00:00:00:00:00:00:00:00:00:00
SNAME: .
FNAME: .
OPTION: 53 ( 1) DHCP message type 1 (DHCPDISCOVER)
OPTION: 55 ( 12) Parameter Request List 1 (Subnet mask)
121 (Classless Static Route)
3 (Routers)
6 (DNS server)
15 (Domainname)
108 (Swap Path)
114 (URL)
119 (Domain Search)
252 (MSFT - WinSock Proxy Auto Detect)
95 (LDAP)
44 (NetBIOS name server)
46 (NetBIOS node type)
OPTION: 57 ( 2) Maximum DHCP message size 1500
OPTION: 61 ( 7) Client-identifier 01:8c:ae:4c:xx:xx:xx
OPTION: 51 ( 4) IP address leasetime 7776000 (12w6d)
OPTION: 12 ( 12) Host name aleksWorkMBP
---------------------------------------------------------------------------
TIME: 2023-09-19 00:25:58.295
IP: 10.22.20.1 (60:38:e0:xx:xx:xx) > 10.22.20.218 (8c:ae:4c:xx:xx:xx)
OP: 2 (BOOTPREPLY)
HTYPE: 1 (Ethernet)
HLEN: 6
HOPS: 0
XID: 91b8a7d0
SECS: 0
FLAGS: 0
CIADDR: 0.0.0.0
YIADDR: 10.22.20.218
SIADDR: 10.22.20.1
GIADDR: 0.0.0.0
CHADDR: 8c:ae:4c:xx:xx:xx:00:00:00:00:00:00:00:00:00:00
SNAME: .
FNAME: .
OPTION: 53 ( 1) DHCP message type 2 (DHCPOFFER)
OPTION: 54 ( 4) Server identifier 10.22.20.1
OPTION: 51 ( 4) IP address leasetime 120 (2m)
OPTION: 58 ( 4) T1 60 (60s)
OPTION: 59 ( 4) T2 105 (1m45s)
OPTION: 28 ( 4) Broadcast address 10.22.20.255
OPTION: 3 ( 4) Routers 10.22.20.1
OPTION: 6 ( 4) DNS server 10.22.20.1
OPTION: 119 ( 25) Domain Search 036c616e04686f6d .lan.home...
OPTION: 15 ( 16) Domainname lan.home.mydomain
---------------------------------------------------------------------------
TIME: 2023-09-19 00:25:58.295
IP: 10.22.20.1 (60:38:e0:xx:xx:xx) > 10.22.20.218 (8c:ae:4c:xx:xx:xx)
OP: 2 (BOOTPREPLY)
HTYPE: 1 (Ethernet)
HLEN: 6
HOPS: 0
XID: 91b8a7d0
SECS: 2
FLAGS: 0
CIADDR: 0.0.0.0
YIADDR: 10.22.20.218
SIADDR: 10.22.20.1
GIADDR: 0.0.0.0
CHADDR: 8c:ae:4c:xx:xx:xx:00:00:00:00:00:00:00:00:00:00
SNAME: .
FNAME: .
OPTION: 53 ( 1) DHCP message type 2 (DHCPOFFER)
OPTION: 54 ( 4) Server identifier 10.22.20.1
OPTION: 51 ( 4) IP address leasetime 120 (2m)
OPTION: 58 ( 4) T1 60 (60s)
OPTION: 59 ( 4) T2 105 (1m45s)
OPTION: 28 ( 4) Broadcast address 10.22.20.255
OPTION: 3 ( 4) Routers 10.22.20.1
OPTION: 6 ( 4) DNS server 10.22.20.1
OPTION: 119 ( 25) Domain Search 036c616e04686f6d .lan.hom...
OPTION: 15 ( 16) Domainname lan.home.mydomain
---------------------------------------------------------------------------
TIME: 2023-09-19 00:25:59.305
IP: 0.0.0.0 (8c:ae:4c:xx:xx:xx) > 255.255.255.255 (ff:ff:ff:ff:ff:ff)
OP: 1 (BOOTPREQUEST)
HTYPE: 1 (Ethernet)
HLEN: 6
HOPS: 0
XID: 91b8a7d0
SECS: 5
FLAGS: 0
CIADDR: 0.0.0.0
YIADDR: 0.0.0.0
SIADDR: 0.0.0.0
GIADDR: 0.0.0.0
CHADDR: 8c:ae:4c:xx:xx:xx:00:00:00:00:00:00:00:00:00:00
SNAME: .
FNAME: .
OPTION: 53 ( 1) DHCP message type 3 (DHCPREQUEST)
OPTION: 55 ( 12) Parameter Request List 1 (Subnet mask)
121 (Classless Static Route)
3 (Routers)
6 (DNS server)
15 (Domainname)
108 (Swap Path)
114 (URL)
119 (Domain Search)
252 (MSFT - WinSock Proxy Auto Detect)
95 (LDAP)
44 (NetBIOS name server)
46 (NetBIOS node type)
OPTION: 57 ( 2) Maximum DHCP message size 1500
OPTION: 61 ( 7) Client-identifier 01:8c:ae:4c:xx:xx:xx
OPTION: 50 ( 4) Request IP address 10.22.20.218
OPTION: 54 ( 4) Server identifier 10.22.20.1
OPTION: 12 ( 12) Host name aleksWorkMBP
---------------------------------------------------------------------------
TIME: 2023-09-19 00:25:59.305
IP: 10.22.20.1 (60:38:e0:xx:xx:xx) > 10.22.20.218 (8c:ae:4c:xx:xx:xx)
OP: 2 (BOOTPREPLY)
HTYPE: 1 (Ethernet)
HLEN: 6
HOPS: 0
XID: 91b8a7d0
SECS: 5
FLAGS: 0
CIADDR: 0.0.0.0
YIADDR: 10.22.20.218
SIADDR: 10.22.20.1
GIADDR: 0.0.0.0
CHADDR: 8c:ae:4c:xx:xx:xx:00:00:00:00:00:00:00:00:00:00
SNAME: .
FNAME: .
OPTION: 53 ( 1) DHCP message type 5 (DHCPACK)
OPTION: 54 ( 4) Server identifier 10.22.20.1
OPTION: 51 ( 4) IP address leasetime 120 (2m)
OPTION: 58 ( 4) T1 60 (60s)
OPTION: 59 ( 4) T2 105 (1m45s)
OPTION: 28 ( 4) Broadcast address 10.22.20.255
OPTION: 3 ( 4) Routers 10.22.20.1
OPTION: 6 ( 4) DNS server 10.22.20.1
OPTION: 119 ( 25) Domain Search 036c616e04686f6d .lan.hom...
OPTION: 15 ( 16) Domainname lan.home.mydomain
---------------------------------------------------------------------------
The ip .218 keeps coming back, repeatedly clearing /tmp/dhcp.leases* and restarting dnsmasq seems to have no effect.. rebooting either host has no effect.. It's like the macbook really wants this IP (but more importantly, the WRONG subnet) and i'm at my wit's end :-/