Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Bring up eth0 ONLY if net available
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
gidem
n00b
n00b


Joined: 19 Feb 2004
Posts: 32
Location: Montréal

PostPosted: Wed Mar 17, 2004 9:51 pm    Post subject: Bring up eth0 ONLY if net available Reply with quote

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 :oops:

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
View user's profile Send private message
Earthwings
Bodhisattva
Bodhisattva


Joined: 14 Apr 2003
Posts: 7753
Location: Germany

PostPosted: Wed Mar 17, 2004 10:01 pm    Post subject: Reply with quote

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
View user's profile Send private message
OdinsDream
Veteran
Veteran


Joined: 01 Jun 2002
Posts: 1057

PostPosted: Wed Mar 17, 2004 10:01 pm    Post subject: Reply with quote

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
View user's profile Send private message
snekiepete
Guru
Guru


Joined: 07 May 2003
Posts: 306
Location: WISCONSIN

PostPosted: Wed Mar 17, 2004 10:04 pm    Post subject: Reply with quote

# rc-update del net.eth0 default
# emerge ifplugd
# rc-update add ifplugd default

then eth0 only comes up when plugged in
Back to top
View user's profile Send private message
gidem
n00b
n00b


Joined: 19 Feb 2004
Posts: 32
Location: Montréal

PostPosted: Wed Mar 17, 2004 10:05 pm    Post subject: Reply with quote

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
View user's profile Send private message
snekiepete
Guru
Guru


Joined: 07 May 2003
Posts: 306
Location: WISCONSIN

PostPosted: Wed Mar 17, 2004 10:06 pm    Post subject: Reply with quote

I prefer ifplugd, then I dont even have to wait 1 second if my cable is unplugged.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum