# cat << EOF >> /etc/wpa_supplicant.conf
> network={
> scan_ssid=1
> ssid="ISIKAN_NAMA_SSIDNYA_DISINI"
> key_mgmt=WPA-PSK
> psk="ISIKAN_PASSWORDNYA_DISINI"
> }
> EOF
Kemudian aktifkan interface wifinya, biasanya di linux menggunakan wlan0 atau eth1.
# ifconfig eth1 up
Jalankan wpa_supplicant sebagai daemon menggunakan konfigurasi tadi.
# wpa_supplicant -B -ieth1 -c/etc/wpa_supplicant.conf
Untuk mendapatkan IP kita bisa menggunakan dhcpcd atau dhclient, disini kita coba menggunakan dhcpcd
# dhcpcd eth1
dhcpcd[6088]: version 5.2.12 starting
dhcpcd[6088]: eth1: broadcasting for a lease
dhcpcd[6088]: eth1: offered 192.168.*.* from 192.168.*.*
dhcpcd[6088]: eth1: ignoring offer of 192.168.*.* from 192.168.*.*
dhcpcd[6088]: eth1: acknowledged 192.168.*.* from 192.168.*.*
dhcpcd[6088]: eth1: checking for 192.168.*.*
dhcpcd[6088]: eth1: leased 192.168.*.* for 86400 seconds
dhcpcd[6088]: forked to background, child pid 6124
Agar internetan lebih cepet, kita bisa setting dns. Biasanya sih saya pake punya google, kita setting nya di /etc/resolv.conf.
# echo -ne "nameserver 8.8.8.8\nnameserver 8.8.4.4" > /etc/resolv.conf
Coba cek koneksinya berhasil apa tidak dengan ping ke url mana saja, contoh saya ping ke google
# ping -c 3 www.google.co.id
PING www.l.google.com (74.125.*.*) 56(84) bytes of data.
64 bytes from sin01s05-in-f18.1e100.net (74.125.*.*): icmp_req=1 ttl=54 time=16.1 ms
64 bytes from sin01s05-in-f18.1e100.net (74.125.*.*): icmp_req=2 ttl=54 time=16.4 ms
64 bytes from sin01s05-in-f18.1e100.net (74.125.*.*): icmp_req=3 ttl=54 time=17.1 ms
--- www.l.google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 16.105/16.539/17.108/0.445 ms
Oh yaa saya sekalian kasih bash scriptnya untuk koneksi manual maupun wpa di linux nih, silahkan di coba sekalian di review :)
Oke selamat mencoba semoga berhasil kawan!
0 comments:
Post a Comment