Revision [29072]
This is an old revision of HowToWifiFromCommandWPA made by darkcity on 2013-10-06 15:31:38.
Intro | part1 - WEP | part2 - WPA
How to configure wifi from the commandline
(continued from HowToWifiFromCommand Intro)
PART 2: WPA encryption.
PART 2: WPA encryption.
For WPA encryption the "iwconfig" utility cannot be used at all. Instead, the "wpa_supplicant" utility is needed, and this is the utility which is used by Puppy's Network Wizard to configure WPA connections.
Exception:
Ralink drivers in Puppy versions older than ver 4.1 can be set up for WPA encryption with unique "iwpriv" commands. See -
"PART 3: WPA encryption with Ralink devices"
http://www.murga-linux.com/puppy/viewtopic.php?p=159339#159339
wpa_supplicant needs to have a "-D" (driver) parameter specified, depending on which wifi driver is being used;
Compatible drivers using the "hostap" parameter:
hostap
Compatible drivers using the "ipw" parameter:
r8180
r8187
Compatible drivers using the "wext" (generic) parameter:
acx ath5k ath_pci b43 b43legacy bcm43xx ipw2100 ipw2200 ipw3945 iwl3945 | iwl4965 libertas_cs libertas_sdio ndiswrapper p54pci p54usb rndis_wlan (Broadcom USB) | rt2400pci rt2500pci rt2500usb rt2860sta rt2870sta rt61pci rt73usb rtl8180 rtl8187 usb8xxx zd1211 zd1211b zd1211rw |
Compatible drivers using the "ralink" parameter:
rt61
rt73
INSTRUCTIONS
Use Geany to modify the WPA configuration file to include your SSID and Personal Security Key (PSK).
Puppy already contains 2 different configuration files;
/etc/network-wizard/wireless/wpa_profiles/wpa_supplicant.conf - for WPA encryption
/etc/network-wizard/wireless/wpa_profiles/wpa_supplicant2.conf - for WPA2 encryption
As an example, let's assume your wifi driver is the ipw2200 (so the -D parameter will be "wext") and this driver has created the network interface "eth1", and your wifi router is set for WPA2 encryption. First you must load your driver if Puppy has not automatically done so already
Code: |
modprobe ipw2200 |
It's often necessary to "bring up" the interface unconfigured
Code: |
ifconfig eth1 up |
Remove stale wpa_supplicant file if it exists
Code: |
rm /var/run/wpa_supplicant/* |
Start wpa_supplicant with debugging enabled (-dd) in case of problems
Code: |
wpa_supplicant -i eth1 -D wext -c /etc/network-wizard/wireless/wpa_profiles/wpa_supplicant2.conf -dd |
wpa_supplicant may take about 30 seconds to negotiate the connection.
Hopefully you will see a connection reported, then you can open a second console and proceed to obtain an IP address (DHCP).
It's possible to background the wpa_supplicant process in order to keep using the same xterminal by adding "-B" to the command
... but do this only once you know that the wpa_supplicant command is successful, because once backgrounded you won't see any error messages.
Now for DHCP with Puppy 3.x and earlier -
Code: |
rm /etc/dhcpc/*.pid
dhcpcd -t 30 -h puppypc -d eth1 |
for Puppy 4.0 onwards, the version of dhcpcd is different, thus -
Code: |
rm -f /var/lib/dhcpcd/*.info
rm -f /var/run/*.pid dhcpcd -t 30 -h puppypc -d eth1 |
If this dhcpcd command fails, try it with extra parameters which avoid any use of the new logic for ipv6-compatible Client ID, like this -
Code: |
dhcpcd -I '' -t 30 -h puppypc -d eth1 |
That's hyphen, capital i, space, apostrophe, apostrophe (not quotation marks). Thanks to rerwin for this information.
or to obtain a static IP address,
modify /etc/resolv.conf to include your nameservers, then
Code: |
ifconfig eth1 192.168.0.xx broadcast 192.168.0.255 netmask 255.255.255.0
route add default gw 192.168.0.1 eth1 |
Obviously replace the appropriate IP addresses.
Further reading
HowToWifiFromCommandWEP PART 1 WEP encryptionPART 3: WPA encryption with Ralink devices (pre-Puppy 4.1 ONLY)