Network management using DHCPCD

This article is based on a posting in the Gentoo Forums and Article description::explains how to use dhcpcd for complete network stack management.

Of course, it's possible to use dhcpcd together with net.* scripts. In fact, if dhcpcd is installed, it's used as the default DHCP client if you have set  in. This article is specifically about using dhcpcd standalone.

Setup
Make sure dhcpcd is installed. Next, add it to the default runlevel and start the service:

This setup deviates from the default networking instructions in the Gentoo Handbook. It has the advantage that it provides automatic switching between wired and wireless network interfaces.

wpa_supplicant
wpa_supplicant can be used for authentication of wireless and wired network interfaces. Create the configuration file if it does not exist.

For authentication for the wired interface add the configuration file mentioned in Wpa_supplicant.

Wireless using net-wireless/iwd
See the iwd article.

Testing
Stop the service, then start  with the -d ( --debug ) and -B ( --nobackground ) options enabled to see it starting the connection.

Static IP address
In case the network interface card should be configured with a static IP address, type it into the graphical user interface. Without the graphical user interface, entries can also be manually added (currently offline) to as described in Dhcpcd.

Migration from Gentoo net.* scripts
When migrating from Gentoo's net.* scripts it is essential to remove the scripts from the runlevels.

Any match starting with  must not have a runlevel assigned. In the above example, needs to be removed.

Once the network setup works well, it is possible to completely remove the old Gentoo scripts. To do so, disable the  USE flag, re-emerge  and finally unmerge :

Also the old configuration files and symlinks can be removed:

Network dependent services
Manipulating network dependent services by is no longer supported since openrc-0.16.4.

Graphical User interface
A dhcpcd graphical user interface is provided by.

External resources

 * Post 93 of Gentoo Forums :: View topic - TIP: Complete network stack without net.* scripts