New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dhcpcd on Ubuntu? Why not the native dhclient? #1713

Closed
AndrewHeim opened this Issue Sep 26, 2017 · 6 comments

Comments

@AndrewHeim

AndrewHeim commented Sep 26, 2017

In raising this issue, I confirm the following (please check boxes, eg [X]) Failure to fill the template will close your issue:

How familiar are you with the codebase?:
3

ISSUE Expected Behaviour:
I would expect that Pi-hole would not install a new dhcp daemon if a commonly used one is installed. Rather, I would hope that we could make it so it could use dhclient in the case of Ubuntu-based systems.

ISSUE Actual Behaviour:
In my case, in troubleshooting network issues I found that the normal network configuration had been changed. Ubuntu (or 16.0.4 at least) uses dhclient instead of dhcpcd. That means things are configured differently. Nearly every reference of a Ubuntu system out there shows how to configure an Ubuntu system based on dhclient - not dhcpcd: https://help.ubuntu.com/lts/serverguide/network-configuration.html

As you can imagine, it gave me a good couple hours of head scratching until I stumbled across the new config file and realized my dhcp client had been replaced. Looking up basic-install.sh confirmed that that's what happened.

ISSUE Steps to reproduce:

  • Get an Ubuntu 16.0.4 VM (or a derivative like Mint)
  • Observe the network manager and dhcp daemon:
    networkmanageronubuntu
  • Install Pi-hole
  • Find that dhcpcd instead of dhclient is managing dhcp for the machine

OTHER:
Would it be unreasonable to configure dhclient if we detect it is running? In the end, the changes to the config file are nearly identical (see Ubuntu link above). The installer already does a great job of detecting which system it is running on and adapting accordingly.

I'm less familiar with Raspian systems so it may be absolutely necessary there - but it would be nice for installation on other systems to not swap out network daemons without much warning.

Or is there another reason Pi-hole has favored dhcpcd for so long that I'm simply unaware of?

@dschaper

This comment has been minimized.

Show comment
Hide comment
@dschaper

dschaper Sep 26, 2017

Member

We are currently primarily installed on Raspberry Pi devices, and the Raspbian distro for the RPi devices all use dhcpcd5 for both static and dynamic addressing for all flavors of Raspbian. In fact there is a warning on the /etc/network/interfaces file that instructs the users to not modify that file in any way. So that is where we are currently.

We've discussed often ways to get away from the necessity of dhcpcd5 with options ranging from having an installer for Raspbian that does dhcpcd and then another installer that is for other OSes, but then we get in to fragmentation. We have to deal with dhclient, dhcpcd, networkmanager and systemd-networkd. So it's quite the undertaking to handle all of the cases for each individual OS. There was also the option of removing the IP configuration completely from the installer and just requiring the users to handle the addressing themselves.

Since we originally were designed for the RPi line of hardware and had the goal of taking a fresh Raspbian image and handle as much as we could for the users who may not have the requisite skills to do such IP management, we elected to go with the default and de-facto method for IP assignment used in Raspbian. I am in agreement that this is not the best method, but with the myriad of methods used in various distros to assign IP addressing and the current push to use static/reserved leases for devices and have the router assign a known IP to the Pi-hole, there's just a whole lot of changes that need to be put in place and tested. It's something that we are aware of and something we are working on, we also have to take in to account currently installed configurations and determining how to update those to bring them up to the new method when we decide on the direction to go.

So thanks for the issue and it's something we have been looking at but all the pieces are not quite there to orchestrate everything.

Member

dschaper commented Sep 26, 2017

We are currently primarily installed on Raspberry Pi devices, and the Raspbian distro for the RPi devices all use dhcpcd5 for both static and dynamic addressing for all flavors of Raspbian. In fact there is a warning on the /etc/network/interfaces file that instructs the users to not modify that file in any way. So that is where we are currently.

We've discussed often ways to get away from the necessity of dhcpcd5 with options ranging from having an installer for Raspbian that does dhcpcd and then another installer that is for other OSes, but then we get in to fragmentation. We have to deal with dhclient, dhcpcd, networkmanager and systemd-networkd. So it's quite the undertaking to handle all of the cases for each individual OS. There was also the option of removing the IP configuration completely from the installer and just requiring the users to handle the addressing themselves.

Since we originally were designed for the RPi line of hardware and had the goal of taking a fresh Raspbian image and handle as much as we could for the users who may not have the requisite skills to do such IP management, we elected to go with the default and de-facto method for IP assignment used in Raspbian. I am in agreement that this is not the best method, but with the myriad of methods used in various distros to assign IP addressing and the current push to use static/reserved leases for devices and have the router assign a known IP to the Pi-hole, there's just a whole lot of changes that need to be put in place and tested. It's something that we are aware of and something we are working on, we also have to take in to account currently installed configurations and determining how to update those to bring them up to the new method when we decide on the direction to go.

So thanks for the issue and it's something we have been looking at but all the pieces are not quite there to orchestrate everything.

@AndrewHeim

This comment has been minimized.

Show comment
Hide comment
@AndrewHeim

AndrewHeim Sep 28, 2017

Thank you for the detailed response.

I see your point about fragmentation. What may be a relatively small change in this immediate case is compounded by many other similar systems, as well as upgrade logic for each of them and to each of them from the current state. That would turn into a lot to manage very quickly, and probably be error-prone for the first few iterations at least. I understand why it hasn't been done yet - and fully expect it might take some time still.

I think the way way Pi-hole.net puts so many Linux distro icons on the front page is what set my expectations regarding how well it worked with Ubuntu. Perhaps we could find somewhere to document the fact that the installer installs dhcpcd, and that it isn't the default for some systems (and perhaps list them)? I'm thinking somewhere in the more detailed FAQ - or perhaps like this page that is linked to from the "many Linux distros" text?
https://discourse.pi-hole.net/t/hardware-software-requirements/273

That would at least help steer expectations in the meanwhile. It looks like it's hard to submit a pull request to that page. ;-)

AndrewHeim commented Sep 28, 2017

Thank you for the detailed response.

I see your point about fragmentation. What may be a relatively small change in this immediate case is compounded by many other similar systems, as well as upgrade logic for each of them and to each of them from the current state. That would turn into a lot to manage very quickly, and probably be error-prone for the first few iterations at least. I understand why it hasn't been done yet - and fully expect it might take some time still.

I think the way way Pi-hole.net puts so many Linux distro icons on the front page is what set my expectations regarding how well it worked with Ubuntu. Perhaps we could find somewhere to document the fact that the installer installs dhcpcd, and that it isn't the default for some systems (and perhaps list them)? I'm thinking somewhere in the more detailed FAQ - or perhaps like this page that is linked to from the "many Linux distros" text?
https://discourse.pi-hole.net/t/hardware-software-requirements/273

That would at least help steer expectations in the meanwhile. It looks like it's hard to submit a pull request to that page. ;-)

@WaLLy3K

This comment has been minimized.

Show comment
Hide comment
@WaLLy3K

WaLLy3K Oct 9, 2017

Member

@dschaper, @jacobsalmela, what are your thoughts on amending the linked FAQ as per the above suggestion?

Member

WaLLy3K commented Oct 9, 2017

@dschaper, @jacobsalmela, what are your thoughts on amending the linked FAQ as per the above suggestion?

@dschaper

This comment has been minimized.

Show comment
Hide comment
@dschaper

dschaper Oct 10, 2017

Member

I agree that we should be more up front about the two major requirements of lighttpd and dnsmasq. I also am okay with a section on why we need a static IP address for the Pi-hole server, what it does and how we attempt to ensure that a static IP is configured for the Pi-hole. I would add in a section about the lines of /etc/dhcpcd.conf that are added, and possibly a power users section on setting either a static IP manually via the OS configuration tools specific to that OS, or about setting a reservation for the Pi-hole if it is not acting as a DHCP server itself.

This is a long-standing issue and the scope of it is so vast that it's hard to manage. I've often thought about taking out the IP addressing functions completely, and if we had a FAQ that was populated with the different OSes and the different methods to set a static IP we may be able to remove it and point users via whiptail to a page that shows /etc/network/interfaces nmcli|nmtui /etc/dhcpcd.conf or further.

Or at the least modify the install to ask users if we should set an IP for them and let them know that we have modified /etc/dhcpcd.conf with the static information so that they can either remove the lines or configure on their own.

@pi-hole/core

Member

dschaper commented Oct 10, 2017

I agree that we should be more up front about the two major requirements of lighttpd and dnsmasq. I also am okay with a section on why we need a static IP address for the Pi-hole server, what it does and how we attempt to ensure that a static IP is configured for the Pi-hole. I would add in a section about the lines of /etc/dhcpcd.conf that are added, and possibly a power users section on setting either a static IP manually via the OS configuration tools specific to that OS, or about setting a reservation for the Pi-hole if it is not acting as a DHCP server itself.

This is a long-standing issue and the scope of it is so vast that it's hard to manage. I've often thought about taking out the IP addressing functions completely, and if we had a FAQ that was populated with the different OSes and the different methods to set a static IP we may be able to remove it and point users via whiptail to a page that shows /etc/network/interfaces nmcli|nmtui /etc/dhcpcd.conf or further.

Or at the least modify the install to ask users if we should set an IP for them and let them know that we have modified /etc/dhcpcd.conf with the static information so that they can either remove the lines or configure on their own.

@pi-hole/core

@jacobsalmela

This comment has been minimized.

Show comment
Hide comment
@jacobsalmela

jacobsalmela Nov 25, 2017

Member

@AndrewHeim I have added a section on IP addressing to our HW/SW requirements page. It doesn't completely solve the issue, but hopefully addresses your request on this ticket. If it does, I'll close it and we can continue the discussion on #629

Member

jacobsalmela commented Nov 25, 2017

@AndrewHeim I have added a section on IP addressing to our HW/SW requirements page. It doesn't completely solve the issue, but hopefully addresses your request on this ticket. If it does, I'll close it and we can continue the discussion on #629

@AndrewHeim

This comment has been minimized.

Show comment
Hide comment
@AndrewHeim

AndrewHeim Nov 27, 2017

@jacobsalmela I really like those comments. (I don't mind being the poster child for confusion in this case, either.)

While it is helpful, I don't want to scare away folks who might want to run pi-hole on non-Raspian distros. Perhaps adding a line to the effect of "Installing pi-hole will likely work without incident on non-Raspian distros, but may cause later confusion because of this conflict. Just be aware."

That being said, I like the changes proposed on #629 - I think that could even further reduce this confusion. Once that is merged, we can update this doc to say something to the effect of "if you're on a non-Raspian distro, use the DHCP mode".

I think we can close this issue.

AndrewHeim commented Nov 27, 2017

@jacobsalmela I really like those comments. (I don't mind being the poster child for confusion in this case, either.)

While it is helpful, I don't want to scare away folks who might want to run pi-hole on non-Raspian distros. Perhaps adding a line to the effect of "Installing pi-hole will likely work without incident on non-Raspian distros, but may cause later confusion because of this conflict. Just be aware."

That being said, I like the changes proposed on #629 - I think that could even further reduce this confusion. Once that is merged, we can update this doc to say something to the effect of "if you're on a non-Raspian distro, use the DHCP mode".

I think we can close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment