Nemo1966
Posts: 62
Joined: Fri Jan 01, 2016 8:02 pm

Wheezy + Jessie new style static IP question

Tue Jan 26, 2016 2:19 pm

Ok so i found out that usuing the standard linux way to create a static IP doesn't work anymore e.g. In "/etc/network/interfaces" change to something like:

Code: Select all

auto eth0
iface eth0 inet static
   address 192.168.1.1
   netmask 255.255.255.0
   network 192.168.1.0
   gateway 192.168.1.200
   dns-nameservers 8.8.8.8
Easy right? Well as I say someone in their infinite wisdon decided this was much to easy and efficient and now we have to change "/etc/dhcpcd.conf"

Add lines at the bottom

Code: Select all

interface eth0
inform 192.168.1.1  
static routers=192.168.1.200
Anyhoot - I was looking at playing with a Pixelserv type Adblocking server (basically a small webserver that serves up a clear pixel to replace adverts).

Now for this you have to add lines to the "/etc/network/interfaces" so it looks like this:

Code: Select all

iface eth0 inet static
   address 192.168.1.1
   netmask 255.255.255.0
   network 192.168.1.0
   gateway 192.168.1.200
   dns-nameservers 8.8.8.8
   post-up ip addr add dev eth0 192.168.1.254/24
   pre-down ip addr del dev eth0 192.168.1.254/24
So to the question - how do you achieve the same thing with the new fanged "/etc/dhcpcd.conf" implementation?

thanks

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5973
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Wheezy + Jessie new style static IP question

Tue Jan 26, 2016 2:38 pm

Code: Select all

interface eth0
static ip_address=192.168.1.1/24	
static routers=192.168.1.200
static domain_name_servers=8.8.8.8
Then I believe the post-up, pre-down stuff could be handled by adding hooks, but I haven't played around with that myself. Try "man dhcpcd-run-hooks"

Nemo1966
Posts: 62
Joined: Fri Jan 01, 2016 8:02 pm

Re: Wheezy + Jessie new style static IP question

Tue Jan 26, 2016 2:47 pm

Ah right - thanks

Nemo1966
Posts: 62
Joined: Fri Jan 01, 2016 8:02 pm

Re: Wheezy + Jessie new style static IP question

Tue Jan 26, 2016 5:49 pm

OK well after a little research I ditched the ludricrous Raspbian dhcpcd attempt at networking and just disable it

Code: Select all

update-rc.d -f dhcpcd remove
Changed the filename dhcpcd.conf to dhcpdc.conf.old (just to be sure) and used the standard /etc/network/intefaces method.

Seems the Raspbian devs are trying to shoehorn as much cr#p into the releases as they can just for the sake of it. Firefox did this at one stage - just rammed the browser with so much crud and "utilities" that it made the browser unusable. Then suddenly realised and started removing it again.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5973
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Wheezy + Jessie new style static IP question

Tue Jan 26, 2016 5:53 pm

Nemo1966 wrote: Seems the Raspbian devs are trying to shoehorn as much cr#p into the releases as they can just for the sake of it.
No, that's not our mission here, but I am glad you found a solution that works for you.

Nemo1966
Posts: 62
Joined: Fri Jan 01, 2016 8:02 pm

Re: Wheezy + Jessie new style static IP question

Tue Jan 26, 2016 6:04 pm

ShiftPlusOne wrote:No, that's not our mission here, but I am glad you found a solution that works for you.
Any idea why the change was deemed to be needed? Were there thousands of complaints that the standard dchp/static system wasn't working?

User avatar
DougieLawson
Posts: 36182
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Wheezy + Jessie new style static IP question

Tue Jan 26, 2016 6:08 pm

Nemo1966 wrote: Any idea why the change was deemed to be needed? Were there thousands of complaints that the standard dchp/static system wasn't working?
They did it to simplify the GUI which normally uses a DHCP address (but can edit files behind the scenes) and forgot that lots of folks run their RPis headless as servers with a static address. The whole raspberrypi-net-mods package needs some serious attention because it's badly implemented.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Nemo1966
Posts: 62
Joined: Fri Jan 01, 2016 8:02 pm

Re: Wheezy + Jessie new style static IP question

Tue Jan 26, 2016 6:42 pm

DougieLawson wrote:
Nemo1966 wrote: Any idea why the change was deemed to be needed? Were there thousands of complaints that the standard dchp/static system wasn't working?
They did it to simplify the GUI which normally uses a DHCP address (but can edit files behind the scenes) and forgot that lots of folks run their RPis headless as servers with a static address. The whole raspberrypi-net-mods package needs some serious attention because it's badly implemented.
Boom! that answers it nicely. Hey Dougie, do you know what else is in the rpi-net-mods package?

thanks

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5973
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Wheezy + Jessie new style static IP question

Tue Jan 26, 2016 7:43 pm

When dhcpcd was added to raspbian, I made sure the raspbian lite image used the traditional setup, because I was of the same mindset as you.

That turned out to be a bad decision. Problems kept popping up and they were not resolvable without switching to dhcpcd. I am sure there's a thread documenting some that. I've switched raspbian lite to dhcpcd and the situation improved greatly.

I run it myself at home on my pi access point and nas. The setup, without ever touching a GUI, was quicker and simpler than using /etc/network/interfaces. Has been running solid without any problems for months. Once you learn to use it and stop expecting it to be /etc/network/interfaces, dhcpcd is fantastic.

There is one (upstream) bug that I am aware of which is a result of some packages still using sysvinit services, but that will get resolved.

If a different solution suits you better, that's great. Does it have a lightweight gui that looks okay? How does the ethernet connection interact with wifi? Does it automatically reconnect to the network if you lose connectivity or the wifi dongle is unplugged?

It just so happens that dhcpcd is the only stable software that works under jessie, meets all of that criteria, is lightweight, well documented and is perfectly usable from the command line.

Dougie, I would love to hear what you think is wrong with net-mods and what your proposed solutions are. NetworkManager? Wicd? Traditional setup with ifplugd? Forget trying to provide a stable network connection that just works? All the options have been considered and tried. DHCPCD is used because it works and is the only suitable option.

User avatar
DougieLawson
Posts: 36182
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Wheezy + Jessie new style static IP question

Tue Jan 26, 2016 7:52 pm

You should look at how it's done with Arch. They've got it working. I can't comment on the GUI, there's only one of my nine RPis running the GUI (because it's got the touch screen) it connects to my WiFi so I don't care how it does it.

We don't need ifplugd, because folks who connect two interfaces usually know what they're doing and most of the complaints were "why does my WiFi break when I plug in the ethernet?". Wicd when it works does a good job, but it's got an excessive CPU load when I've run it.

There's lots of tutorials (including the MagPi mag issue #40) that document how to set a static address in /etc/network/interfaces so put that piece back and sanity returns.

The other thing that's needed is a way to provide WiFi credentials from the FAT partition (/boot) so that folks can pull a card, fix it up in Windows and get WiFi working on the next boot. [Don't get me started on things that are wrong with NOOBS.]
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5973
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Wheezy + Jessie new style static IP question

Tue Jan 26, 2016 8:08 pm

DougieLawson wrote:You should look at how it's done with Arch. They've got it working. I can't comment on the GUI, there's only one of my nine RPis running the GUI (because it's got the touch screen) it connects to my WiFi so I don't care how it does it.

We don't need ifplugd, because folks who connect two interfaces usually know what they're doing and most of the complaints were "why does my WiFi break when I plug in the ethernet?". Wicd when it works does a good job, but it's got an excessive CPU load when I've run it.

There's lots of tutorials (including the MagPi mag issue #40) that document how to set a static address in /etc/network/interfaces so put that piece back and sanity returns.

The other thing that's needed is a way to provide WiFi credentials from the FAT partition (/boot) so that folks can pull a card, fix it up in Windows and get WiFi working on the next boot. [Don't get me started on things that are wrong with NOOBS.]
Yes, Arch uses DHCPCD. We took their systemd unit for it, which is pretty much all there is to it. All net-mods does is make sure dhcpcd is installed and that /etc/network/interfaces is set up to use it. What's not working for you? Whack the relevant lines in dhcpcd.conf and off you go. If that doesn't work, please file a bug report so we can fix it.

There are plenty of old resources which are outdated, that's true across the board. We've had a major transition to device tree and to systemd.... it comes with the territory and it's very unfortunate. If /etc/network/interfaces worked the way it needs to, there would not have been any need to change things.

User avatar
DougieLawson
Posts: 36182
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Wheezy + Jessie new style static IP question

Tue Jan 26, 2016 8:14 pm

So why does it work for DebIan and Ubuntu? They haven't ditched network-manager.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Nemo1966
Posts: 62
Joined: Fri Jan 01, 2016 8:02 pm

Re: Wheezy + Jessie new style static IP question

Tue Jan 26, 2016 8:17 pm

DougieLawson wrote:So why does it work for DebIan and Ubuntu? They haven't ditched network-manager.
I was just typing exactly the the same thing - Ubuntu would be my prefered OS. It works and works well.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5973
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Wheezy + Jessie new style static IP question

Tue Jan 26, 2016 8:35 pm

DougieLawson wrote:So why does it work for DebIan and Ubuntu? They haven't ditched network-manager.
What doesn't work for you when it comes to dhcpcd?

I actually suggested network-manager over dhcpcd, but it turns out to be a terrible idea too. It also work AROUND /etc/network/interfaces. It's more difficult to configure from the command line. nm-applet is developed by gnome and that comes with a few problems. It is certainly not lightweight.

I am not sure why you're using Debian or Ubuntu as examples, because I don't think anybody would suggest that running Unity or Gnome3 would be a good idea on the pi. nm-applet is designed to work well in those environments. I don't know what Mate have done to fix it (probably using an older version as a starting point), but it's still not the best option.

User avatar
DougieLawson
Posts: 36182
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Wheezy + Jessie new style static IP question

Tue Jan 26, 2016 8:39 pm

ShiftPlusOne wrote:
DougieLawson wrote:So why does it work for DebIan and Ubuntu? They haven't ditched network-manager.
What doesn't work for you when it comes to dhcpcd?
I've not worked out how to run my Hurricane Electric IPv6 tunnel with dhcpcd, so the machine running that has raspberrypi-net-mods and dhcpcd un-installed.

Remember I'm not running the GUI eight out of nine of my Raspberries run headless.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5973
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Wheezy + Jessie new style static IP question

Tue Jan 26, 2016 9:02 pm

DougieLawson wrote:
ShiftPlusOne wrote:
DougieLawson wrote:So why does it work for DebIan and Ubuntu? They haven't ditched network-manager.
What doesn't work for you when it comes to dhcpcd?
I've not worked out how to run my Hurricane Electric IPv6 tunnel with dhcpcd, so the machine running that has raspberrypi-net-mods and dhcpcd un-installed.

Remember I'm not running the GUI eight out of nine of my Raspberries run headless.
Thanks. It looks like you may have the right solution. Arch pretty much tells you to create your own service for it. Since it seems to be free, I'll play around with it at some point and see if I can come up with an elegant configuration for it... probably not.

As far as running headless goes, I am all for that.

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

Re: Wheezy + Jessie new style static IP question

Tue Jan 26, 2016 9:17 pm

The really annoying thing about this is that it different than what Debian does.

Raspian is a Debian derivative. Why break compatibility?

I don't want to have to remember the differences between systems when moving from PC to Raspian to whatever other machine I have Debian running on.

May be it's better, maybe it's worse. To me, so far, it's worse because it's yet another difference between systems to worry about.

I cannot fathom the logic behind moving static IP configuration into a DHCP config file. That "D" is for "dynamic". WTF?

Also I don't care about GUIs. I'm sure if I install KDE on a Pi none of this GUI stuff works any more. My Pi run without a GUI.

Grrr, mumble, mumble.
Memory in C++ is a leaky abstraction .

User avatar
Shoka
Posts: 143
Joined: Sat Jul 12, 2014 8:35 pm
Location: Manchester, UK

Re: Wheezy + Jessie new style static IP question

Tue Jan 26, 2016 9:23 pm

On more complex set ups the "traditional" syntax is much more usable.

you can have multiple named interface definitions, and switch between them using the proper syntax to ifup and ifdown.

Copes with multiple interfaces as well.

Not every PI connects in only one network configuration.

Sadly the present mess takes a system that used to work brilliantly if you needed it and understood it, and makes it marginally functional if you have a vanilla config.

Watch out if you upgrade a working (reasonably complex) wheezy set up, I've twice had the result unreachable.
Cheers Harry

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5973
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Wheezy + Jessie new style static IP question

Tue Jan 26, 2016 9:48 pm

I can understand the frustration of doing something the same way for 10 years and then having it yanked out from under you.

Yes, if you've got a complex setup, chances are you'll either need to disable dhcpcd or re-do it. Luckily, people with such setups are generally more than capable of figuring out what they need to do and how.

Nemo1966
Posts: 62
Joined: Fri Jan 01, 2016 8:02 pm

Re: Wheezy + Jessie new style static IP question

Tue Jan 26, 2016 9:56 pm

ShiftPlusOne wrote: What doesn't work for you when it comes to dhcpcd
That's sort of the opposite to what we were asking you. Given that Raspbian is a Debian derivative, what changed in the OS so you needed to add dhcpcdd?

For me the new system just makes a fairly simple premise massively over-complicated and counter intuative. Interfaces file linking to Dynamic Host Configuration Protocol files used to impliment static configurations.

I can understand why people coming from a Windows environment soon get disalusioned with the Linux experience, especially when the Pi is touted as being an educational tool.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5973
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Wheezy + Jessie new style static IP question

Tue Jan 26, 2016 10:17 pm

Nemo1966 wrote: That's sort of the opposite to what we were asking you
I'll recap: /etc/network/interfaces doesn't meet the criteria: lightweight && easy to use from the command line && has a decent GUI && works with multiple interfaces && detects hotplug events and handles them correctly && is usable on all the pi models && works.

I don't think I have anything else to add to this thread, so I'll be on my way out. If you have a better network setup, create an image and get in touch.

Cheers.

Nemo1966
Posts: 62
Joined: Fri Jan 01, 2016 8:02 pm

Re: Wheezy + Jessie new style static IP question

Wed Jan 27, 2016 5:32 pm

I can understand for the GUI - but what about Jessie light?

DirkS
Posts: 9947
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Wheezy + Jessie new style static IP question

Wed Jan 27, 2016 5:44 pm

Nemo1966 wrote:I can understand for the GUI - but what about Jessie light?
Please re-read Shift's post: it's not just the GUI bit.
Jessie and J Lite use the same base so it makes sense to use the same basic setup.
Otherwise you would end up again with separate instructions, and it would be even harder to keep them apart than Jessie / Wheezy.

Nemo1966
Posts: 62
Joined: Fri Jan 01, 2016 8:02 pm

Re: Wheezy + Jessie new style static IP question

Wed Jan 27, 2016 6:42 pm

I understood the post - I guess the headless server people must just suffer for the sake of the GUI.

DirkS
Posts: 9947
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Wheezy + Jessie new style static IP question

Wed Jan 27, 2016 6:48 pm

Nemo1966 wrote:I understood the post - I guess the headless server people must just suffer for the sake of the GUI.
Headless <> no GUI. And also, headless doesn't necessarily mean you don't / cannot use DHCP.
Doesn't matter if it's a server or not.

But, as probably has been mentioned before, you don't have to use the Jessie Lite image.
You can easily roll your own without having to uninstall / deactivate anything. I'm thinking of raspbian-ua-netinst. for example.

Return to “General discussion”