Wiki source for HowToWifiFromCommandWEP


Show raw source

[[HomePage]] > [[ComponentHowTo Components and HowTos]] > [[Networking]]
{{include pagesHowToWifi}}

====How to configure wifi from the commandline====

==PART 1: WEP encryption.==

""
To configure for WEP encryption -
<br/>
</span><table width="90%" cellspacing="1" cellpadding="3" border="0" align="center"><tbody><tr> <td><span class="genmed"><b>Code:</b></span></td> </tr> <tr> <td class="code">iwconfig eth1 essid MY_ESSID
<br/>
iwconfig eth1 key open 1234567890
<br/>
iwconfig eth1 mode managed</td> </tr></tbody></table><span class="postbody">

<br/>
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.
<br/>
Obviously replace "MY_ESSID" with your SSID, and "1234567890" with your WEP encryption key - as hexadecimal digits.
<br/>
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 -
<br/>
</span><table width="90%" cellspacing="1" cellpadding="3" border="0" align="center"><tbody><tr> <td><span class="genmed"><b>Code:</b></span></td> </tr> <tr> <td class="code">iwconfig eth1 key open s:MY_WEP_PASSWORD</td> </tr></tbody></table><span class="postbody">
<br/>
And if your password contains spaces, you should enclose it in quotation marks.

<br/>

<br/>
Most wifi routers use "open" WEP authentication, but it could be "restricted", in which case the 2nd command should be
<br/>
</span><table width="90%" cellspacing="1" cellpadding="3" border="0" align="center"><tbody><tr> <td><span class="genmed"><b>Code:</b></span></td> </tr> <tr> <td class="code">iwconfig eth1 key restricted 1234567890</td> </tr></tbody></table><span class="postbody">
<br/>
Or if your router has no encryption, the 2nd command should be
<br/>
</span><table width="90%" cellspacing="1" cellpadding="3" border="0" align="center"><tbody><tr> <td><span class="genmed"><b>Code:</b></span></td> </tr> <tr> <td class="code">iwconfig eth1 key off</td> </tr></tbody></table><span class="postbody">

<br/>

<br/>
Now to obtain an automatic IP address (DHCP)
<br/>
for Puppy 3.x and earlier -
<br/>
</span><table width="90%" cellspacing="1" cellpadding="3" border="0" align="center"><tbody><tr> <td><span class="genmed"><b>Code:</b></span></td> </tr> <tr> <td class="code">rm /etc/dhcpc/*.pid
<br/>
dhcpcd -t 30 -h puppypc -d eth1</td> </tr></tbody></table><span class="postbody">

<br/>

<br/>
for Puppy 4.0 onwards, the version of dhcpcd is different, thus -
<br/>
</span><table width="90%" cellspacing="1" cellpadding="3" border="0" align="center"><tbody><tr> <td><span class="genmed"><b>Code:</b></span></td> </tr> <tr> <td class="code">rm -f /var/lib/dhcpcd/*.info
<br/>
rm -f /var/run/*.pid
<br/>
dhcpcd -t 30 -h puppypc -d eth1</td> </tr></tbody></table><span class="postbody">

<br/>

<br/>
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 -
<br/>
</span><table width="90%" cellspacing="1" cellpadding="3" border="0" align="center"><tbody><tr> <td><span class="genmed"><b>Code:</b></span></td> </tr> <tr> <td class="code">dhcpcd -I '' -t 30 -h puppypc -d eth1</td> </tr></tbody></table><span class="postbody">
<br/>
That's hyphen, capital i, space, apostrophe, apostrophe (not quotation marks). Thanks to rerwin for this information.
<br/>

<br/>
Or to obtain a static IP address,
<br/>
modify /etc/resolv.conf to include your nameservers, then
<br/>
</span><table width="90%" cellspacing="1" cellpadding="3" border="0" align="center"><tbody><tr> <td><span class="genmed"><b>Code:</b></span></td> </tr> <tr> <td class="code">ifconfig eth1 192.168.0.xx broadcast 192.168.0.255 netmask 255.255.255.0
<br/>
route add default gw 192.168.0.1 eth1</td> </tr></tbody></table><span class="postbody">
<br/>
Obviously replace the appropriate IP addresses.

<br/>

<br/>
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.
<br/>
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.</span>
<span class="gensmall"><br/>Edited_times_total<br/></span></td>
""

==Further reading==
[[HowToWifiFromCommandWPA PART 2 WPA encryption]]
[[http://www.murga-linux.com/puppy/viewtopic.php?p=159339#159339 PART 3: WPA encryption with Ralink devices (pre-Puppy 4.1 ONLY)]]

==Related Webapages==
[[http://www.murga-linux.com/puppy/viewtopic.php?t=22469 How to configure wifi from the commandline thread]]

----
==Categories==
CategoryTutorial
CategoryNetworking
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki