luni, 13 martie 2017

Wireless network on slackware

"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
1
2
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
1
ifconfig -a
You will get something like this
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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!
1
ifconfig wlan0 up
2- You can use this if you’re not sure what’s your network name “ESSID”
1
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,
1
su - c wpa_passphrase YourESSID Password #Replace them with your ESSID and password
You will get something like:
1
2
3
4
5
6
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
1
/etc/wpa_supplicant.conf
There you’ll find something like this
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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
1
chmod 600 /etc/wpa_supplicant.conf
6- Open this file with your favorite text editor
1
/etc/rc.d/rc.inet1.conf
And add those lines
1
2
3
4
5
6
7
8
# 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 😀
1
/etc/rc.d/rc.inet1 wlan0_restart
congratulations your PC should be connected now 🙂
Resources :
/usr/doc/wpa_supplicant-0.6.10/README.slackware"