HOWTO: Use IWCONFIG
Iwconfig is another wireless tool that is hopefully present on your distro. Unlike iwlist, iwconfig can be used to actually set parameters in a wireless card rather than just look at their settings.
To use iwconfig, open a terminal window and type:
iwconfig
This shows me the following. Your system may vary:
- lo no wireless extensions.
- eth0 no wireless extensions.
- wlan0 IEEE 802.11b+ ESSID:”driveon” Nickname:”acx100 v0.2.0pre8″
Mode:Managed Frequency:2.442 GHz Access Point: 00:06:25:9A:50:C8
Bit Rate:1 Mb/s Tx-Power:18 dBm Sensitivity=187/255
Retry min limit:7 RTS thr:off
Power Management:off
Link Quality=54/100 Signal level=39/100 Noise level=1/100
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0- sit0 no wireless extensions.
lo is my local adapter and it shows that it’s not wireless
eth0 is my wired ethernet card and it shows that it’s not wireless
wlan0 is my wireless card and it shows that it is wireless - good!
sit0 stands for ’simple internet transition’ but that’s all I know about it. In any case - it’s not wireless.
I highly advise typing man iwconfig to get complete information on everything that can be done with the iwconfig command, but here are some of the more common commands you may want to use:
- iwconfig wlan0 enc < key >: Sets the WEP encryption key to < key >
- iwconfig wlan0 mode managed: Sets the mode to managed
- iwconfig essid driveon: Sets the ESSID/SSID to ‘driveon’
- iwconfig channel 7: Sets the card to use channel 7
Note that you can put all these commands together, as in:
- iwconfig wlan0 enc
mode managed essid driveon channel 7
Note that iwconfig is used to set the parameters of the card, it does not bring the card ‘up’ for use. You must use the command:
ifconfig wlan0 up
for that.
Ifconfig is the subject of a future entry. Stay tuned!
Related Stories
POSTED IN: General
9 opinions for HOWTO: Use IWCONFIG
New Linux User » HOWTO: Use Ifconfig.
Nov 9, 2005 at 8:13 pm
[…] You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your ownsite. […]
New Linux User » Geeky Fun: Logging On To Darkstar
Mar 2, 2006 at 9:34 am
[…] My Linkysys wifi card was recognized as eth0. A simple iwconfig eth0 key and a dhcpcd brought it up. You may have to do more (since my Dlink PCI wifi card in the desktop upstairs is still failing to come up) and might want to check out my posts on iwconfig and iwlist. […]
Luca Masters
Jan 7, 2008 at 6:46 pm
A note about this line:
“iwconfig wlan0 enc mode managed essid driveon channel 7″
After ‘enc ‘ there’s a ‘mykey’ in angle brackets. It doesn’t display in HTML.
val
Mar 14, 2008 at 4:56 am
Ok guys, how can configure iwconfig to handle my WPA based wireless connection? I have madwifi driver installed, have Wireless tools installed and have NetworkManager aswell, but NM works only when I log in as user, as soon as I try to switch to init 3, where no X server is up, I dont have internet, so I need to configure wireless using iwconfig or other relevant tools, so i can boot with internet and have it irrelevant if i run X server or not.
Any idieas?
val
Mar 14, 2008 at 4:56 am
Ok guys, how can configure iwconfig to handle my WPA based wireless connection? I have madwifi driver installed, have Wireless tools installed and have NetworkManager aswell, but NM works only when I log in as user, as soon as I try to switch to init 3, where no X server is up, I dont have internet, so I need to configure wireless using iwconfig or other relevant tools, so i can boot with internet and have it irrelevant if i run X server or not.
Any idieas?
imneat
Mar 23, 2008 at 6:32 pm
@val
iwconfig and WPA can be tricky. Gotta configure wpa_supplicant and have it running in the background like a daemon.
Configure /etc/wpa_supplicant.conf to have the following lines:
—–
#
ctrl_interface=/var/run/wpa_supplicant
eapol_version=1
ap_scan=1
fast_reauth=1
network={
ssid=”yourSSID”
psk=”yourWPApassword”
priority=5
}
#
—–
Now use iwconfig, run wpa_supplicant, start your connection:
$iwconfig ath0 essid YourSSID #set iwconfg to your ssid
$wpa_supplicant -iath0 -c/etc/wpa_supplicant.conf -B #start the wpa “daemon”
$dhcpcd -d ath0 #obtain IP address from DHCP server
Using wpa_supplicant sorta replaces the manually setting a key [iwconfig ath0 key YourPW] shown above.
Hope this helps!
Rolf
Jul 22, 2008 at 11:46 am
Thanks for the quick reminder :) Nr. 2 on google :)
pete
Sep 6, 2008 at 6:16 am
Thanks! This has just solved my problem configuring WUSB300N adapter in Mandriva.
mehul
Oct 21, 2008 at 12:25 am
Thanks imneat for the wpa how-to. It worked great :)
Have an opinion? Leave a comment: