Lope
Posts: 70
Joined: Tue Jul 02, 2013 7:53 pm

Raspbian's new insanely bad design decision: DHCP Static IPs [obsolete]

Mon Mar 14, 2016 7:19 am

I've recently been informed, and have seen a few sites claiming that in Raspbian Jessie:
1. /etc/network/interfaces will no longer be used properly.
2. All interfaces must be defined as DHCP inside /etc/network/interfaces (including those you want to have Static IPs)
3. Static IP's must be defined inside dhcpcd.conf

That's like defining a nightmare inside positive-experiences.conf.

This is a bad deviation from Debian / convention
I double checked with Debian Jessie, this change doesn't come from them. They still use /etc/network/interfaces properly
https://wiki.debian.org/NetworkConfiguration
I've confirmed this with 2 people on Freenode #debian

Arch Linux, as another example still defines static IP's in their normal way, inside /etc/netctl/my_static_profile

This is a deviation from Debian's design. And it's not a good change at all. It's a confounding of terminology. RbPi is supposed to be a teaching tool. So to start introducing pointless syntactic inconsistencies is counter productive to education IMO.

I'm not supporting this madness
If the above change is really the case, I for one will not support this madness. I'll switch to another distro. Likely Ubuntu, who's deviations are either optional or arguably improve upon Debian. Unfortunately Ubuntu won't work on the Pi A, A+, B, b+ and Zero.

This is where I discovered the problem:
viewtopic.php?f=36&t=139801

User avatar
rurwin
Forum Moderator
Forum Moderator
Posts: 4257
Joined: Mon Jan 09, 2012 3:16 pm

Re: Raspbian's new insanely bad design decision: DHCP Static

Mon Mar 14, 2016 7:36 am

It's not a problem; it's a great new opportunity. Here's some of the stuff you can do in dhcpcd.conf:
  • Have a different static IP address depending on which network you are connected to. Because an address that works on one network is often invalid on another,
  • Have a static IP address only when there is no DHCP server.
  • Like many quadcopters etc, have the Pi be its own network with a DHCP server, so you can connect to it on your phone out in the middle of a field.

mattmiller
Posts: 2247
Joined: Thu Feb 05, 2015 11:25 pm

Re: Raspbian's new insanely bad design decision: DHCP Static

Mon Mar 14, 2016 8:38 am

It's not a problem; it's a great new opportunity. Here's some of the stuff you can do in dhcpd.conf:
Have a different static IP address depending on which network you are connected to. Because an address that works on one network is often invalid on another,
Have a static IP address only when there is no DHCP server.
Like many quadcopters etc, have the Pi be its own network with a DHCP server, so you can connect to it on your phone out in the middle of a field.
Is there a simple guide to setting these behaviours?
Matthew

User avatar
rurwin
Forum Moderator
Forum Moderator
Posts: 4257
Joined: Mon Jan 09, 2012 3:16 pm

Re: Raspbian's new insanely bad design decision: DHCP Static

Mon Mar 14, 2016 9:08 am

That depends on what you mean by simple. There may well be; I haven't looked. I picked that up by scanning "man dhcpcd.conf". It's not a step-by-step tutorial for newbies and it would take a little experimentation, but it seems fairly straightforward.

Edit: making a DHCP server is the obvious one because that's a common requirement: http://www.brennan.id.au/10-DHCP_Server.html

User avatar
Milliways
Posts: 788
Joined: Fri Apr 25, 2014 12:18 am
Location: Sydney, Australia

Re: Raspbian's new insanely bad design decision: DHCP Static

Mon Mar 14, 2016 9:38 am

Lope wrote:I've recently been informed, and have seen a few sites claiming that in Raspbian Jessie:
1. /etc/network/interfaces will no longer be used properly.
2. All interfaces must be defined as DHCP inside /etc/network/interfaces (including those you want to have Static IPs)
3. Static IP's must be defined inside dhcpcd.conf
The above is wrong on most points.
1. The changes are related to the adoption of dhcpcd as default network setting. If you want to use the old style just turn off dhcpcd.
2. Your 2. is totally wrong. Any use of dhcp disables dhcpcd.
3. Static IP addresses are an aberration for Pi users. This seems to be something that other platforms do not have. There are better ways unless your are running a DHCP server where it is necessary.

I agree that the cavalier way the Foundation introduced the networking changes without adequate documentation or consideration of older practices was unconscionable.

Lope
Posts: 70
Joined: Tue Jul 02, 2013 7:53 pm

Re: Raspbian's new insanely bad design decision: DHCP Static

Mon Mar 14, 2016 9:51 am

@Rurwin: Thanks for the interesting reply.
I appreciate these advancements in capability you describe. And that's one of the great benefits of Linux, the power, flexibility, configurability.

I see that dhcpcd is (or has recently become) more of a general purpose network interface manager.
And thus it should be renamed to an appropriate name like "new network manager" or some nice short linux-style name. It's fine if the network-manager has a capability of DHCP, but syntactically calling it dhcpcd is a mess.

Considering this, my first reaction was to say that /etc/network/interfaces should be done away with completely.
But I see that it's being kept around for compatibility reasons (which is a questionable reason to keep something around that now creates confusion with the misleading "dhcp" which now means "use new network manager".
That's very undesirable. Although I edited the file many times I never once noticed the new warning (that I looked for now) that the file was generated by dhcpcd.conf. Anyone familiar with how /etc/network/interfaces is likely to miss that comment. New linux installs often spit out text that one has to ignore, such as the license warning at /etc/motd
Anyway I'm not happy about /etc/network/interfaces dhcp meaning "use new network manager" but I could reluctantly accept it for a while.

Other than that, dhcpcd REALLY needs to be renamed to something more appropriate.

I could probably come up with a very compelling case why the `cp` program should delete files instead of copy them if you give it a -R or --remove flag.
Or make the `rm` program create a directory at ~/rm-trash and just mv the files there instead, with a little new warning displayed in the syslog, the first time it's used after booting up, for users who aren't familiar with the new "feature".
But is that really what we want?
I think it's a very good idea not.
Milliways wrote:The above is wrong on most points.
1. The changes are related to the adoption of dhcpcd as default network setting. If you want to use the old style just turn off dhcpcd.
2. Your 2. is totally wrong.
3. Static IP addresses are an aberration for Pi users. This seems to be something that any other platforms do not have. There are better ways unless your are running a DHCP server where it is necessary.

I agree that the cavalier way the Foundation introduced the networking changes without adequate documentation or consideration of older practices was unconscionable.
1. It's not possible to disable the dhcpcd service, to stop interfering with my /etc/network/interfaces or wlan0 if I need dhcp functionality for my wlan1.
2. See #1
3. Pi users are not only students using Pis as client computers. Pi students might want to learn about networking, or need incoming connections while having a crappy DHCP server that can't make client IP's static. Pi's are used for many industrial apps. Reqirements may vary, one may not have ability to predict or control the DHCP server in a given environment. There is no reason anyone should have to justify/explain why it's important to have the ability to have a static IP on any interface when desired, this is Linux.
Last edited by Lope on Mon Mar 14, 2016 9:58 am, edited 2 times in total.

User avatar
PeterO
Posts: 6095
Joined: Sun Jul 22, 2012 4:14 pm

Re: Raspbian's new insanely bad design decision: DHCP Static

Mon Mar 14, 2016 9:56 am

Most PI users don't care how their PI gets an IP address. If you are worried about this, then you already know enough to find out how to do it.
Even Lope has worked it out !
There is no issue here.

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

Lope
Posts: 70
Joined: Tue Jul 02, 2013 7:53 pm

Re: Raspbian's new insanely bad design decision: DHCP Static

Mon Mar 14, 2016 10:00 am

PeterO wrote:Most PI users don't care how their PI gets an IP address. If you are worried about this, then you already know enough to find out how to do it.
Even Lope has worked it out !
There is no issue here.

PeterO
Translated:
Most people are dumb. So let's make a dumb world. It's okay because the dumb people won't notice.

Terrible logic used to justify low standards. Maybe you can get them to add a tagline to Raspbian. "The OS for morons"

Or we can just have higher standards? Meaning that words should mean what they actually mean?

I could imagine what would happen if you built a terminal

$ thing --dostuff
I did good stuff.
$ Ok thanx!
You're welcome!
Last edited by Lope on Mon Mar 14, 2016 10:07 am, edited 1 time in total.

User avatar
Milliways
Posts: 788
Joined: Fri Apr 25, 2014 12:18 am
Location: Sydney, Australia

Re: Raspbian's new insanely bad design decision: DHCP Static

Mon Mar 14, 2016 10:06 am

Lope wrote: 1. It's not possible to disable the dhcpcd service, to stop interfering with my /etc/network/interfaces or wlan0 if I need dhcp functionality for my wlan1.
it is simple systemctl stop dhcpcd. Just using dhcp in /etc/network/interfaces will disable dhcpcd (although it will generate an error message).

Lope
Posts: 70
Joined: Tue Jul 02, 2013 7:53 pm

Re: Raspbian's new insanely bad design decision: DHCP Static

Mon Mar 14, 2016 10:08 am

Milliways wrote:
Lope wrote: 1. It's not possible to disable the dhcpcd service, to stop interfering with my /etc/network/interfaces or wlan0 if I need dhcp functionality for my wlan1.
it is simple systemctl stop dhcpcd. Just using dhcp in /etc/network/interfaces will disable dhcpcd (although it will generate an error message).
Actually you mean mask, not stop.
So how am I going to get a DHCP IP on wlan1 if I stop dhcpcd?

I suspect you're wrong, and you've not addressed any of the concerns in my 2nd post in this thread. The line of argument you're taking is moot at this point.

User avatar
PeterO
Posts: 6095
Joined: Sun Jul 22, 2012 4:14 pm

Re: Raspbian's new insanely bad design decision: DHCP Static

Mon Mar 14, 2016 10:12 am

Lope wrote: Translated:
Most people are dumb. So let's make a dumb world. It's okay because the dumb people won't notice.
Sigh
Not at all. The PI is an educational tool. That means it needs to be easy to use. Beginners should not have to learn about IP network configuration on Day 1 Lesson 1.

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

Lope
Posts: 70
Joined: Tue Jul 02, 2013 7:53 pm

Re: Raspbian's new insanely bad design decision: DHCP Static

Mon Mar 14, 2016 10:20 am

Your response is a non sequitur. I won't waste further time responding to you.

User avatar
PeterO
Posts: 6095
Joined: Sun Jul 22, 2012 4:14 pm

Re: Raspbian's new insanely bad design decision: DHCP Static

Mon Mar 14, 2016 10:21 am

Lope wrote:Your response is a non sequitur. I won't waste further time responding to you.
Classic concern troll behaviour !

It's not clear why you are even still here !
"I'm not supporting this madness If the above change is really the case, I for one will not support this madness. I'll switch to another distro."

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

Lope
Posts: 70
Joined: Tue Jul 02, 2013 7:53 pm

Re: Raspbian's new insanely bad design decision: DHCP Static

Mon Mar 14, 2016 10:34 am

I'd just like to point out for the benefit of others
PeterO wrote:Even Lope has worked it out !
So he's implying I'm below average intelligence with the weasel phrase "Even Lope" and the exclamation.

And what have I worked out?
Raspbian Jessie
(Where Jessie is the name of a DEBIAN distribution (that Raspbian as the name implies is derived from), where network interfaces are configured in /etc/network/interfaces)
Inside this file
* static doesn't mean static anymore - it means dhcpcd will interfere
* dhcp doesn't mean dhcp anymore it means "use the new network manager" (which is not called "the new network manager")
* dhcpcd is no longer a DHCP Client Daemon as the name implies. It's now a new general purpose network manager, which is the recommended way to set a static IP.

So he implies I must have been a bit dim that that was not obvious. And now he says I'm a troll too.

Charming

User avatar
PeterO
Posts: 6095
Joined: Sun Jul 22, 2012 4:14 pm

Re: Raspbian's new insanely bad design decision: DHCP Static

Mon Mar 14, 2016 10:46 am

Lope wrote:. And now he says I'm a troll too.
Oh, you were identifed as a troll after your first post ! You really don't get it. This is a non-issue because
1) It doesn't stop anything from working.
2) You can find multiple links on google that show how it works. There are multiple threads on this forum that describe the situation and show how to configure dhcpcd.conf
3) It has been this way for some time. Its only you that has just discovered the changes and are getting upset that no one told you about them !

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
rurwin
Forum Moderator
Forum Moderator
Posts: 4257
Joined: Mon Jan 09, 2012 3:16 pm

Re: Raspbian's new insanely bad design decision: DHCP Static

Mon Mar 14, 2016 10:48 am

Stop that right now, all of you. Attack the issues, not the person and do it politely and with respect. This thread has been needlessly agressive from the start and unless that stops right now it's getting locked.

The name of dhcpcd is not a Raspbian issue. You would need to take it up with the maintainers of dhcpcd.

The deafult position of Linux is that small applications do one thing well, and I support that. However here there is a lot to be gained by having one application, which has all the available information, do everything. It could be bundled up into a few separate apps, each with their own configuration files, but I don't think you would actually gain anything.

What would be useful would be a GUI app that configured dhcpcd.conf for common Pi usage scenarios, because it is capable of more nuanced behaviour than the simple tutorials have demonstrated, such as only setting a static IP address for the home network or when no DHCP server is available.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 31210
Joined: Sat Jul 30, 2011 7:41 pm

Re: Raspbian's new insanely bad design decision: DHCP Static

Mon Mar 14, 2016 12:19 pm

I see Rurwin has already posted as a mod, but let me add, I was just about to ban some of the people commenting in this thread, but I have read Rurwin and cooled down.

But names have been noted. We DO NOT allow personal insult on this site. I see it again, people start getting bans.
Principal Software Engineer at Raspberry Pi Ltd.
Working in the Applications Team.

Heater
Posts: 19101
Joined: Tue Jul 17, 2012 3:02 pm

Re: Raspbian's new insanely bad design decision: DHCP Static

Mon Mar 14, 2016 12:54 pm

It is certainly annoying when, as a long time Debian or other distro user, one gets tripped up by the network configuration change in Raspbian Jessie.

A big red warning about such breakages on the download page or somewhere would have saved a lot of frustration and searching around for clues.

Having to specify "manual" to get the new fully automated DHCP setup is weird. Having to set configure a static IP address in a DHCP conf file is just crazy.

Having said that, the new scheme is working very well around here. Things change all the time. Such is life.

For example, in Debian Jessie and KDE on my PC the mobile GSM connection works out of the box, for the first time in Linux history as far as I know. Only problem I could find no way to discover how KDE did that such that I could do the same on headless Jessie installations! Also it did not start any connections unless a user logged in.

Which brings be to my point, a GUI to click on to make all this easy for beginners is great and all, but it also needs to be simple and well documented for all the headless Pi users.
Memory in C++ is a leaky abstraction .

User avatar
rurwin
Forum Moderator
Forum Moderator
Posts: 4257
Joined: Mon Jan 09, 2012 3:16 pm

Re: Raspbian's new insanely bad design decision: DHCP Static

Mon Mar 14, 2016 1:52 pm

It could have an optional command-line interface. But that sort of misses your point.

The documentation is "man dhcpcd.conf" and it is fairly complete and understandable. There are a few concepts that don't come across well, but if one had the GUI app available to show some example configurations, I think that is all one would need.

User avatar
jahboater
Posts: 8170
Joined: Wed Feb 04, 2015 6:38 pm
Location: Wonderful West Dorset

Re: Raspbian's new insanely bad design decision: DHCP Static

Mon Mar 14, 2016 1:54 pm

I object to the new system because dhcpcd is hard to pronounce :-)
Having to specify "manual" to get the new fully automated DHCP setup is weird. Having to set configure a static IP address in a DHCP conf file is just crazy.
The "manual" bit is set by default nowadays, I only ever edit dhcpcd.conf to set static IP addresses.
I agree it is daft and unintuitive to have to edit the DHCP client daemon's config file to give details of a static address, it should just respect what's in network/interfaces.
Which brings be to my point, a GUI to click on to make all this easy for beginners is great and all, but it also needs to be simple and well documented for all the headless Pi users.
+1

Heater
Posts: 19101
Joined: Tue Jul 17, 2012 3:02 pm

Re: Raspbian's new insanely bad design decision: DHCP Static

Mon Mar 14, 2016 3:35 pm

ruwin,
It could have an optional command-line interface.
I don't want another command line interface program. My command line interface to configuration on headless systems is called "vim" or sometimes "vi".
The documentation is "man dhcpcd.conf"
No doubt. But that assumes one has ever heard of dhcpcd. dhclient is what Debian uses. Or that one would want to use "*dhcp*" anything to set a static address. There is an hour or so wasted in finding out there.

Still this forum is getting questions everyday about this mess.
Memory in C++ is a leaky abstraction .

User avatar
rurwin
Forum Moderator
Forum Moderator
Posts: 4257
Joined: Mon Jan 09, 2012 3:16 pm

Re: Raspbian's new insanely bad design decision: DHCP Static

Mon Mar 14, 2016 3:37 pm

jahboater wrote:I agree it is daft and unintuitive to have to edit the DHCP client daemon's config file to give details of a static address, it should just respect what's in network/interfaces.
No, because dhcpcd does not own network/interfaces.

network/interfaces is a configuration file for ifup. From Jessie onwards, it just specifies that ifup should ask dhcp for the data it needs using what I assume is a standardised API.

ifup and dhcpcd are the products of two different projects run by two different teams and distributors are free to choose any versions of either project to include in their distribution. If they had to agree on a fixed format for the network/interfaces file, then either one of them may encounter options that it did not understand. It is a recipe for confusion. It is worse than trying to write a web page that works for IE, Firefox, Chrome and Lynx.

It strikes me that if it were the case that only ifup was reading network/interfaces, then setting a static IP address the old way should still work, so long as "dhcp" was removed. If that is not happening then maybe something is already getting its configuration some other way, which proves my point about confusion.

Heater
Posts: 19101
Joined: Tue Jul 17, 2012 3:02 pm

Re: Raspbian's new insanely bad design decision: DHCP Static

Mon Mar 14, 2016 4:00 pm

What a mess.

Shouldn't systemd mange all this?

ducks....
Memory in C++ is a leaky abstraction .

User avatar
ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6383
Joined: Fri Jul 29, 2011 5:36 pm

Re: Raspbian's new insanely bad design decision: DHCP Static

Mon Mar 14, 2016 4:11 pm

Heater wrote:What a mess.

Shouldn't systemd mange all this?

ducks....
You joke, but perhaps in the future...
https://www.freedesktop.org/software/sy ... workd.html

User avatar
morphy_richards
Posts: 1603
Joined: Mon Mar 05, 2012 3:26 pm
Location: Epping Forest

Re: Raspbian's new insanely bad design decision: DHCP Static

Mon Mar 14, 2016 4:37 pm

A nice newbie friendly wiki and magpi article would be good. (Sits on hands, I only just about managed to set a static IP, any of the cool things rurin mentioned are beyond me)

Return to “Raspberry Pi OS”