LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 09-20-2005, 11:11 PM   #1
SGT-D
LQ Newbie
 
Registered: Sep 2005
Location: somewhere around seattle
Distribution: Suse 9.3 Pro
Posts: 6

Rep: Reputation: 0
Question ndiswrapper wireless


Ok, I've got a crappy wireless nic that requires the use of ndiswrapper because broadcom won't write drivers for linux. (a curse on broadcom and their decendents)

anyhow, i grabbed ndiswrapper and added the drivers, configured the nic in Yast, and did an ndiswrapper -m to add it to the modprobe.conf.local, which didn't work anyhow. So I had to find another way to make it load on start up.

I got around the problem of it loading automagically by editing the /etc/rc.d/boot.local and adding the following lines.

Code:
ESSID="my_essid"
INTERFACE="wlan0"
MODE="Managed"

#Load the module
echo "Loading NDISWRAPPER"
/sbin/modprobe ndiswrapper

# Set up the WiFi card

echo "Configuring ${INTERFACE}:"
/usr/sbin/iwconfig ${INTERFACE} essid ${ESSID}
#/usr/sbin/iwconfig ${INTERFACE} channel ${CHANNEL}
/usr/sbin/iwconfig ${INTERFACE} mode ${MODE}


# Get IP address from dhcp
echo "Acquiring IP Address"
/sbin/dhcpcd wlan0
it works ok up until the dhcpd wlan0 command.

It appears to hang or be thinking about something there.

I Ctrl-C out of that and get an error about something about edit_resolvconf, cant find file, or something.... can't find a boot log that lists the error.

anyway, I boot the rest of the way up, and have an ip address, and everything but no dns. so no intarweb. I promptly run dhcpcd wlan0 again, and *BAM* i'm golden...

now i've run iwconfigs, ifconfigs, lsmods, and routes before and after that second dhcpcd wlan0 and as far as I can tell nothing changes.

question is, why does the dhcpcd not work upon boot?
 
Old 09-21-2005, 05:04 AM   #2
scheidel21
Senior Member
 
Registered: Feb 2003
Location: CT
Distribution: Debian 6+, CentOS 5+
Posts: 1,323

Rep: Reputation: 100Reputation: 100
This is a wild guess but perhaps something is not loading which is required to with use of the wireless card. Try adding the interface at boot, but run a script on login which runs the dhcp client and see if that works. If so it is something which is not loading.

Alex
 
Old 09-21-2005, 06:55 AM   #3
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Quote:
/sbin/dhcpcd wlan0
The basic problem is that Suse doesn't use dhcpcd, instead I think it uses dhclient. Find out the path for dhclient (run which dhclient and subtitute that path for the dhcpcd command. So it would look something like:

/path/to/dhclient wlan0
 
Old 09-21-2005, 01:47 PM   #4
SGT-D
LQ Newbie
 
Registered: Sep 2005
Location: somewhere around seattle
Distribution: Suse 9.3 Pro
Posts: 6

Original Poster
Rep: Reputation: 0
Roger that, i'll give it a try as soon as I finish installing office on my windows partition. (it's a work computer, and a necessary evil.) Thanks, BTW.
 
Old 09-21-2005, 03:03 PM   #5
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Well, that code is a slight modification of a script I've posted here a few times (and I think I swiped it from somewhere else). The least I can do is support my own nonsense.
 
Old 09-21-2005, 03:13 PM   #6
SGT-D
LQ Newbie
 
Registered: Sep 2005
Location: somewhere around seattle
Distribution: Suse 9.3 Pro
Posts: 6

Original Poster
Rep: Reputation: 0
Negative, SuSe uses dhcpcd, I did a search from root for dhclient and it's not there. I also searched novells website, and found that it defenitely uses dhcpcd. At least by default. Also when I look at the resolv.conf after logging in via being plugged in via eth0 it reads "modified by dhcpcd"

I can't imagine that it's something not loading, because the interface loads ok, for some reason, it just can't modify the resolve.conf at that point in the boot process. Therefor I have no dns. ugga. I can't figure out why the dang eth0 dhcp doesn't do the same thing. I'm pretty sure it's the same runlevel that those ifaces are configured.

Last edited by SGT-D; 09-21-2005 at 03:15 PM.
 
Old 09-21-2005, 03:31 PM   #7
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Hm. You're right, at that point dhcpcd should be running with root privileges. You might want to double check that dhcpcd is in /sbin and that is the one root should be using (basically run which dhcpcd and make sure that the script points to that directory).

One thing to try would be to NOT run the script at boot time, but instead log into root and then run the commands one at a time and see if something more informative happens.
 
Old 09-21-2005, 03:41 PM   #8
SGT-D
LQ Newbie
 
Registered: Sep 2005
Location: somewhere around seattle
Distribution: Suse 9.3 Pro
Posts: 6

Original Poster
Rep: Reputation: 0
Ok, we're thinking along the same lines here...

I remarked out the script and rebooted, logged in as root, and ran each command one at a time.

everything worked flawlessly.

this is not such a slam dunk problem... very strange. I can't figure out why it won't work on startup.

I need to find the script that loads the other interfaces, and see what command and the format of it, that it uses, so I can duplicate it. At least that's the direction that i'm going.

Gotta find the script first though. I thought it was in /etc/sysconfig/network/ but there's nothing but dhcp config files and interface config files in there.
 
Old 09-21-2005, 07:22 PM   #9
SGT-D
LQ Newbie
 
Registered: Sep 2005
Location: somewhere around seattle
Distribution: Suse 9.3 Pro
Posts: 6

Original Poster
Rep: Reputation: 0
Solved!!

OK, here's the deal, the solution was to completely forgo the dhcp solution in the script, not even call dhcpcd. Since the card is set to use DHCP anyway, doing an ifup should force it to call dhcpcd itself, and load any dependencies required before it does so.. This is done by ensuring the ifcfg-wlan0 in /etc/sysconfig/network has this line in it..

BOOTPROTO='dhcp'

in short, my script changed a bit... it went from this...

Code:
ESSID="my_essid"
INTERFACE="wlan0"
MODE="Managed"

#Load the module
echo "Loading NDISWRAPPER"
/sbin/modprobe ndiswrapper

# Set up the WiFi card

echo "Configuring ${INTERFACE}:"
/usr/sbin/iwconfig ${INTERFACE} essid ${ESSID}
#/usr/sbin/iwconfig ${INTERFACE} channel ${CHANNEL}
/usr/sbin/iwconfig ${INTERFACE} mode ${MODE}


# Get IP address from dhcp
echo "Acquiring IP Address"
/sbin/dhcpcd wlan0
to this...

Code:
ESSID="my_essid"
INTERFACE="wlan0"
MODE="Managed"

#Load the module
echo "Loading NDISWRAPPER"
/sbin/modprobe ndiswrapper

# Set up the WiFi card

echo "Configuring ${INTERFACE}:"
/usr/sbin/iwconfig ${INTERFACE} essid ${ESSID}
#/usr/sbin/iwconfig ${INTERFACE} channel ${CHANNEL}
/usr/sbin/iwconfig ${INTERFACE} mode ${MODE}


ifup wlan0
voila!! no more problems, it works with every user i log in with (no messing with the .exrc, which was my next step if this didn't work) and I can google to my hearts content immediately after logging in.

this is a much cleaner way to do it, as wlan0 is loaded the same way the other interfaces are, as well..

we should take all the ndiswrapper threads and stick them in thier own sub forum of this one... it's becoming quite the topic...

thanks for all the help and try to remember this for future solutions... (dhcpcd wlan0 bad, ifup wlan0 good)

Regards, D.
 
Old 09-21-2005, 07:26 PM   #10
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
This is starting to sound like a car that belches smoke except when you drive up to the mechanics.....Then it purrs like a kitten.


I'm pretty rusty when it comes to Suse start up scripts, but is it possible that this isn't being called from the right runlevel? I've been doing a little googling on how Suse boots, and it looks to me like boot.local doesn't associate itself with any runlevel and may run before the runlevel specific scripts. So I suppose it is possible that dhcpcd is being called before the system has networking really set up. I would actually pull this script out of boot.local and put it in its own file (making sure it is a properly executable bash script). I'd then put it into /etc/init.d and put symlinks to it in /etc/rc.d/rc.3 and /etc/rc.d/rc.5. By the way, I'm using this as my reference on how Suse boots up.


Of course you can also just store the script and call it from the command line once you've booted, but that isn't particularly elegant.
 
Old 09-21-2005, 07:38 PM   #11
SGT-D
LQ Newbie
 
Registered: Sep 2005
Location: somewhere around seattle
Distribution: Suse 9.3 Pro
Posts: 6

Original Poster
Rep: Reputation: 0
actually check the post directly above yours. I appreciate all your help, and I thought perhaps there would be something runlevel related.. I'm sure I would have gotten to that point, and it would be cleaner for sure.. maybe i'll go that route at some point when I want to clean it up a bit. For now I'm happy to just not be fighting with it.
 
Old 09-21-2005, 09:13 PM   #12
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Dang, I didn't see that when I wrote my last post. We must have pushed the button about the same time. It also makes sense since I think ifup is actually a script that calls DHCP. Anyway, congrats on getting it worked out and thanks for posting the solution.

Last edited by Hangdog42; 09-21-2005 at 09:15 PM.
 
  


Reply



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
Broadcom Wireless (BCM4306) Wireless problems: modprobe ndiswrapper freezes HP Laptop shthap3ns Linux - Hardware 11 02-11-2007 12:53 PM
ndiswrapper + wireless mewgle Linux - Hardware 6 11-02-2005 12:14 PM
mn-720 wireless and ndiswrapper oceanplexian Linux - Wireless Networking 6 11-03-2004 05:15 PM
ndiswrapper wireless install help please sonoman Linux - Hardware 2 10-15-2004 11:16 AM
Cannot set up wireless, ndiswrapper donbellioni Linux - Wireless Networking 10 07-23-2004 12:13 PM

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

All times are GMT -5. The time now is 09:55 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