2

I've got a Netgear router which is acting as a DHCP server. There I've configured the MAC address of my RaspPI for obtaining a reserved/fixed IP address.

Unfortunately when booting the RaspPI no IP address is being obtained and assigned to the ethernet interface, hence the box is unreachable on the LAN.

When removing the reserved/fixed IP configuration all is just peachy, and the RaspPI is being presented with the first free IP of the DHCP pool.

How to tackle this one, so that the RaspPI can obtain the reserved/fixed IP from the router?

8
  • Do you have any other devices that successfully get static IP addresses? Commented Jan 10, 2013 at 2:05
  • 3
    The solution is probably on the Netgear router. I use a fixed IP assignment based on the MAC address of my pi on my Fedora DHCP server and it works fine.
    – TomG
    Commented Jan 10, 2013 at 2:59
  • Please upload a screen shot of the config page from the Netgear router, where you set the statis IP of the RPi. I had to do this and also found that the Netgear instructions were not too clear.
    – Vincent P
    Commented Jan 10, 2013 at 5:49
  • You're going to need to assign it on the Raspberry Pi itself. I had this same problem running DD-WRT on my router. If you do it on the Pi, you can even assign a specific gateway and subnet whereas most routers will automatically assign those (with no way to change it). Commented Jan 10, 2013 at 17:25
  • Yes, all other devices are working properly fine! Only the RaspPI is having some issues! :(
    – user4338
    Commented Jan 10, 2013 at 18:56

5 Answers 5

1

Some people have found that a new MAC address is generated every time their Pi boots. Check that the MAC address is the same every time you reboot. If not, read this thread on the Raspberry Pi forum: http://www.raspberrypi.org/phpBB3/viewtopic.php?p=90975

Try adding the following to /boot/config.txt

program_serial_random=1
program_board_rev=2
1

One way to get a fixed IP address is to have the Raspberry Pi request it from your router. I have a hotspot that won't let me assign IP addresses - so I have my Pi request it after the network is on-line on the Pi.

I wrote a blog post about how I accomplished this with all the details. To boil it down - add:

send dhcp-request-address 192.168.0.XXX

to /etc/dhcp/dhclient.conf

Then run:

dhclient -r -v && dhclient -4 -d -v -cf /etc/dhcp/dhclient.conf wlan0

The post explains how to set-up a systemd service that runs after the network starts. So far it's worked flawlessly, but I'm not sure what will happen if that address is already taken, or if it won't assign the IP for another reason.

0

Have you tried restarting the router after you set the static IP assignment on the Netgear ?
Perhaps something is going wrong with the DHCP server within the Netgear...

-1

Try this. I am not sure if you are having the same problem as me. I was not able to access the internet through my raspberry pi neither was i getting it connected to the lan through it. I tried sudo ifup eth0 and got the error message as the one shown in the link.

-1

do it the linux way is to make the raspberry pi have a static ip.

cd /etc/network

then

sudo nano interfaces

then you will see a line like iface eth0 inet dhcp

change the "dhcp" to "static"

then underneath that (like next line):

 address 192.168.1.68
 netmask 255.255.255.0
 gateway 192.168.1.64
 dns-nameservers 1.2.3.4  5.6.7.8

and thats how you make a static ip.

i have never heard of a router giving out static. at least my training in CompTIA's A+ and Network+ dont say that. Windows and Mac work the same way.

gateway is the router your using. you dont have to put the dns line in, but if you use opendns, then i would.

the ip addresses and netmask are things you would change to suit your situation. i hope this helps!

1
  • Generally, routers can reserve IP addresses for a specific mac address...in effect making it static.
    – Lawrence
    Commented Sep 8, 2013 at 7:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.