Linux - Wireless NetworkingThis forum is for the discussion of wireless networking in Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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:
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.
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.
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.
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.
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.
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)
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.