Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
05-17-2006, 06:50 PM
|
#1
|
Member
Registered: Jun 2003
Location: Toronto, Canada
Distribution: Ubuntu 10.04 LTS; CentOS 5.5
Posts: 199
Rep:
|
Disabling/enabling the wireless card
Hello,
I have an installation of Kubuntu running on a laptop, and I'm also part of a wireless network that has WEP security. Kubuntu is completely unable to deal with WEP and wireless, I have no idea why. Nevertheless, I went to the console, and wrote the following script:
Code:
#!/bin/sh
iwconfig eth1 essid mynetwork
iwconfig eth1 key s:myencryptionkey
dhclient
echo 1 > /proc/acpi/asus/wled #to turn on the LED on the laptop
However, this code doesn't run too well until I restart the network card (again, I have no idea why...i think it loads some stupid settings at startup). Currently, the onlt way for me to do it is to go to the KDE control centre -> network, make a change, press apply (this causes the card to reset), undo it, hit apply again. Only then does my script work. Is there a line I can put above my script to do this automatically?
Thanks!
|
|
|
05-17-2006, 07:48 PM
|
#2
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
Look for a Kubuntu network interface configuration. I think that you are using only the KDE's kcontrol, and not the systems configuration. You can probably configure the wireless device there, including the wireless authentication settings. I just use the wireless interface on my laptop at home, so I set the wireless interface to start on boot, and the NIC interface to start on connection ( this changes the hotplug configuration ). On my system, the wireless interface configuration is contained in the file /etc/sysconfig/network/ifcfg-wlan0. Several distro's use the same location for this file.
Look in your Kubuntu documentation, for information on "interface configuration".
|
|
|
05-17-2006, 08:57 PM
|
#3
|
Member
Registered: Jun 2003
Location: Toronto, Canada
Distribution: Ubuntu 10.04 LTS; CentOS 5.5
Posts: 199
Original Poster
Rep:
|
Naw, that file deosn't exist and I've given up trying to do this through GUI. Can you please give me the shell code to enable and disable the interface? It's called eth1 on my comp. Thanks.
|
|
|
05-17-2006, 09:02 PM
|
#4
|
Senior Member
Registered: Apr 2005
Location: BrewCity, USA (Milwaukee, WI)
Distribution: Xubuntu 9.10, Gentoo 2.6.27 (AMD64), Darwin 9.0.0 (arm)
Posts: 1,152
Rep:
|
I'm also useing a script for my wifi I'll post the whole script if you'd like (it's an asus wl-167g)
but maybe try adding:
ifconfig eth1 down
ifconfig eth1 up
to your script this should reset the card from your script.
|
|
|
05-17-2006, 09:38 PM
|
#5
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
You may need to read through the boot up scripts. They may have names suggesting what they do, and probably source a configuration file. If you can locate the configuration file for the interface itself, then editing that file should work, however, there may be other files involved. For example, a GUI configuration for the interface would have an option on when you want the device configured. The dialog will mainly edit the interface configuration, but also make appropriate changes to others such as /etc/ifplugd/ifplugd.action and /etc/ifplugd/ifplugd.conf.
If your system has a file similar to my ifcfg-wlan0 configuration, you could grep for likely strings containing the same information.
sudo egrep -iR 'WIRELESS_KEY_[0-3]=' /etc/*
sudo egrep -iR '(WIRELESS_MODE|AUTH_MODE|BOOTPROTO=)' /etc/*
The resulting file found could be either a configuration file, or a script that sources it. For example, on my system, a script contains these lines:
Code:
######################################################################
# check presence of global configuration file and source it
#
test -f ./wireless && . ./wireless
# ifcfg-* is more important and fragile then wireless
if [ -f ./ifcfg-$CONFIG ] ; then
. ./ifcfg-$CONFIG
elif [ "$ACTION" != down ] ; then
err_mesg "could not find configuration file ifcfg-$CONFIG"
fi
This is from a file found in the second egrep command I gave. It tests for the existance of a configuration file before sourcing it. This is a pretty standard way of doing things. You may also notice many of your configuration files contain lines that follow a NAME=value format. These files are sourced, i.e. run in the same shell, by other scripts needing them. You don't need to change the scripts (and probably shouldn't) but just change the values in the config file.
Also, if you find a configuration file, they often have their own man page. Such as ifplugd.conf
Your system may have an "ifup" script. Try "locate ifup". Read through the script; it probably sources the config files that you need to use. These config files may even have their own manpages as well.
Last edited by jschiwal; 05-17-2006 at 10:58 PM.
|
|
|
05-17-2006, 10:26 PM
|
#6
|
Member
Registered: Jun 2003
Location: Toronto, Canada
Distribution: Ubuntu 10.04 LTS; CentOS 5.5
Posts: 199
Original Poster
Rep:
|
Okay, thanks...I'm a bit disappointed with the fact that Ubuntu/Kubuntu cannot handle secured connections through their GUI, and that I need to run a script to do it (on the upside, it's only three lines). Thanks for the suggestions, I'll see what I can dig up.
|
|
|
All times are GMT -5. The time now is 03:14 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|