View previous topic :: View next topic |
Author |
Message |
chrism Guru
Joined: 15 Jul 2004 Posts: 526
|
Posted: Thu Nov 04, 2004 7:08 pm Post subject: dhcp problem |
|
|
Hi,
I have the following problem: When I boot my Laptop, my Networkcard receives its IP address from the router. The Problem is, when I am not connected to my router it also tries to receive an IP address, that takes a long time.
My question is, if there's a way to either receive the IP manually or to set down the time the Laptop waits untill it tells me that dhcp failed.
Thanks,
Chris |
|
Back to top |
|
|
barran Tux's lil' helper
Joined: 14 Jan 2003 Posts: 142 Location: Århus, DK
|
Posted: Thu Nov 04, 2004 8:11 pm Post subject: |
|
|
emerge ifplugd |
|
Back to top |
|
|
trond n00b
Joined: 31 May 2004 Posts: 26
|
Posted: Thu Nov 04, 2004 10:04 pm Post subject: |
|
|
Either remove net.eth0 from your default runlevel (rc-update del net.eth0 default) and start it manually when your connected (/etc/init.d/net.eth0 start). Or you can change the timeout for dhcpcd; in /etc/conf.d/net try adding dhcpcd_eth0="-t 5" |
|
Back to top |
|
|
barran Tux's lil' helper
Joined: 14 Jan 2003 Posts: 142 Location: Århus, DK
|
Posted: Thu Nov 04, 2004 10:18 pm Post subject: |
|
|
or use ifplugd which starts net.ethX when a cable is plugged or an AP is found, and stops it when the cable is unplugged again.
Very handy for laptops. |
|
Back to top |
|
|
chrism Guru
Joined: 15 Jul 2004 Posts: 526
|
Posted: Fri Nov 05, 2004 1:34 am Post subject: |
|
|
barran wrote: | or use ifplugd which starts net.ethX when a cable is plugged or an AP is found, and stops it when the cable is unplugged again.
Very handy for laptops. |
No didn't work. Here's my error log. It looks like ifplugd is started too late.
Nov 5 02:21:08 [dhcpcd] timed out waiting for a valid DHCP server response_
Nov 5 02:21:08 [rc-scripts] ERROR: Problem starting needed services.
Nov 5 02:21:08 [rc-scripts] "portmap" was not started.
Nov 5 02:21:08 [rc-scripts] ERROR: Problem starting needed services.
Nov 5 02:21:08 [rc-scripts] "famd" was not started.
Nov 5 02:21:10 [ifplugd] Warning: Could not get interface address.
Nov 5 02:21:10 [kernel] eth0: link down
Nov 5 02:21:10 [ifplugd] Using interface eth0/00:00:F0:7F:ED:8F with driver 8139too 0.9.27
Nov 5 02:21:10 [ifplugd] ifplugd 0.13 successfully initialized, link beat not detected.
Nov 5 02:21:10 [rc-scripts] ERROR: Problem starting needed services.
Nov 5 02:21:10 [rc-scripts] "netmount" was not started.
Thanks a lot,
Chris |
|
Back to top |
|
|
trond n00b
Joined: 31 May 2004 Posts: 26
|
Posted: Fri Nov 05, 2004 6:25 am Post subject: |
|
|
Remove the net.ethX-script from your default runlevel. Ifplugd will start it if the networkcable is connected |
|
Back to top |
|
|
barran Tux's lil' helper
Joined: 14 Jan 2003 Posts: 142 Location: Århus, DK
|
Posted: Fri Nov 05, 2004 11:09 am Post subject: |
|
|
Yes thats right. Ifplugd totally takes over the contol of the net. init scripts, so they have to be removed.
I didnt think of mentioning that, because I thought I didnt need to, but I guess not all people examine what they use or install. I just assumed that. My bad. I apologize.
Here is what to do
Install the program (ok you already did that).
Edit /etc/conf.d/ifplugd
I have:
Quote: |
INTERFACES="eth0 eth1"
ARGS="-f -u0 -d20 -b"
|
Remove all net.xxx scripts from runlevels that are listed in INTERFACES ie:
Code: |
rc-update del net.eth0
rc-update del net.eth1
|
You may have to edit /etc/init.d/net.eth0 or /etc/init.d/net.lo because it makes wrong assumptions. See bug 34484. I dont know if the latest version of baselayout has this fixed.
Now edit /etc/sbin/ifplugd.action if fx. you want your pc to beep every time something is connected or reverse. (See emerge -s ^beep$) |
|
Back to top |
|
|
|