You are not logged in.

#1 2013-10-05 04:10:19

ke7mbz
Member
Registered: 2013-09-27
Posts: 17

[Solved] Why doesn't NetworkManager work when dhcpcd is running?

It took me a lot of searching to figure out why NetworkManager wasn't working. Unfortunately, I haven't been able to find an explanation for why this fixed.

So why does having dhcpcd running cause NM not to work? Doesn't NM need it to get an IP address from the router? Hence the "dhcp" parameter in NetworkManager.conf. According to the manpage, it can be set to either dhcpcd or dhclient.

So does it run it as a temporary process, rather than a daemon? I'd just like to understand how all this works, rather than just excepting that it does. Which is why I started using Archlinux.

Last edited by ke7mbz (2013-10-06 01:14:02)

Offline

#2 2013-10-05 05:35:25

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved] Why doesn't NetworkManager work when dhcpcd is running?

Why would you want to have more than once thing managing your network connection?  They conflict with each other, as both are trying to control the same thing.

NetworkManager launches its ow child dhcpcd process (or dhclient).  This is not a "temporary process" as it is the same thing as running it from the dhcpcd@.service.  It is just that it is instead run by NetworkManager.

Theoretically, it would seem that it might just work to have dhcpcd.service as well as NetworkManager working, as dhcpcd is pretty capable of simply taking control of all other attempted dhcpcd starts from the command line.  But you have apparently found out that this does not work in practice.  Why exactly I am not entirely sure, but this seems to hold true amongst all network management daemons (netctl, NM, wicd, connman, etc.).

Offline

#3 2013-10-05 19:10:57

ke7mbz
Member
Registered: 2013-09-27
Posts: 17

Re: [Solved] Why doesn't NetworkManager work when dhcpcd is running?

Thank you for your response.

So then, without NM, dhcpcd manages network connections independently, and with NM dhcpcd is managed by NM.

So what is the correct systemd configuration of dhcpd.service. Should it be disabled? Does NetworkManager start the service?

I dont remember actually enabling dhcpcd during installation. I just followed the beginner's guide, with the only special configuration being the encrypted LVM.

netclt was working for my wireless connection when I rebooted the system. Why wasn't it conflicting with dhcpcd? Does netctl use dhcpcd as well, or does it have it's own dhcp client built in?

Offline

#4 2013-10-05 19:34:26

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved] Why doesn't NetworkManager work when dhcpcd is running?

You're asking the same questions all over again…

Offline

#5 2013-10-05 19:37:28

Roberth
Member
From: The Pale Blue Dot
Registered: 2007-01-12
Posts: 894

Re: [Solved] Why doesn't NetworkManager work when dhcpcd is running?

Either you run dhcpcd or networkmanager, it's that simple.


Use the Source, Luke!

Offline

#6 2013-10-05 20:25:43

ke7mbz
Member
Registered: 2013-09-27
Posts: 17

Re: [Solved] Why doesn't NetworkManager work when dhcpcd is running?

After reading up on dhcpcd a bit, I think I understand now. NM runs the dhcpcd command to get a lease from the server. If NM and dhcpcd are both running as services, then they conflict because they're both trying to manage the connection.

I was thinking of it as working like NFS and the rpc services. NFS talks to idpmapd to get user info, etc.

So why doesn't netctl conflict with dhcpcd.service? Aren't they redundant as well?

Offline

#7 2013-10-05 21:28:58

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,132

Re: [Solved] Why doesn't NetworkManager work when dhcpcd is running?

Normally dhcpcd and netctl would conflict, yes. I don't know exactly what you did or configured so it is hard to way what the situation was in your case.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#8 2013-10-05 22:11:35

ke7mbz
Member
Registered: 2013-09-27
Posts: 17

Re: [Solved] Why doesn't NetworkManager work when dhcpcd is running?

I just skipped to the wifi section in the beginner's guide during install, and followed those steps:

ip link set wlp2s0 up
wifi-menu wlp2s0

Afer rebooting, I ran wifi-menu again. Perhaps I enabled dhcpcd before that, so that I could install the required packages for wifi over a wired connection. It was a  couple weeks ago.

The strange thing is that wifi was working just fine, via netctl, with dhcpcd enabled. The beginner's guide says that dhcpcd is started automatically when booting into the live install environment. wifi-menu worked just fine then too.

Everything is working now. I'd just like to know why so I can do it right next time, and be able to explain it if someone asks me.

Why does the guide only say to run "systemctl enable dhcpcd.service" and not "systemctl start dhcpcd.service" as well?

Last edited by ke7mbz (2013-10-05 22:12:23)

Offline

#9 2013-10-05 22:23:53

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,132

Re: [Solved] Why doesn't NetworkManager work when dhcpcd is running?

Well the instruction is aimed at starting the service on reboot. In the chroot, the network is already up and dhcpcd is already running. So you don't want to try to start a second instance of the daemon. So you want enable but not start.

I am not sure whether the dhcpcd daemon in the live environment is started just for the wired interface or if it is started for all interfaces. Nor am I certain if it fails if it is unable to get a lease. So it might be that it isn't running by the time you use wifi-menu or that it isn't running on the wireless interface.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#10 2013-10-06 01:10:16

ke7mbz
Member
Registered: 2013-09-27
Posts: 17

Re: [Solved] Why doesn't NetworkManager work when dhcpcd is running?

Sorry, that's right. I was thinking I configured the network again after reboot, but it was before.

That does make sense. netctl was only managing the wireless interface, and dhcpcd was managing the the wired one, and probably name resolution as well. Aparently NetworkManager doesn't coexist so peacfully, though.

I've never loved NetworkManager. It's nice on a laptop, but otherwise just gets in the way. Unfortunately, it looks like it's going to be become the default in RHEL. I don't understand that, considering it doesn't work with some of their key enterprise solutions. Whatever.

Thanks.

Offline

Board footer

Powered by FluxBB