Connecting Slackware to WPA2/PSK wireless network

A friend asked me to help him connecting his Slackware PC to wireless connection,
So i gave him this tutorial i wrote 3+ years ago in Arabic when i faced the same problem that took  good two days of reading documentations.

Anyway I think it would be useful to translate it in English so it could help more people

- The obvious and easiest way to get your Slacware PC connected to a wireless network is using WICD, Unfortunately for some reasons this wasn’t possible for me.

So here is how to make a native wireless connection

- I’ll assume you have a running WPA2/PSK encrypted wireless network you want to log in

1- Know your hardware

lspci | grep 'Network controller'
03:00.0 Network controller: Intel Corporation Wireless WiFi Link 5100

Fortunately its supported by the kernel, i need no patches or drivers

2- Know your cards name

ifconfig -a

You will get something like this


eth0      Link encap:Ethernet  HWaddr 00:1e:33:81:5a:fc


UP BROADCAST MULTICAST  MTU:1500  Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
Interrupt:28 Base address:0x4000

lo        Link encap:Local Loopback
inet addr:127.0.0.1  Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING  MTU:16436  Metric:1
RX packets:48 errors:0 dropped:0 overruns:0 frame:0
TX packets:48 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2560 (2.5 KiB)  TX bytes:2560 (2.5 KiB)

wlan0     Link encap:Ethernet  HWaddr 00:21:6b:3e:27:5c
inet addr:192.168.1.166  Bcast:192.168.1.255  Mask:255.255.255.0
inet6 addr: fe80::221:6bff:fe3e:275c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
RX packets:6245 errors:0 dropped:0 overruns:0 frame:0
TX packets:5587 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4484716 (4.2 MiB)  TX bytes:1016291 (992.4 KiB)

So it’s wlan0… lets wake it up!

ifconfig wlan0 up

2- You can use this if you’re not sure what’s your network name “ESSID”

iwlist wlan0 scan

If you didn’t get any output – make sure your network is setup properly or the more disturbing, search for your hardware driver… God help you.

3- Assuming everything went fine,

su - c wpa_passphrase YourESSID Password #Replace them with your ESSID and password

You will get something like:

root@ahmed:~# wpa_passphrase YOURESSID password
network={
ssid="YOURESSID"
#psk="password"
psk=9662ef151ea49312e467ff7b9220f4a7204d618aca903d5a86383dd9e1ca0dea
}

4- copy those lines, and open this file with your favorite text editor

/etc/wpa_supplicant.conf

There you’ll find something like this

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
eapol_version=1
ap_scan=1
fast_reauth=1

network={
scan_ssid=0
ssid="your_essid"
proto=WPA RSN
key_mgmt=WPA-PSK WPA-EAP
pairwise=CCMP TKIP
group=CCMP TKIP
psk=your_64_hex_characters_long_key
}

change ssid value with your networks’ name, psk with psk value from the output you copied, And proto with WPA2

5- Change file privileges

chmod 600 /etc/wpa_supplicant.conf

6- Open this file with your favorite text editor


/etc/rc.d/rc.inet1.conf

And add those lines

# Config information for wlan0 (using dhcp):
IFNAME[1]="wlan0"
IPADDR[1]=""
NETMASK[1]=""
USE_DHCP[1]="yes"
DHCP_HOSTNAME[1]="My_ESSID" #Change it with your networks' name
WLAN_WPA[1]="wpa_supplicant"
WLAN_WPADRIVER[1]="wext"

And add your networks’ values if you are not using DHCP.

- save the file, We are almost there :D

/etc/rc.d/rc.inet1 wlan0_restart

congratulations your PC should be connected now :)

Resources :

/usr/doc/wpa_supplicant-0.6.10/README.slackware

Configuring your network in Slackware

Slackware Linux Essentials – Network Configuration

 

6 thoughts on “Connecting Slackware to WPA2/PSK wireless network

  1. You sir, are the man!
    I had to change all the [1] to [4] and move the block down the file (/etc/rc.d/rc.inet1.conf) below number 3. Before this I was getting “error set nickname (8B1C)”
    Thank you very much

  2. ) Find someone that is already confident in that area and copy them.

    Workplaces block Facebook and You – Tube access for
    some users. Torrent files are unique in that the file itself contains no data
    of the actual file you need to download.

  3. Wow. Thanks for this! Been trying for, literally, years to get wireless working on Slackware using the config files only. Latest versions of Slackware have the netconfig option of “NetworkManager” but I don’t like that because the network connection is made at login not at bootup. After finding and installing the driver I got this working on Slackware 12.1. Thanks again.

  4. Directions still work fine for Slackware 14.0 except in one small detail: the essid now goes in WLAN_ESSID variable instead of DHCP_HOSTNAME. I found that I connected either way, but couldn’t resolve my hostname in DNS untill I set the essid in WLAN_ESSID and set DHCP_HOSTNAME to a blank string: “”. That way rc.inet1 uses the hostname from the machine when connecting and DNS gets updated. MANY THANKS for this tutorial! I was moving a small server and needed to switch over to wi-fi. Your guide made it easy to do!

  5. I’ve been searching for a nice step-by-step HOWTO on this topic for days. I appreciate that you don’t get ‘into the weeds’ and just state what must be done in a clear concise manner. After several missteps, I followed your instructions (and like Duane, I figured that DHCP_HOSTNAME must have been the ‘old’ way of doing it as it just made more sense to use WLAN_ESSID)

    At any rate, again, I thank you for your efforts!

Discuss

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s