You are not logged in.

#1 2016-11-08 06:51:00

greyseal96
Member
Registered: 2014-03-20
Posts: 31

[SOLVED] NetworkManager seems to be working with DHCPCD. How/why?

Hi all,

The machine in question is a fully updated Arch OS installed inside of a VirtualBox VPC running XFCE 4.12.  For a long time now, the default Arch networking setup has worked just fine for me, i.e. netctl with dhcpcd, etc.  I haven't had a need to have anything more and it just worked.  Recently, though, I needed to set up an OpenVPN VPN connection and, from past experience, I judged Network Manager to be the best solution so I installed it.  I followed all of the instructions on the Network Manager wiki page and I seem to have Network Manager working correctly. 

I figured that since I already had dhcpcd installed and running fine, I wanted to keep using it if at all possible.  I did see the notices on the wiki page about dhcpcd not working with NetworkManager but I still wanted to try it just to see if it would work.  I read the man page for NetworkManager.conf and it said that dhcpcd could be set as the dhcp client to use so I set the dhcp line in the conf file to use dhcpcd.  I got my VPN set up and, after some hiccups I got things working.  I was having some trouble at first because when I would ping a host name on the remote network, it wasn't getting resolved to an IP address.  However, I found that when I restarted dhcpcd while the VPN was running, I got name resolution working and pings to host names were able to be resolved to IP addresses.  After that, I was able to connect to remote devices across the VPN.  After a restart of the OS and then connecting again with the VPN, I got the same host name resolution problems but, once again, after restarting dhcpcd while the VPN was running, name resolution started working again.

From what I've read on the Network Manager wiki, this shouldn't be possible.  Also, I checked out the PKGBUILD file for the NetworkManager package and it looks like it's explicitly disabling support for dhcpcd.  So I'm wondering why (or how?) Network Manager is working with dhcpcd?  Am I just getting lucky?

From what I've read, dhcpcd seems to be a little more feature rich than dhclient (especially when it comes to IPv6 support) and it definitely seems better than the internal dhcp client that's built into Network Manager.  If possible, I'd like to keep using dhcpcd but, on the other hand, I've had a lot of success, i.e. system stability, the more I keep to what the recommendations are for the different pieces of software that I'm running.

Last edited by greyseal96 (2016-11-24 12:22:46)

Offline

#2 2016-11-08 09:37:36

rsmarples
Member
Registered: 2009-05-12
Posts: 287

Re: [SOLVED] NetworkManager seems to be working with DHCPCD. How/why?

Bottom line.... it's not (or shouldn't be, but I'm not an Arch user so can't be sure).

dhcpcd's job is just to configure the interface as instructed by static config, DHCP, Router Advertisement, etc.
Now, if you use NetworkManager just to configure the link (in this case a VPN connection or maybe a Wireless AP) then the two will co-exist just dandy as they won't step on each others toes.
However, if you ask NM to also do DHCP, Router Advertisement handling, etc, then you could get different IP addresses. This is also not problematic as the OS will cope fine.
Routing may be an issue because dhcpcd adjusts the route metric and MTU and I'm not sure if NM does this or has a good route management system as dhcpcd's.

dhcpcd support has been disabled in NM because dhcpcd no one wants to maintain it as a DHCP client for NM.
This is probably a good thing because NM just cares about NM where-as dhcpcd will strive to interoperate with others (a good example of this is resolv.conf mangement).

Also dhcpcd has a nice GUI in dhcpcd-qt or dhcpcd-gtk to interact with wpa_supplicant to select an AP and enter your psk which satisfies most people.
It doesn't allow configuration of a VPN though .... that's a little outside scope but I may do it once I finish my other projects.

Now, NM is probably a little overkill for a VPN config front end, so you may wish to look into using something lighter!

Offline

#3 2016-11-16 08:39:53

greyseal96
Member
Registered: 2014-03-20
Posts: 31

Re: [SOLVED] NetworkManager seems to be working with DHCPCD. How/why?

Thanks for taking the time to respond and give a really nice explanation.  That clarifies things perfectly.  Thank you.  By the way, this is one of the things I've loved about FOSS: we get the creator of the software coming onto the forums to answer a question.  You don't get something like that in MS land.  smile  Thanks for doing what you do and creating great, functional software.
my
BTW, I think that you're right.  NM is overkill just for the VPN config.  NM comes with the desktop manager that I use on another box and, out of habit, I just went straight for NM when I had to set up the VPN on this current box.  However, after thinking about it, I realized that I could just run OpenVPN directly and it would do the same thing for me and probably without the additional hassle of NM.  I can continue using dhcpcd without NM interference.  Thanks for "snapping me out of it".

Last edited by greyseal96 (2016-11-16 08:40:53)

Offline

Board footer

Powered by FluxBB