Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking
User Name
Linux - Wireless Networking This forum is for the discussion of wireless networking in Linux.


  Search this Thread
Old 05-05-2006, 07:57 PM   #16
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671

A problem some people have is that their regular NIC interface is set to start on boot. This might cause a conflict. I set my NIC interface (eth0) to start on connection and my wireless interface to start on boot.
Old 05-07-2006, 12:35 PM   #17
Registered: Mar 2006
Posts: 41

Original Poster
Rep: Reputation: 15
I am running Fedora 5 and I don't see the abilty to start on conncetion anywhere. In network manager, it only gives you the place to check for starting on boot, which in my case did not work
Old 05-12-2006, 05:02 AM   #18
Registered: May 2004
Location: Aust.
Distribution: Debian
Posts: 424

Rep: Reputation: 30
check out /etc/sysconfig/network-scripts/ifcfg-(etho, and ath0) look for an auto bit in the eth0 one (or whatever your wired iface is) and disable the auto. Then eneable it for the wireless interface. There shoould be docs for it somewhere. Seeing as your card actually works, i would suggest asking in the forum for your distro on how to do this correctly.
Old 10-22-2006, 09:46 AM   #19
LQ Newbie
Registered: Oct 2006
Distribution: linux
Posts: 23

Rep: Reputation: 1
There could be another reason your card is not starting up on boot, because I had the same problem, and I run FC5 and ndiswrapper.

The problem I was finding is that NICs are only given 5 seconds to make a link with the access point, and then the "no link present, check cable?" message comes on and the device is shut down--so you won't see it as up in ifconfig.

I'm using a Belkin N5d7050 with 128b WEP encryption, and 5 seconds is just way to short for it to establish the link. It takes my card between 30 and 40 seconds to get a link, so I needed to extend the time the system gives it.

The timeout for checking if there's a link is controlled by a function called check_link_down() in the file /etc/sysconfig/network-scripts/network-fuctions (Fedora Core 5).

The way it works is the script ifup-eth (etc/sysconfig/network-scripts) calls the function check_link_down() which checks your wireless link (wlan0 on my system--wlan is considered an eth device) to see if it is connected to the AP. If there is no link between the card and the AP it fails and you get the "no link present, check cable?" message at boot.

The tool that checks if the link is present is ethtool, and it is called in the check_link_down function.

The wireless card has to sync up to the AP, and if it's encrypted it takes a bit longer (naturally).

So, what I did to make it work was just give the card more time to sync up. Check_link_down() looks like so:

check_link_down ()
    if [ -x /sbin/mii-tool -o -x /sbin/ethtool ]; then
        if ! LC_ALL=C ip link show dev $1 2>/dev/null| grep -q UP ; then
	   ip link set dev $1 up >/dev/null 2>&1
	while [ $timeout -le 10 ]; do
	    check_mii_tool $1
	    check_ethtool $1
	    if [ $m -eq 1 ] || [ $e -eq 1 ] ; then
		return 1
	    if [ $m -eq 2 ] && [ $e -eq 2 ] ; then
		return 1
	    usleep 500000
	return 0
    return 1
So, what you can see from that is we have a timeout counter ($timeout), which increments up to 10 times. If we get to 10 and the link still isn't present then we've timed out and we get the fail message.

Looking further down, we see usleep 500000. That means we wait for .5 seconds each time we loop through the while statement to give the link a chance to sync up.

If you multiply 10 tries by .5 seconds a try, you find out your wireless card only has 5 seconds to sync up with the access point. This is not enough time for my card.

My fix was easy, I just changed the usleep 500000 (.5 seconds) to usleep 5000000 (5 seconds).

Don't worry, you won't have to wait the entire 50 seconds because the while loop has a return statement that breaks the loop if the link is present. You only have to wait long enough for ethtool to see a good link (mine ususally takes 7 passes through to get sync'd up). Once it sees the link, it will break the loop and continue to boot as normal.
Old 04-10-2007, 10:23 AM   #20
LQ Newbie
Registered: Apr 2007
Location: Arouca, Trinidad
Distribution: Fedora core 6/Ubuntu
Posts: 14

Rep: Reputation: 0

is there any way that i can edit the check_link_down () part of the network-functions file to run a script everytime the link comes up?

i want to run a script everytime that a link is detected as up.

Old 04-10-2007, 04:25 PM   #21
LQ Newbie
Registered: Oct 2006
Distribution: linux
Posts: 23

Rep: Reputation: 1
It is a shell script, so if you have root privilages, you can edit it. Then you can call another shell script from within that function if you like.


network, script

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Start Up script for wireless running with Ndiswrapper mckinlsm Linux - Wireless Networking 3 10-20-2008 11:11 PM
Running Wireless modem card on LAN arnekasper Linux - Wireless Networking 3 09-09-2005 09:57 AM
An Ideal Wireless Card for Slackware 10.0 running 2.6.10 cddesjar Linux - Wireless Networking 7 02-22-2005 11:53 PM
wireless on Linux dying when I bring another wireless device in the LAN sal_paradise42 Linux - Wireless Networking 5 11-14-2004 03:38 AM
running C/C++ and installing wireless card suresh_reddy Linux - Laptop and Netbook 1 02-27-2004 05:16 PM > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking

All times are GMT -5. The time now is 08:05 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration