Dah berhasil rpi AP, kenapa ya minggu lalu gagal, padahal ikutin tutorial yang sama. pic.twitter.com/mEUBrWKSEh
— Faris Widyantho (@radenfaris) March 21, 2015
Intro::
Raspberry Pi sebagai Router Access Point.
Steps::
- sudo apt-get install hostapd udhcpd *installasi hostapd dan udhcpd
- sudo nano /etc/udhcpd.conf *update konfigurasi udhcpd
rubah DHCP enable jadi YES
- sudo nano /etc/udhcpd.conf *update konfigurasi udhcpd
start 192.168.48.2- sudo nano /etc/default/udhcpd *update konfigurasi default udhcpd
end 192.168.42.20
interface wlan0
remaining yes
opt dns 8.8.8.8 4.2.2.2
opt subnet 255.255.255.0
opt router 192.168.48.1 #set Rpi IP address
opt lease 864000 # 10 day DHCP lease time in seconds.
rubah DHCP enable jadi YES
DHCPD_ENABLED="no" --> DHCPD_ENABLED="yes"- sudo nano /etc/network/interfaces *update konfigurasi wlan0
allow-hotplug wlan0dan comment section ini
auto wlan0
iface wlan0 inet static
address 192.168.48.1
netmask 255.255.255.0
#wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
#iface default inet manual
- sudo nano /etc/hostapd/hostapd.conf *konfigurasi nama SSID, password AP
dengan password WPA2
interface=wlan0open network *not tested
driver=nl80211
ssid=r48pi
hw_mode=g
channel=11
wpa=2
wpa_passphrase=p48sword
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
wpa_ptk_rekey=600
macaddr_acl=0
interface=wlan0- sudo nano /etc/default/hostapd *update konfigurasi hostapd
driver=nl80211
ssid=r48pi
channel=11
hw_mode=g
channel=6
auth_algs=1
wmm_enabled=0
DAEMON_CONF="" --> DAEMON_CONF="/etc/hostapd/hostapd.conf"- sudo nano /etc/sysctl.conf *update konfigurasi NAT
tambahkan line
net.ipv4.ip_forward=1- sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
- sudo iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT *forward eth0 -> wlan0
- sudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT *run
- sudo sh -c "iptables-save > /etc/iptables.ipv4.nat" *save iptables change
- sudo nano /etc/network/interfaces *update konfigurasi interface
tambahkan line
up iptables-restore < /etc/iptables.ipv4.nat
- sudo service hostapd start *run hostapd
- sudo service udhcpd start *run udhcpd
- sudo update-rc.d hostapd enable *run hostapd at boot
- sudo update-rc.d udhcpd enable *run hostapd at boot
- enjoy
No comments:
Post a Comment