View previous topic :: View next topic |
Author |
Message |
gidem n00b
Joined: 19 Feb 2004 Posts: 32 Location: Montréal
|
Posted: Wed Mar 17, 2004 9:51 pm Post subject: Bring up eth0 ONLY if net available |
|
|
Hello,
I'd like to know if there is a way to bring eth0 only if a network cable is plugged in. The " problem " is that I have a laptop and since I'm not always using it at home and don't always have access to internet, I find it annoying to wait for "bringing up eth0" when booting when I know there is no cable plugged in.
Not to be badmouthed...but what I really want, is my nic to be handled the same way as in windows
How can I do that...??
Thanks _________________ "(...) on est responsable de ce qu'on est."
Jean-Paul Sartre
Registered Linux User Nr. 308433 |
|
Back to top |
|
|
Earthwings Bodhisattva
Joined: 14 Apr 2003 Posts: 7753 Location: Germany
|
Posted: Wed Mar 17, 2004 10:01 pm Post subject: |
|
|
You can decrease the timeout value for dhcp if you're using it or have a look at ifplugd for the windows-like recognition of a plugged in cable. |
|
Back to top |
|
|
OdinsDream Veteran
Joined: 01 Jun 2002 Posts: 1057
|
Posted: Wed Mar 17, 2004 10:01 pm Post subject: |
|
|
I do remember that there's a way to do this specifically, but there's also a way to use the dhcpcd_eth0="..." line in /etc/conf.d/net to limit the timeout value. I believe it's usually 60 seconds before dhcpcd gives up trying to obtain an IP. Limiting this to something more reasonable may be an acceptable solution. Try the following:
dhcpcd_eth0=" -t 10"
...for a 10 second timeout. _________________ s/(?<!gnu\/)linux(?! kernel)/GNU\/Linux/gi
Don't blame me. I didn't vote for him.
http://john.simplykiwi.com |
|
Back to top |
|
|
snekiepete Guru
Joined: 07 May 2003 Posts: 306 Location: WISCONSIN
|
Posted: Wed Mar 17, 2004 10:04 pm Post subject: |
|
|
# rc-update del net.eth0 default
# emerge ifplugd
# rc-update add ifplugd default
then eth0 only comes up when plugged in |
|
Back to top |
|
|
gidem n00b
Joined: 19 Feb 2004 Posts: 32 Location: Montréal
|
Posted: Wed Mar 17, 2004 10:05 pm Post subject: |
|
|
Decreasing the timeout value would be a good starting point...I'll try that.
Thank you _________________ "(...) on est responsable de ce qu'on est."
Jean-Paul Sartre
Registered Linux User Nr. 308433 |
|
Back to top |
|
|
snekiepete Guru
Joined: 07 May 2003 Posts: 306 Location: WISCONSIN
|
Posted: Wed Mar 17, 2004 10:06 pm Post subject: |
|
|
I prefer ifplugd, then I dont even have to wait 1 second if my cable is unplugged. |
|
Back to top |
|
|
|