5

I was doing some searching to find out how to manually specify the IP address in my Raspberry Pis because like everything else on the Pi/Linux I could not use intuition or experience to figure it out. I was searching for instructions in general, but I am working on the wired adapter.

I found these two articles, and almost everyone said that manually setting the Pis IP address was a bad idea, which seems odd to me.

Setting up static ip address on Raspian jessie

How do I set up networking/WiFi/static IP address?

I work with embedded systems and help people set up networks of embedded devices and we frequently use static IP addresses so they can be kept track of in a spreadsheet.

Why would manually setting IP addresses for Raspberry Pis be the wrong step?

I saw mentions that you should use a DHCP reservation instead and/or use zerconf tools like avahi. I don't see those as a comparable solution, but a way to address other issues and potentially mitigate a learning curve. The first problem with DHCP reservations is if you start to tinker with your router (eg go from stock to OpenWRT), the rules disappear.

  • Why would they not be frowned on? Put another way, your question implies there's something unusual going on when, as Milliways points out, static IPs are normally everywhere considered a weapon of last resort. – goldilocks Dec 25 '15 at 8:23
  • 2
    If you need a particular IP (and you can't reserve it on your router), modify you /etc/dhcp/dhclient.conf and add the line send dhcp-requested-address 192.168.1.240; (or whatever address you need). However, not sure if this is a generic answer. – fcm Dec 25 '15 at 14:53
  • I like static IP addresses to make it easier to Telnet in – Mawg Jun 8 at 21:52
10

I was the author of one of the articles you mentioned (which I wrote in sheer frustration at the number of questions about setting up networking).

There are a few objections to static IP addresses.

  1. You have to reconfigure the Pi every time you move it to a new network. This is despite the fact that almost every network/router has a DHCP server to do this automatically. In contrast I can take my Pi with me and plug it into almost any network or computer and it just works.

  2. Most of the people who ask DO NOT UNDERSTAND networking, and get it wrong. Even those who do understand the principles of IP addressing often do not know how to set it up (i.e. which files to modify and which services to disable).

  3. The most common reasons for using static IP addresses is so that people have a "known" address. There is actually nothing wrong with this (I use address reservation myself, because it simplifies stored known_hosts). Again, this is unnecessary as most modern computers support zero-conf.

  4. There are valid reasons for using static IP addresses e.g. running a DHCP server or logically separate networks.

Lastly, the use of static IP addresses is a kind of Pi disease. You don't see Windows or Mac users wanting to set static IP addresses.

  • 1
    Now I know why. – Gene Dec 25 '15 at 11:24
  • 4
    I have an objection to this statement. I have been setting up half a dozen Pis on a school network to run 3d printers for teachers and student organizations, using static IPs (as for pretty much everything that isn't a client device, be it a 2D printer, server, etc) We don't have any zeroconf systems, and we stay away from them like the plague. Simply blanket-stating that static IPs are a Pi disease is looking only at the picture of home-network setups. – hexafraction Dec 25 '15 at 14:15
  • 2
    I now understand your context. However, you should state that context in your answer. In the Linux world, hanging yourself with your own rope and giving the minimum technical answer seem to be the norm, yet here you're giving advice to try to prevent n00bs from hanging themselves with their own rope. That's good, just clarify it for those of us who are only n00bs to Linux/Raspberry Pi and have other knowledge and experience to draw from. – YetAnotherRandomUser Dec 25 '15 at 16:44
  • 2
    @allanonmage If you read the post it was qualified. I never said static IP address was a "bad idea" but "is rarely the best thing to do" and then proceeded to explain how to configure a static value. My article is geared at helping the vast number of new users struggling to get their Pi (especially WiFi) working (as I did myself). – Milliways Dec 25 '15 at 22:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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