Raspbian: RPi3 Stand Alone Access Point

From OnnoWiki
Jump to: navigation, search

Sumber: https://www.raspberrypi.org/documentation/configuration/wireless/access-point.md

Membuat RaspberryPi 3 menjadi stand alone access point WiFi.

Instalasi

Instalasi

sudo su
apt-get update
apt-get upgrade
apt-get install dnsmasq hostapd

Karena belum siap, di stop / off dulu

sudo systemctl stop dnsmasq
sudo systemctl stop hostapd

Reboot untuk meng-update kernel

sudo reboot

IP Statik

Edit

sudo vi /etc/dhcpcd.conf

Tambahkan di akhir file

interface wlan0
    static ip_address=192.168.4.10/24
    nohook wpa_supplicant
interface eth0
    static ip_address=192.168.0.1/24

Restart

sudo service dhcpcd restart

Konfigurasi DHCP Server (dnsmasq)

Lakukan

sudo su
mv /etc/dnsmasq.conf /etc/dnsmasq.conf.orig  
vi /etc/dnsmasq.conf

Tambahkan

address=/darmjaya.ac.id/192.168.4.10
address=/darmjaya.ac.id/192.168.0.1
address=/www.darmjaya.ac.id/192.168.4.10
address=/www.darmjaya.ac.id/192.168.0.1
server=/localnet/192.168.0.1
server=/localnet/192.168.4.10
server=/168.192.in-addr.arpa/192.168.0.1
server=/168.192.in-addr.arpa/192.168.4.10

interface=wlan0      # Use the require wireless interface - usually wlan0
  dhcp-range=192.168.4.100,192.168.4.120,255.255.255.0,24h

interface=eth0      # ethernet eth0
  dhcp-range=192.168.0.60,192.168.0.70,255.255.255.0,24h

Konfigurasi Access Point (hostap)

Edit

sudo su
vi /etc/hostapd/hostapd.conf

Asumsi

Nama WiFi SekolahWiFi
Password  123456789
Pilihan Band hw_mode=g s/d hw_mode=a, pilihan-nya
a = IEEE 802.11a (5 GHz)
b = IEEE 802.11b (2.4 GHz)
g = IEEE 802.11g (2.4 GHz)
ad = IEEE 802.11ad (60 GHz).

Contoh isi /etc/hostapd/hostapd.conf

interface=wlan0
driver=nl80211
ssid=SekolahWiFi
hw_mode=g
channel=7
wmm_enabled=0
macaddr_acl=0
# auth_algs=1
# ignore_broadcast_ssid=0
# wpa=2
# wpa_passphrase=123456789
# wpa_key_mgmt=WPA-PSK
# wpa_pairwise=TKIP
# rsn_pairwise=CCMP 

Edit

sudo vi /etc/default/hostapd

Pastikan

DAEMON_CONF="/etc/hostapd/hostapd.conf"

Restart

sudo systemctl start hostapd
sudo systemctl start dnsmasq

Reboot

sudo reboot

Referensi


Pranala Menarik