Netifrc

netifrc is a collection of modules created to configure and manage network interfaces via individual, per-interface scripts located in the directory. In Gentoo Linux netifrc comes installed as part of the system profile and is available in the stage3 tarballs on all architectures. New users beware: netifrc is powerful and convenient, but using it requires knowledge of the exact system needs; because of its modular approach it requires additional packages to be installed for what many would consider "basic functionality" for home users. The netifrc package can be uninstalled or simply left unused in favor of using another network manager.

USE flags
Since netifrc are simply a few scripts that integrate into OpenRC no USE flags exist for them.

Emerge
The netifrc modules come in standard stage3 tarballs so they should be already installed on the system. In the case they have been removed, they can be re-installed via:

Determine interface names
The first step in configuring netifrc is to get a list of the network interfaces present on the system. This is possible a couple different ways. The ifconfig command can be used to get a comprehensive list of available interfaces. It also be an used to detect if there is byte-activity on the interfaces which helps determine connectivity:

For more information on ifconfig see the man page locally (man ifconfig) or online.

Alternately, if dmesg is installed, a list of messages should be generated each time the system boots. Although the above method is better in practice, this approach can also be used to determine available network interfaces:

For more information on the use of dmesg see the man page locally (man dmesg) or online.

Creating symlinks
Provided in the package is a parent script called  which is installed to. This parent script should be symlinked to create additional scripts for each network interface to be configured. For example, to create a script for a network interface called, run the following command:

Replace  with  or whatever the interface is named.

in the example commands above is the appropriate name for this system's network interface. Depending on the system, a number of interface names may be used including:, , , , , etc. Continue creating links for as many interfaces as needed. A system can have more than one interface connected to more than one network if the hardware is available.

Configuration of the interfaces is handled in the file. A default (empty or missing) will automatically use DHCP to configure any network interface(s) started by  scripts.

OpenRC
Running the rc-update is the final step in the configuration process. Add each interface to the systems init process. Normally interfaces are added to the "default" runlevel:

Repeat the above command for each interface. A status message should appear showing successful adds to the init process.

Removing interfaces
If interfaces are no longer desired to be loaded during the init process they need to be removed from OpenRC. Run the following command for each interface that should be removed:

Cable in/out detection
By default netifrc, even when each interface is set to use DHCP in will not assign IP addresses if a cable is not plugged in during the boot up process. If a cable is added later netifrc will not assign an address until the interface is manually restarted.

Two (modular) packages are available for install if restarting the interfaces each time a system boots without a cable plugged is the desired result:



The package appears to be more maintained and is the recommended choice:

Once the install is complete cable in/out detection should work as expected.

For more information please read netifrc documentation at Gentoo's GitWeb site or locally in. Search " ".

External resources

 * Forum post