Daft question, what static IP for my RPi.. what address?

Soldato
Joined
20 Oct 2002
Posts
18,921
Location
London
I think I'm confusing myself here.. my router is set-up as follows:

IP Address: 192.168.0.1
DHCP: On
IP Subnet Mask: 255.255.255.0

Nothing weird, all basic stuff with only 2 PCs on it. I'm troubleshooting some wireless problems with my Raspberry Pi. I want it to have a static IP in my network so I can do things with it (remote/Android control etc.) so I've assigned it to be 192.168.0.99. Is this wrong? Does the static IP need to be outside of the DHCP range, or within it? :confused: And, er, what exactly is the range? :confused:

Thanks!
 
Last edited:
Range is normally up to 192.168.0.255 so .99 should work. I personally wouldn't go quite so high, .20 is more than enough. You could even set static IP's on both and just go .2 and .3
 
It doesn't matter at all. As long as it's in the same subnet it will work.

The main reason for setting a static address outside of a DHCP range is to stop something else being assigned that address, but an address being in/out of a DHCP pool doesn't affect the ability for it to be contactable.

I'm assuming your subnet mask is 255.255.255.0 so anything in 192.168.0.x should work.
 
Thanks. I've reserved it to 192.16.0.99 and changed the RPi to use DHCP. Seems to have connected fine. I'll wait and see if I get any disconnects like I did previously. I went round the houses a bit as the wireless adapter I was using was known to have a power saving function, which would bizzarely cut the connection even if it was being used (!), so when I was gettign connection drops I've assumed I hadn't done the fix for that correctly (first time using Linux etc.). Perhaps it didn't like a static IP :confused: ... I will report back!
 
It'll be nothing to do with a static IP causing issues, as a DHCP request results in an identical configuration as far as layer 3 goes.

With your subnet mask you can happily assign the Pi anywhere between 0.1 and 0.254, obviously not causing conflicts with your other static host (the router) and the DHCP range.
 
Best solution = connect the RPi up using ethernet and set a static address for it on your router.
Wireless solution = check the online list of known working wireless adapters with the RPi, I know some can seem to work, but cause issues.

It's good practice to edit your DHCP range on the router, so it only dishes IP's out to a certain range. The set the statics outside that range (so they never accidentally get used up)

Persoanlly, mine start at 0.20 up to 0.100 something, I set my static IP's on the router for things like fileserver, pi, media machine etc to 0.2, 0.3, 0.4 so they're easy to remember.
 
It's good practice to edit your DHCP range on the router, so it only dishes IP's out to a certain range. The set the statics outside that range (so they never accidentally get used up)

Persoanlly, mine start at 0.20 up to 0.100 something, I set my static IP's on the router for things like fileserver, pi, media machine etc to 0.2, 0.3, 0.4 so they're easy to remember.

This.

Though I use a slightly different set of numbers, this is also what I do.
 
Back
Top Bottom