Wednesday, March 7, 2012

How to Setup Wifi Connection on Archlinux via Terminal

Connect Archlinux Wifi. To setup wifi connection on Archlinux terminal is easy, the latest archlinux isos have included the tools for net install. All you need is pc with USB wifi or laptop with Wifi connection.

Check devices to activate wireless device

Type in terminal
#ip link
Then the available network device details will appear. For wifi, it usually starts with the letter "w", it can be "wlan" or "wlp".
For this example is wlan0

Open Wifi Connection

Open wifi connection, is wifi hotspot without password. For this example the hotspot name is "cidtux".

Preparing wlan to be up.
#ifconfig wlan0 up
wlan0, -> 0 is the first device, if you have 2 wifi card, if you want to use another wifi card just change wlan0 to wlan1

Scanning access point name
Type command like this
#iwlist wlan0 scanning

see on essid, this is access point name (hotspot name).

configure the essid
type command line like this, if your network is hidden you need to know essid name from wifi provider. and the command line same like this.

#iwconfig wlan0 essid essidname

connect wifi using dhcpcd & test ping
type like this
#dhcpcd wlan0
if the report like this, your connection is succesfull. :)


WEP/WPA2 Connection

1. Check your wifi card
On my machines my interface wifi is wlan0(tablet pc r116), eth1 on acer aspire 3680

2. Turn on wifi card
#ifconfig wlan0 up
3. Search wifi essid/hotspot name
#iwlist wlan0 scan
on essid you will find a hotspot name.
4. Setting up Essid and password
#iwconfig wlan0 essid "yourhotspotname" key yourpassword
#iwconfig wlan0 essid "yourhotspotname" key s:asciikey
Follow this simple step below.
#pacman -S wpa_supplicant
#mv /etc/wpa_supplicant.conf /etc/wpa_supplicant.backup
#wpa_passphrase yourhotspotname "passwordwpa2" > /etc/wpa_supplicant.conf
#wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant.conf

If your network hidden do this, if open skip it.
#iwconfig wlan0 essid "yourhotspotname"

5. Start a connection
To Start wifi connection in archlinux, type below

#dhcpcd wlan0

For static IP
#ifconfig wlan0 XXX.XXX.XXX.XXX
#route add default gw XXX.XXX.XXX
#echo "nameserver XXX.XXX.XXX.XXX" /etc/resolv.conf

If succes, at the end will show notification like this.
....forked to background, child pid .....

Share on Facebook
Share on Twitter
Share on Google+