LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking
User Name
Password
Linux - Wireless Networking This forum is for the discussion of wireless networking in Linux.

Notices


Reply
  Search this Thread
Old 12-03-2005, 01:57 PM   #1
futz
Member
 
Registered: Jul 2005
Location: Great White North
Distribution: Fedora4/Ubuntu/Suse/ Mandriva/PCLinuxOS
Posts: 57

Rep: Reputation: 15
madwifi-ng on boot not working


(Fedora Core 4)

So I compiled the madwifi-ng drivers and got it all working. But on the next reboot, it complains about something like the device does not exist and the wireless doesn't start.

I jump to a terminal and type, "wlanconfig ath0 create wlandev wifi0 wlanmode sta" and it starts working and is fine... until next reboot. Then I have to do the same thing again to make it work.

So there must be a startup script somewhere that I should plug the wlanconfig line into???

I know you'll ask, so here is my ifcfg-ath0:
Code:
IPV6INIT=no
ONBOOT=yes
USERCTL=yes
PEERDNS=no
TYPE=Wireless
DEVICE=ath0
BOOTPROTO=dhcp
ESSID=crapola
CHANNEL=6
MODE=Managed
RATE=auto
Security will be turned on once I get this working properly.
 
Old 12-03-2005, 06:59 PM   #2
short101
Member
 
Registered: May 2004
Location: Aust.
Distribution: Debian
Posts: 424

Rep: Reputation: 30
you need to have a pre-up command that creates the device. I am not familiar with fedora, so unfortunately cant help you there.
 
Old 01-07-2006, 12:51 AM   #3
bhar0761
Member
 
Registered: Jul 2005
Location: San Francisco
Distribution: Fedora Core 6
Posts: 64

Rep: Reputation: 15
i had this same problem, i tried creating the device in /etc/rc.local but it gave me an error, but once i logged in and executed the command it works. It is like wlanconfig doesn't exist until after the system is logged in.

Did you find a resolution?
 
Old 01-07-2006, 01:21 AM   #4
futz
Member
 
Registered: Jul 2005
Location: Great White North
Distribution: Fedora4/Ubuntu/Suse/ Mandriva/PCLinuxOS
Posts: 57

Original Poster
Rep: Reputation: 15
Quote:
Did you find a resolution?
Nope. Lost interest for a while. Other things to tinker with. I have a couple extra LAN wires at that station, so I just plugged one in and used that instead for now.
 
Old 01-07-2006, 10:08 AM   #5
Mr_C
Member
 
Registered: Jan 2004
Location: Trinidad & Tobago
Distribution: Slackware
Posts: 317

Rep: Reputation: 30
I can't remember how Fedora run level dirs are structured BUT you can make a script(make it executable chmod +x scriptname) in /etc/init.d/ (I think) with the commands to creaate the device and symbolic link it to your appropriate run level.
Ok I guess you can be extremely lazy and use ksysv editor. (I never used it)
 
Old 01-07-2006, 11:42 AM   #6
x94qvi
LQ Newbie
 
Registered: Dec 2005
Distribution: Slackware 13.37
Posts: 26

Rep: Reputation: 16
I had the same sort of problem (I think). I got around it by using the full pathname for wlanconfig when calling wlanconfig from rc.local (or a script that is called by rc.local).

I currently have a separate shell script that is called by rc.local, and this script sets up the wireless-related stuff. Initially, I had calls to wlanconfig (which were causing problems), but I replaced those with the actual location of where the wlanconfig file is (i.e. using "//usr/local/bin/wlanconfig" instead of just "wlanconfig").

Here's the line I have in rc.local:
//etc/rc.d/startup_wireless.sh

And here's the contents of startup_wireless.sh:
#!/bin/bash
ifconfig eth0 down
//usr/local/bin/wlanconfig ath0 create wlandev wifi0 wlanmode sta
modprobe wlan_scan_sta
ifconfig ath0 xxx.xxx.xxx.xxx netmask 255.255.255.0 up
//usr/local/bin/wlanconfig ath0 list scan
iwconfig ath0 key "xxxx:xxxx:xxxx:etc"
iwpriv ath0 authmode 2
iwconfig ath0 essid "xxxxxxxxxx"
route add default gw xxx.xxx.xxx.xxx

If you decide to do something like this, you'll have to modify the contents of setup_wireless.sh to include whatever commands you would normally call after you boot up in order to get wireless working.

And make sure to do a chmod on startup_wireless.sh to make it executable.

Hope this helps.
 
Old 01-09-2006, 10:36 AM   #7
bhar0761
Member
 
Registered: Jul 2005
Location: San Francisco
Distribution: Fedora Core 6
Posts: 64

Rep: Reputation: 15
Yep that is exactly what i had to do.
wlanconfig is located under /usr/local/bin and i guess the path is not set to root yet.

Thanks anyway
 
Old 01-10-2006, 09:26 PM   #8
a1mint
LQ Newbie
 
Registered: Jan 2006
Posts: 3

Rep: Reputation: 0
Quote:
Originally Posted by Mr_C
I can't remember how Fedora run level dirs are structured BUT you can make a script(make it executable chmod +x scriptname) in /etc/init.d/ (I think) with the commands to creaate the device and symbolic link it to your appropriate run level.
Ok I guess you can be extremely lazy and use ksysv editor. (I never used it)
The proper way is to use the special markups inside the comments of the init script.
Use the chkconfig program to manage the symbolic links for you. People should not finick around with anything in rc3.d/...
Put the script in rc.d/... and do 'chkconfig servicename on'.
system-config-services (I think) can use the chkconfig syntaxed files as well.
 
Old 01-10-2006, 09:33 PM   #9
a1mint
LQ Newbie
 
Registered: Jan 2006
Posts: 3

Rep: Reputation: 0
I'm stuck with the same problem.
I think what needs to be done is the ath0 device should be loaded and the optional wpa_configurator (or whatever the name of that wpa extension thing is), just before the ath0 interface comes up.

/etc/sysconfig/network-scripts/ifup-ath
could be used. However, it'll then bypass all the normal initialization stuff, including any dhcp stuff.

Another possibility is to the wlanconfig...sta command and the wpa_config... command at the bottom of the rc.local file.
Then, not have the ifup-ath file, and keep the normal TYPE=Wireless setting in ifcfg-ath0.
A simple 'ifup ath0' should bring up the interface. If ONBOOT=YES then a 'service network restart' as well as a reboot should bring it up also.

I read through the ifup and network-functions scripts, and I can't come up with anything better than putting the ath0 pre-init stuff in rc.local.

Am I being helpful at all?
 
Old 01-10-2006, 11:28 PM   #10
a1mint
LQ Newbie
 
Registered: Jan 2006
Posts: 3

Rep: Reputation: 0
Ok, I'm back. Here's what I did that works. I did go with the /etc/rc.d/init.d thing and not rc.local. That way seems cleaner and I can start and stop the ath0 interface.

/etc/rc.d/init.d/madwifi:

---------------------------------------------------------------
#!/bin/bash
#
# madwifi creates the ath0 interface
#
# chkconfig: - 09 11
#
# description: creates the ath0 interface
#

# source function library
. /etc/rc.d/init.d/functions

RETVAL=0

start() {
echo -n $"Bringing up ath0: "
/usr/local/bin/wlanconfig ath0 create wlandev wifi0 wlanmode sta &&
/usr/local/sbin/wpa_supplicant -Bw -Dmadwifi -iath0 -c/etc/wpa_supplicant.conf &&
success || failure
RETVAL=$?
echo
}

stop() {
echo -n $"Destroying ath0: "
killall wpa_supplicant
/usr/local/bin/wlanconfig ath0 destroy &&
success || failure
RETVAL=$?
echo
}

restart() {
stop
start
}

case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
*)
echo $"Usage: $0 {start|stop|restart}"
exit 1
esac

exit $RETVAL
--------------------------------------------------

$> chkconfig --add madwifi
$> chkconfig madwifi on
$> service madwifi start
$> ifup ath0
or
$> service network restart
 
Old 01-11-2006, 02:39 PM   #11
Mr_C
Member
 
Registered: Jan 2004
Location: Trinidad & Tobago
Distribution: Slackware
Posts: 317

Rep: Reputation: 30
Ok nice
 
  


Reply


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
madwifi under debian sarge smc wireless card not working! closetosomethingreal Linux - Wireless Networking 0 11-10-2005 10:46 PM
Madwifi is it working??? Atrocity Linux - Wireless Networking 5 05-03-2005 01:00 PM
dhcp not working with madwifi cincyman12 Linux - Wireless Networking 9 05-02-2004 07:44 PM
Madwifi Ad-hoc working only when manually started a_marie2000 Linux - Wireless Networking 2 02-28-2004 07:54 AM
D-Link DWL-G650 not working. Help with madwifi install? vxdxbx Linux - Wireless Networking 1 02-27-2004 06:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking

All times are GMT -5. The time now is 01:12 PM.

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