# net.eth0 doesn't run dhcpcd on boot [solved]

## Perkele

Hi,

After this massive update (i don't know which could have caused this), i have to manually run "dhcpcd" as root to connect to the internet.

This is my /etc/conf.d/net:

```
iface_eth0=( "dhcp" )

modules=( "dhcpcd" )

dhcpcd_eth0=( "-h adrian" )

```

Everything else is commented.

Any hints? ThanksLast edited by Perkele on Fri Sep 29, 2006 2:06 pm; edited 1 time in total

----------

## lagalopex

The config line is unknown to net/net.example...

And what is printed when you run the script "/etc/init.d/net.eth0 start"?

----------

## Perkele

$ /etc/init.d/net.eth0 restart

 * Service net.eth0 stopping

 * Service netmount stopping

 * Service netmount stopped

 * Service sshd stopping

 * Service sshd stopped

 * Service net.eth0 stopped

 * Service net.eth0 starting

 * Service net.eth0 started

 * Service netmount starting

 * Service netmount started

 * Service sshd starting

 * Service sshd started

No problems here.

Maybe the syntax of /etc/conf.d/net changed... it says i probably should do nothing. But it also say it prefers udhcpc over dhcpcd.

???

----------

## lagalopex

```
modules_eth0=( "dhcpcd" ) 

config_eth0=( "dhcp" ) 

dhcpcd_eth0=( "-h adrian" ) 
```

Is that working?

----------

## Perkele

No  :Sad: 

The same like before.

----------

## RaceTM

Have you added eth0 to the appropriate runtime level?

rc-update add net.eth0 default

----------

## Perkele

Of course, it worked perfectly for almost a year. 

```
$ rc-update show|grep eth0

            net.eth0 |      default
```

And i dont know what could have caused the change now. I saw there is a /etc/init.d/dhcpd, but it's not active. Maybe they changed something so that i must use this?

----------

## jonnevers

 *Perkele wrote:*   

> Of course, it worked perfectly for almost a year. 
> 
> ```
> $ rc-update show|grep eth0
> 
> ...

 

with net.eth0 in my default runtime level and this in /etc/conf.d/net

```
config_eth0=( "dhcp" )
```

DHCP works without my intervention.

----------

## Perkele

...like it's supposed to. It worked for me quite a while... but now it doesn't and i want to know why.

----------

## jonnevers

 *Perkele wrote:*   

> ...like it's supposed to. It worked for me quite a while... but now it doesn't and i want to know why.

 

is your NIC going? I just had a NIC fail on me after 248 days of uptime in my server... packet loss was how my NIC showed it was failing.

----------

## Perkele

I think we can rule out the hardware. Everything works normal after i do "dhcpcd" as root. But it want to do it automatically on boot.

I'd appreciate a real solution instead of an ugly workaround.

Ok, apparently the syntax in the "net"-config is correct and should work. There are no error-messages, as far as i know, or are there any logs where i could find some information?

I'm really stuck...

----------

## sonicbhoc

Clear out the config file. If there is an empty config file it will automatically use DHCP.

----------

## Perkele

Still, no change. Did I accidentally delete an important run-script?

```
$ rc-update show

           alsasound | boot                          

           bluetooth |      default                  

            bootmisc | boot                          

             checkfs | boot                          

           checkroot | boot                          

               clock | boot                          

            coldplug | boot                          

         consolefont | boot                          

               cupsd | boot                          

            hostname | boot                          

             hotplug |      default                  

               irssi |      default                  

             keymaps | boot                          

               local |      default nonetwork        

          localmount | boot                          

             modules | boot                          

            net.eth0 |      default                  

              net.lo | boot                          

            netmount |      default                  

             numlock | boot                          

           rmnologin | boot                          

              splash | boot                          

                sshd |      default                  

           syslog-ng |      default                  

             urandom | boot                          

                 xdm |      default  
```

What does "nonetwork" mean?

----------

## sonicbhoc

It's a different runlevel, like how you have boot and default. Don't worry about that.

----------

## Perkele

Solved: I had to etc-update /etc/init.d/net.lo. Sorry, i guess this was my fault, being dumb enough not to update my configs. Thanks to all of you, anyway.

----------

## mantono

 *Perkele wrote:*   

> I think we can rule out the hardware. Everything works normal after i do "dhcpcd" as root. But it want to do it automatically on boot.
> 
> I'd appreciate a real solution instead of an ugly workaround.
> 
> Ok, apparently the syntax in the "net"-config is correct and should work. There are no error-messages, as far as i know, or are there any logs where i could find some information?
> ...

 

I have the exact same problem! No matter how much I change my config file for net, I won't get any internet connection unless I run dhclient or dhcpcd manually... How ever, notice that I can ping my router before I have ran any command to manually obtain a new IP. I do get an IP from my router, but I can not get on the internet untill I have obtained a new one.

EDIT: I see you have found the solution, thanks Perkele!

----------

