| View previous topic :: View next topic |
| Author |
Message |
bastibasti Guru

Joined: 27 Nov 2006 Posts: 440
|
Posted: Tue Dec 02, 2008 6:42 am Post subject: [SOLVED] Network config when link is up. |
|
|
I use my laptop on wlan and sometimes on wired net. My companys dhcp takes about 12 seconds to answer (some windows machine) so I cannot adjust the timeout on the dhcp. Is there a way to skip dhcp when media is not up!?
Last edited by bastibasti on Wed Dec 03, 2008 7:00 am; edited 1 time in total |
|
| Back to top |
|
 |
lookitsme n00b


Joined: 06 Nov 2003 Posts: 48 Location: Kuala Lumpur, Malaysia
|
Posted: Tue Dec 02, 2008 8:25 am Post subject: |
|
|
I'm using preup and ethtool in /etc/conf.d/net as follows:
preup() {
# Test for link on the interface prior to bringing it up. This
# only works on some network adapters and requires the ethtool
# package to be installed.
if ethtool "${IFACE}" | grep -q 'Link detected: no'; then
ewarn "No link on ${IFACE}, aborting configuration"
return 1
fi
}
That should do what you want... |
|
| Back to top |
|
 |
tarpman Veteran


Joined: 04 Nov 2004 Posts: 1083 Location: Victoria, BC, Canada
|
Posted: Tue Dec 02, 2008 9:01 am Post subject: |
|
|
If you install sys-apps/netplug network interfaces won't be brought up until they are plugged in. No configuration is required beyond installing the package, as Gentoo's net-scripts already know about it. _________________ Saving the world, one kilobyte at a time. |
|
| Back to top |
|
 |
bastibasti Guru

Joined: 27 Nov 2006 Posts: 440
|
Posted: Wed Dec 03, 2008 7:00 am Post subject: |
|
|
I tried ipflugd, it works like a charm. Thank you!!
@lookitsme: Thanks for your preup script i had to add a sleep 2 to the beginning, the nic on this machine is very lame ) |
|
| Back to top |
|
 |
|