After upgrading to openrc 0.5.1 and its new network configuration style I had to add dhcpcd's init script to the the default runlevel. Unfortunately /etc/init.d/dhcpcd gets called before /etc/init.d/network and though it receives a default route from the dhcp server and sets it, the route doesn't show up. Fix: Add "use network" in /etc/init.d/dhcpcd. Reproducible: Always Steps to Reproduce: 1. Emerge openrc 0.5.1 and switch to new-style configuration scheme 2. Add dhcpcd to default runlevel 3. Reboot system Actual Results: An ip lease and a default route is received and set by dhcpcd. The route doesn't show up after logging in. Expected Results: The route should be set correctly.
When installing openrc I got this: LOG: preinst ... Auto-adding 'network' service to your boot runlevel ...l Add on services (such as RAID/dmcrypt/LVM/etc...) are now stand alone init.d scripts. If you use such a thing, make sure you have the required init.d scripts added to your boot runlevel. So it automatically installed network in the boot runlevel. This is run before the default runlevel. I wonder why this didn't happen in your case. Maybe you can add network to the boot runlevel yourself
I still have to add dhcpcd to boot or default runlevels. Problem is that network may be then started *after* dhcpcd.
(In reply to comment #2) > I still have to add dhcpcd to boot or default runlevels. > Problem is that network may be then started *after* dhcpcd. > As I understood it boot runlevel is done before default runlevel. So when network is in boot runlevel and dhcpcd in default runlevel this shouldn't be a problem. Simon
First, make sure to add network to the boot runlevel and remove the old net.* scripts from all runlevels. The network script only configures static ip addresses, so do not attempt to set an address for an interface you are planning to use dhcp on in /etc/conf.d/network. Now add dhcpcd to the default runlevel. Once you have done this, reboot your system and report back if the address and default route are set up correctly.
Also, you do not need the "use network" line that you propose.
The problem still remains if both scripts are in the same runlevel. Under that circumstance it is not assured that network gets started before dhcpcd. And as mentioned earlier, dhcpcd fails to set the default route if the network script (without any static IPs configured whatsoever) hasn't run earlier. Actually my conf.d/network is the default one. Having network in boot and dhcpcd in different runlevels is a possibility but not a requirement. I discussed the problem with Roy Marples (dev of dhcpcd and openrc) before filing this bug and he said openrc's network script has to be run before dhcpcd. Whatever it does while interface discovery or to the routing tables is unbeknownst to me. Problem still exists with 0.5.2-r1. Temporary workaround: have /etc/init.d/network run in boot and /etc/init.d/dhcpcd in default.
> Problem still exists with 0.5.2-r1. openrc-0.5.2-r1 and dhcpcd-5.1.2 to be precise.
This is fixed in dhcpcd-5.1.3-r1.