DHCP not renewing license
Chris Johns (3727) 40 posts |
Not sure if this is a problem with the Pi, the DHCP server or RISC OS, or just the specific combination. I am running the latest Raspberry Pi build on a Mk 1 model B. Having fixed my RiscPC after the battery leakage, I have connected both it and the Pi to the office network. The RiscPC runs select, so both machines get an address from out the DHCP server. The DHCP server is set to give short license times (around 10 minutes) for ‘guest’ machines (as they both are on our office network). I have been using ShareFS to copy a load of data from the RiscPC. So every so often ShareFS stops with the “Plese make disc available..” error. If then can’t ping the other machine, or antyhing else on the network. I got it going again by rmreinit-ing the DHCP module and *DHExecute ej0. I am not sure if both actions were required, and I can have a more detailed investiation later. The DHCP server itself is running on an old RHEL server, but I have access to it and the logs, should that be useful. Anyone any ideas? Thanks Chris |
Jeffrey Lee (213) 6046 posts |
I believe that lack of DHCP auto-renew is a known issue. Or at least, there are plenty of other issues with how DHCP is handled under RISC OS 5 that it wouldn’t surprise me if auto-renew was one of them! |
Chris Johns (3727) 40 posts |
I guess a lot of people will have DHCP servers that issue longer leases, such that the machine may well be turned off before the lease runs out anyway. |
Chris Mahoney (1684) 2100 posts |
I have a 1-day lease at home and have had my Pi on for weeks without it dropping the connection. On the other hand, given that my home network is fairly stable it’s probably handing out the same IP address each and every time… |
Rick Murray (539) 13405 posts |
The Pi boots in about 14 seconds. Add a zero and double it, that’s closer to how long the Livebox takes. The boot won’t (and shouldn’t) wait that long for DHCP to respond. So I use static IP… solves many problems. |
Jeffrey Lee (213) 6046 posts |
Some DHCP servers will spot that an address is being used without a valid DHCP lease, and automatically remove that address from the list of free addresses to be used for regular DHCP. And I suspect that most servers will prefer to hand out the same address again rather than return a new one (especially if it’s just a request to extend a current lease).
Thinking about it, I’m not sure how the lease expiring could cause the Pi to be kicked off the network. Unless your router is being particularly vigilant and restricting traffic for addresses it thinks don’t have a valid lease? Or maybe the Pi is attempting DHCP renewal, but it fails and gets left in a non-functional state. |
Alan Adams (2486) 1125 posts |
Could the problem be caused by a different machine renewing, and causing an address clash? |
Rick Murray (539) 13405 posts |
I would be surprised if a router was dumb enough to hand out an address already known to it via another device…
A possible way around this would be to look in the advanced settings to see if DHCP has a way to hand out the same IP by MAC address. I’ve done this on my Livebox for the Pi so the address is effectively “reserved”. |
Jon Abbott (1421) 2599 posts |
Are you sure the lease isn’t renewing, did ifconfig show a 169 address? It could be the bug where it renews the lease, but fails to set the router and/or DNS. Next time it occurs, check which values aren’t being set via ifconfig…assuming the DHCP server is still showing the lease as active. |
Chris Johns (3727) 40 posts |
DHCPInfo shows the address being renewed, and bound, with the expiry time still in the future. However ifconfig doesn’t show any address, so it’s not just the router being set. IIRC thst wouldn’t stop ShareFS working anyway as both machines are on the same 192.168.1/24 network. |
Steve Pampling (1551) 7932 posts |
Debatable. The DHCP response timeout is anything up to 62 seconds1.
The DHCP servers don’t care if the address is in use, only whether the address is validly registered in its database.
Quite likely and Chris should note that the IP renewal is at 2.5 minutes in his office network (the standard is to renew at half the lease period so if you want a known stable, non-renewed IP for 10 minutes the lease period should be 20 minutes. That said if the office staff plus guests amounts to less than 150 and you’re using a default style scope of /24 (class C, 254 addresses) then 10 minutes is silly aggressive lease renewal.
Couldn’t possibly comment. However, even the simplistic BT homehub is capable of holding a reservation for an IP that can either be a method of always being assigned the same IP from the DHCP pool and stopping it being available for other use which also means that if you do manually assign an IP nothing else tries to use it.
Chris, if you’re saying what I think you are then see my comments about renewal at lease_period / 2 Oh, and just for extra amusement Apple devices will sometimes not bother with the DHCP server but simply sniff the traffic on the segment and select themselves a matching IP with a “I’m an apple and you don’t deserve the address I want” bully boy behaviour2. 1 I know because a supplier had problems with on a printer with print job management software built in. The Kyocera printer had firmware that enabled both BOOTP and DHCP when simply set for DHCP and the requests started before the system had authenticated on the switch port. Standard authentication is 3 x dot1x challenge with timeouts of 30 seconds plus authentication delay for the MAB (MAC Authentication Bypass – basically, “I know your MAC so you can connect”) so by the time the MAB completed the printer had given up on DHCP, went to a 169.254.0.0 (APIPA) address and the management server bound to that and couldn’t talk to anything. 2 Unless the network administrator has a nice RADIUS system that says “go away I’m afraid I don’t like you” (rough translation) to such intruder devices (anything with an Apple NIC top of the list) |