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.
I would like to run the following script on boot:
#!/bin/bash
#
# Network Script
#
iwconfig wlan0 mode Managed
iwconfig wlan0 key restricted 9138032573
ifup wlan0
exit
I have run each individual command in terminal and my card comes up. However, when I run the script the card fails to come up and tell me determining ip inof failed no link present check cable.
Why would running each individaul command work but in a script it fails? also, once I get the script to run properly, how do I set up a link in /etc/rc.d/rc5.d to run on boot?
Is this correct >
ln -s /etc/rc.d/rc.d5.d/S100myNetworkScript /etc/rc.d/init.d/myNetworkScript
I suspect that your script called by the link 'S123...' will execute early rather than late, because those links are probably sorted alphabetically, so 'S123' would be between 'S10' and 'S20'. If you want it to run later, use 'S90'.
But then again, if it works, why mess with it?
/etc/network/interfaces
on Ubuntu, so probably Debian and other variants too
If you put your distro in your LQ profile, people will be able to help you better.
On many distro's you should base your script on a skeleton service script and use instserv to create the link. You may also have the chkconfig command which can be thought of as a front end to inserv when used to enable services at certain run levels. ( I don't know which distro you have ).
Also check if you have a /etc/sysconfig/network/ folder. There may be an ifcfg-wlan0 configuration file where you can set the values used by the device and let the system's startup script initalize the device and authenticate with the access point using wpa_supplicant.
The administrator's manual for your distro probably has the details on how this all works for your system.
I am running Fedora 5. I created ifcfg-wlan0 configuration file and that is when the card showed up in the Network Manager. I also did a number of things that other people suggested so that the card would start at boot. Unfortunately, at boot time it gives me the message that the link is not there and to check the cable. That is when I decided to run the script of the commands I use to bring up the link and get the ip address. Since it works this way I am inclned to go with 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.