Connect to a wireless network with the command line

wireless.jpg

You can do it manually from the command line, assuming you have network tools for linux installed. Know the name of your wireless connection: mine is ath0, so I’ll use it in this example, but you have to replace it when you type these commands with the name of your wireless connection. Note that most or all of these commands require you to be in root, so use sudo or su, or login to root. First startup the connection with ifconfig:

Code:
ifconfig ath0 up

then check for the wireless network you want to connect to:

Code:
iwlist ath0 scan

This displays all of the networks your wireless card can reach. Once you’ve found it on the list, remember its essid. Now to log onto it, type

Code:
iwconfig ath0 essid (network code) key (WEP key, only needed if it's WEP encrypted)

Now startup the connection with

Code:
dhcpcd ath0

If it says that the server is timed or the connection isn’t working type ‘dhcpcd ath0 -kill’ and then retype ‘dhcpcd ath0′ until it works. To double check the connection, you can ping some website that’s always up like google:

Code:
ping google.com

Related Posts

Comments are closed.