Page 1 of 1
B3 not renewing IP address
Posted: 19 Aug 2011, 03:49
by AzP
Hi guys
Sorry if this has been posted before, but the search is a bit too wide to find "new ip" or anything like it =)
Is there a way to force the Bubba3 to renew its IP address? It doesn't seem to do it by itself. I actually have to reboot it for it to be accessible from the network if I connected the TCP/IP cable while it's running.
Shouldn't there be automatic (hotplugging?) renewal of IP address on the connection of a network cable?
Re: B3 not renewing IP address
Posted: 19 Aug 2011, 03:54
by johannes
There is, but there is a timeout on something like 10-20 seconds (glitch prevention). So if you unplug cables, make sure to keep them unplugged long enough.
Re: B3 not renewing IP address
Posted: 19 Aug 2011, 04:06
by AzP
I know I did, I had it unplugged while it booted, and then connected the cable after perhaps 20 minutes. But still no new IP number.
I will try unplugging/replugging it again when I get home to see if it fixes it though.
Doesn't the dhcp client try to renew its address after an hour or so? Even though I haven't unplugged a cable I mean.
Re: B3 not renewing IP address
Posted: 19 Aug 2011, 04:10
by johannes
Ah, then you have experienced another thing. When set to "auto mode", B3 asks for an IP adress first. When it doesn't get responses (no cable plugged in) for something like ten seconds, it falls back to be a router (beleiving this is how you have plugged it in), taking the default IP and starting the DHCP server itself.
Could this be it?
Renewal is set in the router, the dhcp lease given by your router comes with a life-time.
Re: B3 not renewing IP address
Posted: 19 Aug 2011, 04:13
by AzP
Yeah I guess that could be it... But I have set the Bubba to be "server only" in the settings on the web interface. Does it still do the fall-back?
Re: B3 not renewing IP address
Posted: 19 Aug 2011, 04:16
by johannes
If you mean "server only", yes I think it actually still can fall-back when it doesn't get a response from a DHCP server (as a security measure), but it really should ask for a new IP when you plug the cable in to B3 (it triggers on link changes, so you need to plug/unplug directly in B3, not behind switches etc.).
Re: B3 not renewing IP address
Posted: 19 Aug 2011, 04:44
by AzP
Cool I'll try it! It could be that I first plugged it into the B3, waited for a while, and then plugged it into the switch.
Re: B3 not renewing IP address
Posted: 19 Aug 2011, 10:32
by Cheeseboy
Johannes,
Isn't it cached somewhere in a file for both eth0 and eth1?
So the DHCP client will always try to get the same IP again after a restart if it is available on the DHCP server?
A year ago I had to force a new eth0 IP from my ISP (I use my B3 as a router etc. as well) due to an extensive distributed ssh attack, and I remember I had to delete a file somewhere with the old IP address before rebooting in order to get a new IP address from the DHCP server... Can't find the file now though (only had a few minutes to look).
Re: B3 not renewing IP address
Posted: 19 Aug 2011, 16:49
by Ubi
The caching takes place on the server, fortunately

Re: B3 not renewing IP address
Posted: 19 Aug 2011, 17:19
by johannes
Anyways perhaps it's just a misunderstanding? Perhaps it does ask for a new lease and receives the same IP (as it should) so you don't notice it?
Re: B3 not renewing IP address
Posted: 19 Aug 2011, 17:54
by 6feet5
I'm no expert in these matters, but I believe the client can request its last known address, just like Cheeseboy say, but the server may ignore this if needed.
When you (AzP) say "request new IP address", do you mean a new unique IP address, different from the previous one, or do you mean request a new address, possibly the same as last time, as in an ordinary "DHCP discovery"?
/Johan
Re: B3 not renewing IP address
Posted: 19 Aug 2011, 18:29
by Cheeseboy
Found them:
Code: Select all
niklas@b3:/var/lib/dhcp$ ls -l
total 20
-rw-r--r-- 1 root root 7112 Aug 20 00:15 dhclient.eth0.leases
-rw-r--r-- 1 root root 4617 Dec 1 2010 dhclient.eth0.leases_old
-rw-r--r-- 1 root root 1102 Oct 16 2010 dhclient.eth1.leases
-rw-r--r-- 1 root root 0 Sep 13 2010 dhclient.leases
The one with the _old extension is the one I renamed in order to force a new IP back then...
Re: B3 not renewing IP address
Posted: 21 Aug 2011, 16:13
by AzP
When I said "Request new address" I meant "get an IP address at all" so it could get network access. The B3 always gets the same address from the dhcp server and that's great. I guess the problem is that it didn't get the gateway etc. settings correctly.
The unplug-wait for a while (I waited a couple of hours, hehe)-plug in again didn't work, I had to restart the B3 to get it to connect to my lan again.
I'm going to setup a fixed IP instead, so the gateway is always set. It's going to make it a lot easier for me =)