Project

General

Profile

how to start dhcpd with openrc and wpa_supplicant?

nona - 28 days ago -

Hello. When trying to start dhcpd with OpenRC, I get:

# rc-service dhcpd start

 * /run/dhcp: creating directory
 * /run/dhcp: correcting owner
 * Starting dhcpd ...
 * start-stop-daemon: failed to start `/usr/bin/dhcpd'                                                                           [ !! ]
 * ERROR: dhcpd failed to start

I am currently running

  • nonsystemd/wpa_supplicant-openrc 20210505-1 (openrc-system),
  • openrc 0.49,
  • nonsystemd/dhcp-openrc 20210505-2 (openrc-world)

and am accessing internet on the same system with dhcpcd. I can see that some configuration may be needed for /etc/dhcpd.conf, but I was expecting the connection to work without tweaking (as it does with dhcpcd). My networking skills are not up to par with the documentation (I would not know how to set it up). Would there be a way to convert the dhcpcd.conf to a dhcpd.conf? Thanks.


Replies (6)

how to start dhcpd with openrc and wpa_supplicant? - sam - 25 days ago -

Hello . Unfortunately, the forum is almost inactive, I waited a week for an answer to my question)) I see you have no answers, try writing on the forum https://forum.artixlinux.org/ maybe they will help you.

IRC chat is also poorly supported; you can wait a very long time for an answer to your question. I don’t understand why such poor support on all channels is a mystery to me...

RE: how to start dhcpd with openrc and wpa_supplicant? - nona - 25 days ago -

Thank you very much, sam. At least, now I know that it's not only me. Fortunately, the packages are still being updated, and that already represents a lot of work.

RE: how to start dhcpd with openrc and wpa_supplicant? - sam - 25 days ago -

I had a similar problem, this is the topic in front of you above, I also used Op, look at how I solved this issue, maybe it will help you.
A little more material might help you https://github.com/fkortsagin/Simple-ArchLinux-Install-Guide/blob/master/README.md
and
https://wiki.parabola.nu/Wpa_supplicant

RE: how to start dhcpd with openrc and wpa_supplicant? - anonymous - 25 days ago -

Hello, sorry for the wait. It's hard to say what caused the problem. For start, run process logging system to get information:

$ doas pacman -S syslog-ng
$ doas rc-service syslog-ng start

Try after that to run dhcpd and look info in /var/log/*

Also you need to check the configuration. The purpose for which you need DHCPd, I have had experience with dnsmasq for give out addresses, maybe this program can help you and provides more better documentation.

You mentioned wpa_supplicant program. I can't understand what you need: connect to internet via wifi or to setup your own Access Point? If the first one, then it's easier to use NetworkManager (GUI or terminal $ nmcli / $ nmtui with multifunctional configuration files). If the second one, you may want to use hostapd + dnsmasq/radvd I guess.

Useful links:
https://wiki.gentoo.org/wiki/Home_router/en#DHCP_server (DHCP server using dnsmasq features)
https://wiki.gentoo.org/wiki/Home_router/en#Full_DHCP_server (Example of setup DHCPd)
https://wiki.gentoo.org/wiki/Home_router/en#DHCP_fails_to_start (Note about silent trace of failed run daemon)
https://wiki.gentoo.org/wiki/Syslog-ng (Logging daemon info)
https://wiki.gentoo.org/wiki/Dnsmasq (Simple DHCP/DNS server by using dnsmasq)
https://wiki.gentoo.org/wiki/Hostapd (Host access point daemon software wiki)
https://wiki.archlinux.org/title/Software_access_point (Documantation for setup software AP)
https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Networking (Some information about network)

RE: how to start dhcpd with openrc and wpa_supplicant? - nona - 25 days ago -

anonymous wrote:

Hello, sorry for the wait.

No worries at all!

... and look info in /var/log/*

Initial try:

# rc-service dhcpd start

result: Tries to start dhcpcd (my custom /etc/init.d/dhcpcd has provide net, and /etc/init.d/dhcpd has need net; note that dhcpcd-openrc does not exist in Parabola https://labs.parabola.nu/issues/3607)

hh:mm:02 localhost supervise-daemon[6970]: Supervisor command line: supervise-daemon dhcpcd --start /usr/bin/dhcpcd -- -q --nobackground 
hh:mm:02 localhost supervise-daemon[6972]: Child command line: /usr/bin/dhcpcd -q --nobackground 
hh:mm:02 localhost dhcpcd[5709]: control command: /usr/bin/dhcpcd -q --nobackground
hh:mm:02 localhost supervise-daemon[6971]: /usr/bin/dhcpcd, pid 6972, exited with return code 0
hh:mm:02 localhost supervise-daemon[6977]: Child command line: /usr/bin/dhcpcd -q --nobackground 
hh:mm:02 localhost supervise-daemon[6971]: /usr/bin/dhcpcd, pid 6977, exited with return code 0
more like this
hh:mm:02 localhost supervise-daemon[6971]: respawned "/usr/bin/dhcpcd" too many times, exiting
hh:mm:02 localhost dhcpcd[5709]: control command: /usr/bin/dhcpcd -q --nobackground
hh:mm:02 localhost dhcpcd[5709]: control command: /usr/bin/dhcpcd -q --nobackground
# Scrubbed verbose about ISC
hh:mm:02 localhost dhcpd: Config file: /etc/dhcpd.conf
hh:mm:02 localhost dhcpd: Database file: /var/lib/dhcp/dhcpd.leases
hh:mm:02 localhost dhcpd: PID file: /var/run/dhcpd.pid
# Scrubbed verbose about ISC
hh:mm:02 localhost dhcpcd[5709]: control command: /usr/bin/dhcpcd -q --nobackground
hh:mm:02 localhost dhcpcd[5709]: control command: /usr/bin/dhcpcd -q --nobackground
# Scrubbed verbose about ISC
hh:mm:02 <myhost> dhcpd: Wrote 0 class decls to leases file.
hh:mm:02 <myhost> dhcpd: Wrote 0 deleted host decls to leases file.
hh:mm:02 <myhost> dhcpd: Wrote 0 new dynamic host decls to leases file.
hh:mm:02 <myhost> dhcpd: Wrote 0 leases to leases file.
hh:mm:02 <myhost> dhcpcd[5709]: control command: /usr/bin/dhcpcd -q --nobackground
hh:mm:02 <myhost> dhcpd: 
hh:mm:02 <myhost> dhcpd: No subnet declaration for <wi-iface> (192.168.0.252).
# verbose
hh:mm:02 <myhost> dhcpd: No subnet declaration for <eth-iface> (no IPv4 addresses).
# verbose
hh:mm:02 <myhost> dhcpd: Not configured to listen on any interfaces!
# verbose
hh:mm:02 <myhost> /etc/init.d/dhcpd[7089]: start-stop-daemon: failed to start `/usr/bin/dhcpd'
hh:mm:02 <myhost> /etc/init.d/dhcpd[6771]: ERROR: dhcpd failed to start
hh:mm:02 <myhost> dhcpcd[5709]: control command: /usr/bin/dhcpcd -q --nobackground
hh:mm:02 <myhost> dhcpcd[5709]: control command: /usr/bin/dhcpcd -q --nobackground
hh:mm:03 <myhost> dhcpcd[5709]: control command: /usr/bin/dhcpcd -q --nobackground
hh:mm:03 <myhost> dhcpcd[5709]: control command: /usr/bin/dhcpcd -q --nobackground

Uninstall dhcpcd and try again

# pacman -Rnucs dhcpcd
# rm -fr /etc/init.d/dhcpcd
# rc-service dhcpd start

result: Indeed, I know squat of networking :P !

hh:mm:06 <myhost> dhcpcd[5709]: <wi-iface>: pid 7502 deleted default route via <some-ip>
# Scrubbed verbose about ISC
hh:mm:06 <myhost> dhcpd: Config file: /etc/dhcpd.conf
hh:mm:06 <myhost> dhcpd: Database file: /var/lib/dhcp/dhcpd.leases
hh:mm:06 <myhost> dhcpd: PID file: /var/run/dhcpd.pid
# Scrubbed verbose about ISC
hh:mm:06 <myhost> dhcpd: Wrote 0 class decls to leases file.
hh:mm:06 <myhost> dhcpd: Wrote 0 deleted host decls to leases file.
hh:mm:06 <myhost> dhcpd: Wrote 0 new dynamic host decls to leases file.
hh:mm:06 <myhost> dhcpd: Wrote 0 leases to leases file.
hh:mm:06 <myhost> dhcpd: 
hh:mm:06 <myhost> dhcpd: No subnet declaration for <wi-iface> (<some-ip>).
# verbose
hh:mm:06 <myhost> dhcpd: No subnet declaration for <eth-iface> (no IPv4 addresses).
# verbose
hh:mm:06 <myhost> dhcpd: Not configured to listen on any interfaces!
# verbose
hh:mm:06 <myhost> dhcpd: exiting.
hh:mm:06 <myhost> /etc/init.d/dhcpd[7546]: start-stop-daemon: failed to start `/usr/bin/dhcpd'
hh:mm:06 <myhost> /etc/init.d/dhcpd[7305]: ERROR: dhcpd failed to start

... need to check the configuration. <b>The purpose for which you need DHCPd</b>

So, dhcpd conflicts with my custom dhcpcd service, and I should configure dhcpd. I hope that it's not so blunt to ask if there is a standard configuration file somewhere, but then again, I can just use dhcpcd and be blissfully ignorant about what it actually does. (I'm calling my self an ignorant in an apologetic way).

I have had experience with dnsmasq for give out addresses, maybe this program can help you and provides ... better documentation.

That is the way: learn as you go.

... wpa_supplicant ... what (do) you need (?) connect to internet via wifi or to setup your own Access Point? If the first one, then it's easier to use NetworkManager (GUI or terminal $ nmcli / $ nmtui with multifunctional configuration files).

There are creepy things about NetworkManager https://labs.parabola.nu/issues/3429 https://labs.parabola.nu/issues/2039 https://labs.parabola.nu/boards/5/topics/1244#NetworkManager (there was a report about a similar situation by someone else here in the forum as well).

wpa_supplicant + dhcpcd was the only way in which I was able to get a radius + wired / wireless (https://labs.parabola.nu/boards/5/topics/1244 https://labs.parabola.nu/boards/16/topics/1495)

If the second one, you may want to use hostapd + dnsmasq/radvd I guess.

I really hope that one day I feel comfortable doing this (I have never done it). I just need some time to learn.

Useful links:
...

I know so freakin little :( . I definitely need to look back at the OSI model as well. Thank you very much for the links.

RE: how to start dhcpd with openrc and wpa_supplicant? - nona - 24 days ago -

sam wrote:

I had a similar problem, this is the topic in front of you above, I also used Op, look at how I solved this issue, maybe it will help you.
A little more material might help you <non-free>
and
https://wiki.parabola.nu/Wpa_supplicant

Thanks. In the first set of instructions that you post, there are a lot of non-free software. (I would thus recommend beginners to stay away from it). I also do not see anything related to OpenRC. I do value the amount of work that you put into it.

    (1-6/6)