# dhcp to background

## klausel

Hi folx,

how can I achieve to start dhcp (/etc/init.d/net.eth0) in background so that the system doesn't hang some minutes when booting without a network connection?

take care

klausel

----------

## thepustule

I recommend looking at the ifplugd app.

If your machine regularly starts without a network cable, this program will deal with it nicely.

----------

## troymc

I don't know how to do exactly what you are asking, but I have a couple of options.

Lower the timeout in /etc/conf.d/net:

```

dhcpcd_eth0="-t 10"

```

This sets the timeout to 10 seconds.

EDIT: hmm....I wonder if you can put a & at the end of those options to put it in the background.

I've also found that you can ^C and interrupt the dhcp.

Good luck!

troymc

----------

## thepustule

To use ifplugd, you remove the net.eth0 script from your default runlevel 

```
rc-update del net.eth0 default
```

And then you install ifplugd  *Quote:*   

> emerge ifplugd
> 
> rc-update add ifplugd default

 

----------

## UberLord

With baselayout-1.12 net.eth0 will launch ifplugd automatically if installed  :Smile: 

So the reverse of what you said is true ....

----------

## themusicalguy

Hey guys.

Hope you don't mind me butting in but is ifplugd ment to run dhcpcd automatically when it detects a network conection and brings up eth0?

I installed ifplud and it controls my eth0 fine (does the backgrounding at boot and brings the interface up) but it wont run dhcpcd.

Any help?

----------

## lramos85

 *themusicalguy wrote:*   

> Hey guys.
> 
> Hope you don't mind me butting in but is ifplugd ment to run dhcpcd automatically when it detects a network conection and brings up eth0?
> 
> I installed ifplud and it controls my eth0 fine (does the backgrounding at boot and brings the interface up) but it wont run dhcpcd.
> ...

 

I'm having the same problem. When ifplugd starts at boot it detects the network connection and brings up eth0, when I do ifconfig it even gives an IP address but it is useless to connect.

I had to manually do this to get a working IP address:

```

rm /var/run/dhcpcd-eth0.pid

ifconfig eth0 down

ifconfig eth0 up

dhcpcd eth0

```

The IP Address is exactly the same but it works now. 

I hated doing this so I modified the /etc/ifplugd/ifplugd.actions file by adding:

```

dhcpd eth0

```

Now I just have to make sure that I connect the Cable after it boot up, or disconnect and connect it back. Why is this happening?

----------

## cgits

 *lramos85 wrote:*   

>  *themusicalguy wrote:*   Hey guys.
> 
> Hope you don't mind me butting in but is ifplugd ment to run dhcpcd automatically when it detects a network conection and brings up eth0?
> 
> I installed ifplud and it controls my eth0 fine (does the backgrounding at boot and brings the interface up) but it wont run dhcpcd.
> ...

 

I have the same problem. Where exactly do you add this "dhcpcd  eth0" to the /etc/ifplugd/ifplugd.actions file?

----------

