How to forget old DHCP IP allocation

Post Reply
rustleg
Posts: 6
Joined: Wed Nov 12, 2014 10:17 am

How to forget old DHCP IP allocation

Post by rustleg »

I connected my Raspberry Pi to the 7800N using DHCP in order to find the MAC address. I then put in a different IP (192.168.1.50) for it using static ARP, outside the DHCP range (which is 192.168.1.100-200). Despite rebooting the Pi and the router, the router insists on connecting to the old DHCP address (192.168.1.105) rather than the static IP of 192.168.1.50 which I want for the Raspberry Pi. When I look at the ARP table it shows both IPs with the same MAC address but it still uses DHCP to connect to 192.168.1.105 and ignores the static allocation.

The Pi is still requesting an address via DHCP but I assumed the router would see the static ARP and provide that as the address, as did my previous router. Can I somehow get the 7800N to forget its old address and provide the static address when a DHCP request comes from the Pi? Or do I have to find a way to change the setup of the Pi to use a fixed IP rather than asking for DHCP from the router?
billion_fan
Posts: 5383
Joined: Tue Jul 19, 2011 4:30 pm

Re: How to forget old DHCP IP allocation

Post by billion_fan »

rustleg wrote:I connected my Raspberry Pi to the 7800N using DHCP in order to find the MAC address. I then put in a different IP (192.168.1.50) for it using static ARP, outside the DHCP range (which is 192.168.1.100-200). Despite rebooting the Pi and the router, the router insists on connecting to the old DHCP address (192.168.1.105) rather than the static IP of 192.168.1.50 which I want for the Raspberry Pi. When I look at the ARP table it shows both IPs with the same MAC address but it still uses DHCP to connect to 192.168.1.105 and ignores the static allocation.

The Pi is still requesting an address via DHCP but I assumed the router would see the static ARP and provide that as the address, as did my previous router. Can I somehow get the 7800N to forget its old address and provide the static address when a DHCP request comes from the Pi? Or do I have to find a way to change the setup of the Pi to use a fixed IP rather than asking for DHCP from the router?
Follow the attached guide to set the device up to obtain a fixed IP outside the DHCP range

http://www.billion.uk.com/esupport/inde ... a-computer
rustleg
Posts: 6
Joined: Wed Nov 12, 2014 10:17 am

Re: How to forget old DHCP IP allocation

Post by rustleg »

Maybe I wrote too much for you to pick up my issue. I set up the static ARP as in the guide you linked, but the 7800 isn't using it. It is still using the IP which it had allocated via DHCP before I set up the static IP. It won't use the static IP.

My understanding was (from previous router) that it should respond to a DHCP request as follows:
- if the MAC address is in the list of static ARP it should use the static IP
- if the MAC address is not in the list of static ARP it should just allocate the next IP in its pool of addresses.

Is this not so?
Martin Goose
Posts: 15
Joined: Fri Oct 10, 2014 3:22 pm

Re: How to forget old DHCP IP allocation

Post by Martin Goose »

I think that this is a Raspberry Pi problem (Raspbian) not a Billion problem. I have some notes extracted from the Raspberry Pi forums as follows:
I finally decided to give up configuring dhcpcd for static ip (unable to figure out how to configure dhcpcd with static IP and not end up with two IP addresses - one static and on dhcp).
However, rather than removing raspberrypi-net-mods I decided to remove the dhcpcd service with the following command line:

sudo update-rc.d -f dhcpcd remove

This will not boot dhcpcd at start up and all the settings from the /etc/network/interfaces are being properly implemented.
To reinstate the dhcpcd service use:

sudo update-rc.d dhcpcd defaults

--------------------------------------------

You don't need to remove the isc-dhcp-* packages, but if you are using a static IP your won't need them anyway.

It's the dhcpd5 which causes the problems.

-----------------------------------------------

DHCP client does not respect /etc/network/interfaces
removed with:-


sudo apt-get remove dhcpcd5
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
dhcpcd5 raspberrypi-net-mods
0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
After this operation, 384 kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 77851 files and directories currently installed.)
Removing raspberrypi-net-mods ...
Removing dhcpcd5 ...
Processing triggers for man-db ...
Hopefully this will help.
rustleg
Posts: 6
Joined: Wed Nov 12, 2014 10:17 am

Re: How to forget old DHCP IP allocation

Post by rustleg »

Thanks for your help. I think it is only a Raspberry Pi issue if the router won't allocate a static IP using DHCP. Can I assume this is the case? (If so perhaps something Billion firmware could be improved with in the future).
Martin Goose
Posts: 15
Joined: Fri Oct 10, 2014 3:22 pm

Re: How to forget old DHCP IP allocation

Post by Martin Goose »

Possibly something for billion_fan to answer but as I understand it the router sets aside a range for static IPs which it avoids when allocating IPs in response to a DHCP request. More correctly you set the DHCP range and static IPs are available outside this range. I use 100-200 for DHCP, with 2-99 for fixed PCs etc and 201-255 for old routers used as wireless access points. With this set-up the router allocates 100 for its USB port and 101 upwards for laptops, tablets etc which leave the house.
billion_fan
Posts: 5383
Joined: Tue Jul 19, 2011 4:30 pm

Re: How to forget old DHCP IP allocation

Post by billion_fan »

rustleg wrote:Thanks for your help. I think it is only a Raspberry Pi issue if the router won't allocate a static IP using DHCP. Can I assume this is the case? (If so perhaps something Billion firmware could be improved with in the future).
You should be fine following the guide I sent, tested and working on lots of devices (we use the a option called 'Fixed Host' to assign a static IP address to a device, as shown on the guide I posted above)


If the raspberry PI is the issue, that's something I can't comment on
Post Reply