Network management using DHCPCD

Abstract
Gentoo is about choice and also OpenRC can be used with one of several network managers or even with none. This is about using OpenRC with DHCPCD as networkmanager. It is based on a posting in Gentoo Forums.

Installation
Install dhcpcd and add it to the default runlevel:

All its configuration goes into but for most installations nothing needs to be done there. Though man 5 dhcpcd.conf will be helpful in case of advanced configuration demand.

Wireless
When you need wireless support also install wpa_supplicant, Also note that for wireless the older versions (≤ 6.4.3) of dhcpcd need wireless extensions compatibility in the kernel.

For its detailed configuration and usage refer to wpa_supplicant.

Don't forget to set up and test the necessary wireless device drivers in your kernel.

Static IP address
In case the network interface card should be configured with a static IP address, add their data to the configuration file as shown for the following example.

Migration from Gentoo net.* scripts
Once the network setup works well you might want to completely remove the old Gentoo net.* scripts setup. So disable the netifrc useflag, re-emerge OpenRC and unmerge netifrc:

Also the old config files and symlinks can be removed

Network dependant services
Services having "need net" in their init.d scripts like fetchmail would then start after dhcpcd is started.

They will be stopped when dhcpcd turns inactive and will be restarted when dhcpcd is back.

X session and UI integration
There is a nice and neat gtK+-{2,3}.0/QT4 UI for dhcpcd to get a sane user interface via a systray icon without any crap *kit cruft. Although the main portage tree ebuild is very out dated, there is open for a newer versioned/live ebuild. The attached ebuild may not be up to date so check out this overlay for an up to date ebuild.

dhcpcd daemon should be running in master mode and not per interface. So don't use net.*, as explained in the previous sections, to ensure that dhcpcd is passed the -M flag which *might* allow it to work.

Also, >=net-misc/dhcpcd-6.4.4 is required with unprivileged socket or you need to be able to write to dhcpcd's socket. In newer versions you can say which group has read/write (RW) access to it in dhcpcd.conf (checkout the previous sections or dhcpcd.conf(5).) The default config has a commented out section which allows wheel group RW access. You should enable this and ensure your user is in the wheel group. If not, you'll need to add it and log out and then log in to get the effects of the change.

The following line is enough to get the UI started in a simple X session without a display manager.

That output redirection will avoid geting SSID/IP and other network informations displayed in the parrent shell.

Or else, checkout out the documentation of your Desktop Environment for DE integration.