How to configure wifi from the commandline

How to do things, solutions, recipes, tutorials
Message
Author
tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#41 Post by tempestuous »

Yes, but what did you do differently from your first attempt that got wpa_supplicant working?
Your results could help others.

AceVentura
Posts: 12
Joined: Tue 01 Jul 2008, 04:35
Location: Mumbai - City of Dreams

#42 Post by AceVentura »

Well,

For starts, I began from scratch, deleted all the earlier files.
Then made a new configuration for wpa supplicant.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++

ctrl_interface=/var/run/wpa_supplicant
#ap_scan=1
update_config=1

network={
# scan_ssid=1
ssid="XXXXXXXXXXXXXXXX"
psk=XXXXXXXXXXXXXXXXXX
# proto=WPA
# key_mgmt=WPA-PSK
# pairwise=TKIP
# group=TKIP
}

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Note that above , I had previously used ASCII passphrase
psk="s:passphrase"
Instead this time around I converted it into hex using wpa passphrase command.
Commented all other things that I did not think were very important.

Once I ran the wpa_supplicant , I ended up having a valid eth1 interface but still pings to router were not geting any response. :(

Digging into this , I came across a entry in routing table like
269.192.0.0 wth netmask 255.255.0.0
This was something that I had not setup, and on a hunch I deleted this from the routing table.
After that , I was able to ping the router and access internet.

Thats all to it....
All I can say is "if you dont succeed, try again " ...thats the way I did it :D

boone773
Posts: 9
Joined: Mon 07 Jul 2008, 10:25

#43 Post by boone773 »

Hi there, I'm having a little trouble:

So, I open rxvt and enter the following:

iwconfig wlan0 essid My_Network
iwconfig wlan0 key open My_Key
iwconfig wlan0 mode managed

My_network ist the name of my network (only letters, the first one being a cap)
My-Key ist my WEP key (consisting of letters and numbers, the first one being a capital letter)

Now, when I enter the second line I get the following error:

iwconfig: unknown command "My_Network"

What am I doing wrong?

AceVentura
Posts: 12
Joined: Tue 01 Jul 2008, 04:35
Location: Mumbai - City of Dreams

#44 Post by AceVentura »

Hi boone773,

Can post some more details ?
version of puppy u r using ?
Adapter name ?
whether your adapter is recognised ?


Cheers,
AceVentura

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#45 Post by tempestuous »

boone773 wrote:My-Key ist my WEP key (consisting of letters and numbers, the first one being a capital letter)
Sorry, my instructions assumed that everyone would be using the true WEP key (hexadecimal digits) and not the WEP password.
I have just updated the instructions in the first post. In short, use the s: prefix.

boone773
Posts: 9
Joined: Mon 07 Jul 2008, 10:25

#46 Post by boone773 »

Thanks for your quick reply guys, I really appreciate it!

I tried with the s: prefix and got a lot further but still I can't browse.
I attached a screenshot of the commandlines.

I am currently using an ASUS WL-167G dongle.

Conncection Wizard recognizes the USB, recognizes my active network, I click on "Wireless", "Scan", click on my network, click on "WEP", enter my network key (actually the password, tried s: as prefix here but that didn't help), click "Use this profile", Wizard reports success, I click on "Acquire DHCP IP", Wizard reports success, but I cannot open any websites?!

I figured since the Wizard won't do the trick I'd try the commandline...

Any ideas?

Thanks, Boone

Edit: Attachment removed
Last edited by boone773 on Wed 09 Jul 2008, 09:46, edited 1 time in total.

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#47 Post by tempestuous »

First I would disable encryption at your wifi router and check that a wifi connection will succeed in this unencrypted mode.

If OK, I would now try with WEP encryption again, but I would pre-load all encryption-related modules before running the iwconfig commands, as explained in PART 4 of the Wifi HOWTO.

If still no success, I would try the alternative form of running dhcpcd, like this -

Code: Select all

dhcpcd -I '' -t 30 -h puppypc -d wlan0

pudgypup
Posts: 29
Joined: Fri 11 Apr 2008, 18:44
Location: Alabama

desktop wireless

#48 Post by pudgypup »

In my office, we have 2 desktops, 1 router, 1 USB wireless netopia ralink, rt2570. I can open puppy 3.01 on both, and access internet from the one with the router. When I try to configure on the USB connection, puppy recognizes it is rausb0, says it has a live network, but the light on the wireless device does not come on, and auto dchp cannot connect. I will try the command line instructions at the beginning of this post, but I'm not sure if I'm in the correct thread. If not, please direct me, if so please help.
Thanks
Rick

boone773
Posts: 9
Joined: Mon 07 Jul 2008, 10:25

#49 Post by boone773 »

@tempestous:

No idea what the problem was with WEP, I switched to WPAPSK, used your tutorial and *bang* works perfectly fine right away!

Thanks a ton mate, you really were of great help! I could never have done this without your great howto! You're great!

pudgypup
Posts: 29
Joined: Fri 11 Apr 2008, 18:44
Location: Alabama

Re: desktop wireless

#50 Post by pudgypup »

pudgypup wrote:In my office, we have 2 desktops, 1 router, 1 USB wireless netopia ralink, rt2570. I can open puppy 3.01 on both, and access internet from the one with the router. When I try to configure on the USB connection, puppy recognizes it is rausb0, says it has a live network, but the light on the wireless device does not come on, and auto dchp cannot connect. I will try the command line instructions at the beginning of this post, but I'm not sure if I'm in the correct thread. If not, please direct me, if so please help.
Thanks
Rick
During a retry of config, I did a scan for the network, loaded the module, checked WEP tab, typed in the encryption key, and now I'm on!!!!

I know it looks like a "Duh" moment, but things you've seen a million times can suddenly come clear, which it did for me. Thanks All!
Rick

nath2omt
Posts: 19
Joined: Fri 18 Jul 2008, 13:22

TRENDnet TEW-441PC works with Puppy 4.0 BUT

#51 Post by nath2omt »

Please help, it could be just a few lines of code.

I got a Trendnet TEW-441PC card (Atheros chipset) for an old IBM laptop with Puppy 4.0, I can get to the internet, but I have to use Network Wizard each time the computer turns on. Here's what happens:

1. Click "ath0', then click "Wireless", it says "Unable" to detect the network, but it goes to "test ath0".

2. The testing ("test ath0") finds my network and suggest I go do DHCP.

3. Using automatic DHCP to scan, it finds my network (Buffalo), and I key in my PSK for the WPA, it gets me connected.

4. BUT, the next time I turn on the computer, the connection icon blinks normally, but when I try to get back to the last website (or any), I cannot and the blink stops too. Then I have to do the Network Wizard again.

Don't know enough to tackle the problem, but it seems a piece of cake for you guys. Thanks for any instructions, howtos, links, etc.

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#52 Post by tempestuous »

Your query relates to the Network Wizard, and you have not run any manual commands. It is not relevant to this thread.
Please start a separate topic.

nath2omt
Posts: 19
Joined: Fri 18 Jul 2008, 13:22

how to skip?

#53 Post by nath2omt »

It's so close, just one more push please. Question: How to get out of the loop after issuing wpa_supplicant command?

With the wpa_supplicant command, it keep reporting
>
1216511294.948946: Scan results: 1
1111111111.111111: RTM_NEWLINK: operstate=1 ifi_flag=Ox11043 ([UP][RUNNING][LOWER_UP]
1111111111.111111: Wireless event: cmd=0x8b19 len=8
1111111111.111111: Received 291 bytes of scan results (1 BSSes)
>
The numbers change each time, but the messages stay the same (I used 1's instead of the real numbers second line on).

Of course without ending this, the dhcpcd command cannot be issued. But, issuing the dhcpcd command in a second rxvt window, everything goes fine.

So, if I know the command to get out of the wpa-supplicant loop, I can piece together a script to set up the wireless connection in one piece.

Thanks everyone who offered help, and please help with this one.

nath2omt
Posts: 19
Joined: Fri 18 Jul 2008, 13:22

TRENDnet TEW-441PC works in Puppy 4.0!

#54 Post by nath2omt »

I got it. It now runs perfectly. The '-Bw' in the wpa_supplicant command did the trick.
wpa_supplicant -iath0 -Dwext -c/etc/wpa_supplicant.conf -Bw

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#55 Post by tempestuous »

nath2omt wrote:But, issuing the dhcpcd command in a second rxvt window, everything goes fine.
Yes, that's the method I intended users to take, but I now realise I didn't explain it properly. I have just updated the earlier instructions.
nath2omt wrote:The '-Bw' in the wpa_supplicant command did the trick.
Actually you should only need "-B" which will background the wpa_supplicant daemon. I have added this information to the earlier post ... with a warning not to do this until you know for certain that the wpa_supplicant command is successful, because once backgrounded you won't see any error messages.

nath2omt
Posts: 19
Joined: Fri 18 Jul 2008, 13:22

#56 Post by nath2omt »

Thanks for this good thread, tempestuous. It has clear enough instructions and good leads from participants to help me, who knows little about computer, to configure my wireless connection. This could be the first reported case with the Trendnet tew-441pc card (Atheros chipset) in Puppy 4.0. You're right regarding the 'w', I don't think it needs to wait any longer to execute the next command.

frankc
Posts: 15
Joined: Thu 31 Jul 2008, 03:37
Location: California

rt2500

#57 Post by frankc »

I had this old Gateway laptop that I was going to give to charity. Then I read about PuppyLInux and I changed my mind. I did some reading up. The laptop has a Hawking HWC54G wireless PCMCIA card, Rev R. Research told me that the chipset was rt2500. More research led me to tempestous's writeups.

So I installed PuppyLinux 4.0.0. I manually entered the iwpriv and iwconfig commands from the howto. I used WPA2. I made some typos but finally got it right. Then I entered the dhcpcd command. The interface (ra0) acquired an IP address . I was able to surf the internet and start a chat session. Boy was I happy. I then created a script that had all the commands in it. Or so I thought. I rebooted the machine to test it out. I have not been able to get it to work since which is really frustrating.

I also tried re-installing but that also did not work.

I have also used the additional modprobe commands to load the additional encryption modules.

Anyone have any suggestions.

Frank

stevesr0
Posts: 169
Joined: Sun 24 Jun 2007, 17:25

#58 Post by stevesr0 »

I have not been able to setup automatic connection to the Internet on my home wireless network, although the saved configuration in the Network Wizard easily loads and then connects each time when I use the autoDHCP service.

I used the commands listed in this thread in a console and was able to connect, so I added these commands to my /etc/rc.d/rc.local file.

However, this doesn't work automatically when I reboot.

-------------------------------------------
The rc.local file contents are:

#this file called from rc.local0
#you can edit this file
#When firewall is installed, will append lines to this file...
modprobe evdev
#dhcpcd eth0
#added commands to start home2 connection automatically
rmmod bcm43xx
modprobe bcm43xx
sleep 5s
ifconfig eth0 up
iwconfig eth0 essid xxxxxxx
iwconfig eth0 channel x
iwconfig eth0 mode managed
iwconfig eth0 key open xxxxxxxxxxxxxxxx
rm -f /var/lib/dhcpcd/*.info
rm -f /var/run/*.pid
route default gw 192.168.2.1 eth0
dhcpcd -t 30 -h puppypc -d eth0

if [ -x /etc/rc.d/rc.firewall ]; then
/etc/rc.d/rc.firewall start
fi
--------------------------------------------------------------------------------------

I added the section below the #added comments line to the line dealing with firewalls (if [ -x...).

I don't know what the purpose of the modprobe evdev is and I commented the next line out dhcpcd eth0 since I added a line for dhcpcd.

I am not sure what is wrong with this and would appreciate comments.

I should also note that running these commands from the console worked the first time, but after booting with the modified rc.local, and finding I wasn't connected, running the commands sequentially from the console DIDN'T work (but then the network wizard did).

Thanks for any help.

Steve

rodb
Posts: 19
Joined: Thu 02 Mar 2006, 21:32

best in the business

#59 Post by rodb »

windows works ... ( correction: worked, before the big crash, with no recovery cd, no nothing, thx, lenovo 3000 c200), windows vista)

puppy still doesnt, but ethernet finally has me connected, so my happiness quotient is much improved (alpha 6)

wireless connectivity has degraded, for me,, since 4.00 - so i cant really be complaining too much - if i wanted reliability, i would be sticking with 4.00, right?

rodb

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#60 Post by tempestuous »

stevesr0,
When you run the Network Wizard it creates a configuration file somewhere - maybe /etc/netconfig or similar?
I'm away from a Linux computer for several days, so I can't check the details.
This configuration file is then referenced during boot up to automatically configure your saved network settings.
I suspect that this configuration file will conflict with the setup commands that you manually added to /etc/rc.d/rc.local
So the solution would be to delete the configuration file.

rodb,
If the wifi connection that you refer to is configured via the Network Wizard instead of manual commands then your post is off-topic in this thread. The correct thread would be one of the alpha bug reports, or Dougal's thread about improving the Wizard.

Post Reply