LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-20-2010, 09:20 AM   #1
coffeebug
LQ Newbie
 
Registered: Mar 2009
Posts: 10

Rep: Reputation: 0
Wireless-tools -- how to use it?


Could've used previous thread but I guess its really a separate issue. I did search for similar threads.

Running Debian --- 2.6.26-2-686 #1 SMP

I was recommended to use wireless-tools from http://packages.debian.org/lenny/net/wireless-tools.

So I installed it. What does it do? How do you start it? There are no "shortcuts" to launch it. Aren't there man pages for it? Is this actually the package I need to connect to my home wireless network?

Thank you so much,
Jim
 
Old 08-20-2010, 09:30 AM   #2
pielas
Member
 
Registered: Jan 2009
Location: Poland
Distribution: Arch Linux
Posts: 50

Rep: Reputation: 17
You should look at programs named iwconfig and iwlist. For example with iwlist you can scan for avalible wireless networks.
 
Old 08-20-2010, 09:14 PM   #3
coffeebug
LQ Newbie
 
Registered: Mar 2009
Posts: 10

Original Poster
Rep: Reputation: 0
What I've found is that its not a gui program, its a collection of terminal commands. They have their own man pages.
As far as I can tell, they are:
iwconfig, iwlist, iwspy, and iwpriv.

I thought I could expect documentation on the Debian site, yet only found at: http://www.hpl.hp.com/personal/Jean_...nux/Tools.html

Not for this thread, but, I scanned and found my home network but I currently cannot get iwconfig to accept an access point, and I need to put iwconfig into a boot-time script.
 
Old 08-20-2010, 09:56 PM   #4
sag47
Senior Member
 
Registered: Sep 2009
Location: Orange County, CA
Distribution: Kubuntu x64, Raspbian, CentOS
Posts: 1,850
Blog Entries: 36

Rep: Reputation: 455Reputation: 455Reputation: 455Reputation: 455Reputation: 455
Quote:
Originally Posted by coffeebug View Post
I scanned and found my home network but I currently cannot get iwconfig to accept an access point, and I need to put iwconfig into a boot-time script.
This all depends on what the encryption of your wireless router is. If you're using WEP encryption then you can just use wireless tools with a few easy steps.
Code:
iwlist
ifconfig wlan0 down
iwconfig wlan0 enc "<YOUR HEX ENC KEY>" channel <your wireless channel from iwlist> mode Managed
ifconfig wlan0 up
dhclient wlan0
If your network is some form of WPA then you need to look into wpa_supplicant and wpa_supplicant.conf and create a configuration that works with your wireless.

If you find a configuration that works for you then refer to the debian reference on creating or modifying runlevel S scripts and how to implement them. In particular the following sections may interest you.
3.5.7. Network interface initialization
Chapter 5. Network setup

As for the command documentation using google always helps. Just search "man <command>" in google and you'll likely find useful documentation on what you inquire.

Also typing "<command> --help" may also present useful information.

Hope that helps,
SAM

Last edited by sag47; 08-20-2010 at 09:59 PM.
 
1 members found this post helpful.
Old 08-24-2010, 09:06 AM   #5
coffeebug
LQ Newbie
 
Registered: Mar 2009
Posts: 10

Original Poster
Rep: Reputation: 0
Thanks. That helps! It'll take approximately two weeks to work through this.
 
Old 08-24-2010, 09:27 AM   #6
djsmiley2k
Member
 
Registered: Feb 2005
Location: Coventry, UK
Distribution: Home: Gentoo x86/amd64, Debian ppc. Work: Ubuntu, SuSe, CentOS
Posts: 343
Blog Entries: 1

Rep: Reputation: 72
Thumbs up

Quote:
Originally Posted by coffeebug View Post
Thanks. That helps! It'll take approximately two weeks to work through this.
Hehe theres a reason I dont like debian - the lack of resources of what seems to be classed as "obvious stuff "

Stick with it - If you know your key, and know your network then it can be setup quite quickly, but iwconfig can be strange at times (and if like me, you have a wifi card which randomly refuses to work!) however once your setup its a kind of "set and forget" thing. I've had to reconfigure my wireless about.... 5 times in as many years and even then it was because I moved house etc and ended up with a new router/wifi network.
 
Old 08-24-2010, 11:04 AM   #7
sag47
Senior Member
 
Registered: Sep 2009
Location: Orange County, CA
Distribution: Kubuntu x64, Raspbian, CentOS
Posts: 1,850
Blog Entries: 36

Rep: Reputation: 455Reputation: 455Reputation: 455Reputation: 455Reputation: 455
I just edited the wiki and added entries which answer your question pretty much straight forward.

http://wiki.linuxquestions.org/wiki/..._configuration

I also added the following sections to it...
2.1 Gaining root access
3.2 Use WPA/WPA2 Personal
3.3 Use WPA/WPA2 Enterprise
3.5 Autostarting network configuration

See them all (including example configurations, etc.) at the wiki page.
http://wiki.linuxquestions.org/wiki/Wireless_networking
 
Old 08-24-2010, 06:55 PM   #8
genogebot
Member
 
Registered: Jun 2010
Location: Brisbane, Australia
Distribution: Xubuntu 16.04.1 / Linux Mint 18 XFCE / Linux Mint 18 Mate / Ubuntu Server 16.04.1 / Lubuntu 16.04.1
Posts: 146

Rep: Reputation: 19
Quote:
Originally Posted by sag47 View Post
I just edited the wiki...
Any chance of adding a section to the wiki about enabling and disabling wireless cards using iwconfig? It took me ages to figure this out by myself (http://www.linuxquestions.org/questi...1/#post4066717), and others may find it useful.
 
Old 08-25-2010, 01:11 AM   #9
sag47
Senior Member
 
Registered: Sep 2009
Location: Orange County, CA
Distribution: Kubuntu x64, Raspbian, CentOS
Posts: 1,850
Blog Entries: 36

Rep: Reputation: 455Reputation: 455Reputation: 455Reputation: 455Reputation: 455
@genogebot: anyone can edit the wiki. just create a user and do it
 
Old 08-25-2010, 01:49 PM   #10
sag47
Senior Member
 
Registered: Sep 2009
Location: Orange County, CA
Distribution: Kubuntu x64, Raspbian, CentOS
Posts: 1,850
Blog Entries: 36

Rep: Reputation: 455Reputation: 455Reputation: 455Reputation: 455Reputation: 455
Hey genogebot,
I added it to the wireless wiki. However I highly encourage you, and others, to create a wiki login so that you can contribute to it as you find and create answers to others' questions!

SAM
 
Old 08-25-2010, 02:57 PM   #11
the trooper
Senior Member
 
Registered: Jun 2006
Location: England
Distribution: Debian Stretch Amd64
Posts: 1,477

Rep: Reputation: Disabled
@coffebug

Did you look at the link that snowpine posted in your previous thread?,the one for the Debian wiki?
See the relevant link here:

http://wiki.debian.org/WiFi/HowToUse

Many users favour using wicd,just as a hint.

Quote:
Hehe theres a reason I dont like debian - the lack of resources of what seems to be classed as "obvious stuff
You just need to know where to look.
 
Old 08-25-2010, 07:57 PM   #12
genogebot
Member
 
Registered: Jun 2010
Location: Brisbane, Australia
Distribution: Xubuntu 16.04.1 / Linux Mint 18 XFCE / Linux Mint 18 Mate / Ubuntu Server 16.04.1 / Lubuntu 16.04.1
Posts: 146

Rep: Reputation: 19
Quote:
Originally Posted by sag47 View Post
@genogebot: anyone can edit the wiki. just create a user and do it
Ok thanks, I didn't realise that - I thought maybe you had to be some sort of wiki guru - off to create a user now
 
Old 10-04-2010, 08:50 AM   #13
coffeebug
LQ Newbie
 
Registered: Mar 2009
Posts: 10

Original Poster
Rep: Reputation: 0
I decided on using same thread because the big problem is still about wireless-tools > iwconfig.

Someone at the local user group installed wicd on my Compaq/broadcom4312, and it connected to a totally unsecured wireless network at the local hackerspace, but it always fails to obtain an IP at my home (currently wpa2/psk/aes).

I checked the bugs page < http://bugs.debian.org/cgi-bin/pkgre...i?package=wicd >, and maybe I'm experiencing an issue mentioned there, so I ditched wicd.

I made the following script (but I wasn't able to make it executable with chmod +x ; I'll deal with that later).

Following my script and keyboarding commands into a root terminal fails too, particularly at the "custom pass phrase" (what my 2wire router calls security). I read iwconfig doesn't do pass phrase but I'm unclear on hex vs ascii.

The access point never wants to associate.

So here is the script I had hoped I would boot with:

iwconfig wlan0
ifconfig wlan0 down
iwconfig wlan0 essid Mordor
iwconfig wlan0 channel 6

iwconfig wlan0 key restricted 2a3b4a5c
#this one bombs, I've tried different sets of digits, quotes,
# words, etc.here's the diagnostic:
#Error for wireless request "Set Encode" (8B2A) :
# SET failed on device wlan0 ; Invalid argument.
#


#not sure if master mode is appropriate...??
iwconfig wlan0 mode master
ifconfig wlan0 up
wpa_supplicant -Dwext -B -dd -K -h -v -w -N -iwlan0

dhclient wlan0

Still, I feel too close to just bail on Debian and go Ubuntu.

Also, I just installed network-manager-gnome; I already was in netdev group, I tried restarting init.d/dbus, and still do not see a frontend.
 
Old 10-04-2010, 10:26 AM   #14
sag47
Senior Member
 
Registered: Sep 2009
Location: Orange County, CA
Distribution: Kubuntu x64, Raspbian, CentOS
Posts: 1,850
Blog Entries: 36

Rep: Reputation: 455Reputation: 455Reputation: 455Reputation: 455Reputation: 455
You want the managed mode. You're not running an Ad-Hoc network...
Code:
iwconfig wlan0 mode Managed
Next you need to create a wpa_supplicant.conf to supply your router with a wpa passphrase...

Code:
ctrl_interface=/var/run/wpa_supplicant

network={
        ssid="Mordor"
        scan_ssid=1
        key_mgmt=WPA-PSK
        psk="frodo"
}
Where frodo is your wpa passphrase. Alternatively if you don't want people to easily know your network key then you can encode the passphrase with wpa_passphrase and use it instead of frodo.
Code:
wpa_passphrase Mordor frodo
Then once you have your wpa_supplicant.conf file you need your script which I wrote directly into the LQ Wiki for you.

Code:
#!/bin/sh 
iface=wlan0

#shut down interface
ifconfig $iface down

#set ad-hoc/management of wireless device
iwconfig $iface mode Managed

#enable interface
ifconfig $iface up

#stop any persistent wireless wpa2 sessions
killall wpa_supplicant

#apply WPA/WPA2 personal settings to device
wpa_supplicant -B -Dwext -i $iface -c ./wireless-wpa.conf -dd

#obtain an IP address
dhclient $iface
If you just want the bare minimum commands like your script then here they are corrected...
Code:
#!/bin/sh
ifconfig wlan0 down
iwconfig wlan0 mode Managed
ifconfig wlan0 up
wpa_supplicant -B -Dwext -i wlan0 -c ./wireless-wpa.conf -dd
dhclient wlan0
LQ Wiki Articles
http://wiki.linuxquestions.org/wiki/...FWPA2_Personal
http://wiki.linuxquestions.org/wiki/WPA#How_to_use_WPA

Last edited by sag47; 10-04-2010 at 10:32 AM.
 
Old 10-08-2010, 12:57 PM   #15
coffeebug
LQ Newbie
 
Registered: Mar 2009
Posts: 10

Original Poster
Rep: Reputation: 0
My Windows machine has IP address automatically obtained
(on this wireless network).
From the lq wiki I changed the location to
/etc/wireless-wpa.conf
instead of
./wireless-wpa.conf

Also my root shell doesn't recognize hwinfo as a command.

I think the wpa_supplicant command worked, it didn't complain so hope you didn't need to see that clutter.

I hate to be a pill but this will take me a couple of years w/o help. THANK YOU SO MUCH!!

Looking at the output below, I suspect the unknown hardware address type 801 and socket/fallback point to a problem...Here is the output from dhclient:

POS-Compaq:/home/evil# dhclient wlan0
There is already a pid file /var/run/dhclient.pid with pid 3267
killed old client process, removed PID file
Internet Systems Consortium DHCP Client V3.1.1
Copyright 2004-2008 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/

wmaster0: unknown hardware address type 801
wmaster0: unknown hardware address type 801
Listening on LPF/wlan0/00:90:4b:5e:f3:8e
Sending on LPF/wlan0/00:90:4b:5e:f3:8e
Sending on Socket/fallback
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 5
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 10
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 21
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 16
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 9
No DHCPOFFERS received.
No working leases in persistent database - sleeping.

Last edited by coffeebug; 10-08-2010 at 12:58 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
ubuntu wireless tools & wireless card ANSWER NEEDED plugo Linux - Networking 1 10-09-2009 09:43 PM
installing wireless tools yasserbn Linux - Software 2 01-03-2009 10:36 PM
What wireless tools do you all use? subaruwrx Linux - Wireless Networking 3 07-22-2007 01:28 AM
Trouble installing wireless-tools & trying to install Wireless PCI pragmatic Linux - Wireless Networking 1 06-21-2005 08:39 AM
wireless-tools question h/w Linux - Wireless Networking 2 10-23-2003 10:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:04 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration