Revision [20743]

This is an old revision of HowToWifiFromCommandWEP made by darkcity on 2012-02-24 12:53:17.


HomePage > Components and HowTos > Networking > Wifi Commandline

How to configure wifi from the commandline

(continued from Intro)

PART 1: WEP encryption.

To configure for WPA encryption, see PART 2.)

To configure for WEP encryption -
iwconfig eth1 essid MY_ESSID
iwconfig eth1 key open 1234567890
iwconfig eth1 mode managed

You will often see reference to these 3 parameters, essid/key/mode, being used within a single iwconfig command instead of 3 separate commands, but apparently the configuration is more reliable when the parameters are run separately.
Obviously replace "MY_ESSID" with your SSID, and "1234567890" with your WEP encryption key - as hexadecimal digits.
If you want to use your WEP password (ASCII string) instead of the true WEP hex key, then you must use the s: prefix. In this case the 2nd command would be -
iwconfig eth1 key open s:MY_WEP_PASSWORD

And if your password contains spaces, you should enclose it in quotation marks.

Most wifi routers use "open" WEP authentication, but it could be "restricted", in which case the 2nd command should be
iwconfig eth1 key restricted 1234567890

Or if your router has no encryption, the 2nd command should be
iwconfig eth1 key off

Now to obtain an automatic IP address (DHCP)
for Puppy 3.x and earlier -
rm /etc/dhcpc/*.pid
dhcpcd -t 30 -h puppypc -d eth1

for Puppy 4.0 onwards, the version of dhcpcd is different, thus -
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 -
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
ifconfig eth1 192.168.0.xx broadcast netmask
route add default gw eth1

Obviously replace the appropriate IP addresses.

Puppy contains an alternative wifi configuration utility, RutilT. This is more than just a script, it's a full application, and may be useful if the Network Wizard fails, especially at the last point of setup; acquiring an IP address.
But RutilT supports WPA encryption ONLY with Ralink wifi drivers (for which RutilT was originally written) and even then, only the basic WPA/PSK-TKIP variant.


Further reading
PART 2 WPA encryption
PART 3: WPA encryption with Ralink devices (pre-Puppy 4.1 ONLY)

Also see
How to configure wifi from the commandline thread
There are no comments on this page.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki