bahan bahannya :
- Hostapd (bisa di compile pake sbo silakan dapatkan slackbuild nya di slackbuilds.org)
- Sebuah mesin (laptop,netbuk atau apalah itu yang sudah build in wireless adaptor [semua komputer jinjing yang bs wifi-an bs dipake disini]) yang mempunya wireless adaptor. [disini saya menggunakan notbuk saya asus eeepc 1215p dengan slackware-current ]
- Sebuah client (semua mobile device yang mendukung wifi) [disini saya menggunakan 1 buah bb, dan 1 buah hp nokia e63]
interface=wlan0 driver=nl80211 ssid=MyHotspot country_code=ID hw_mode=g channel=1 auth_algs=1 ignore_broadcast_ssid=0 wpa=3 wpa_passphrase=test2011 wpa_pairwise=TKIP rsn_pairwise=CCMP
ssid=MyHotspot : silakan MyHotSpot di isi dengan nama sesuka anda
wpa_passphrase=test2011 : silakan ganti dengan password yang anda ingin kan
# dhcpd.conf # # Configuration file for ISC dhcpd (see 'man dhcpd.conf') # option domain-name-servers 208.67.222.222, 208.67.220.220; default-lease-time 600; max-lease-time 7200; ddns-update-style none; ddns-updates off; subnet 192.168.0.0 netmask 255.255.255.0 { range 192.168.0.200 192.168.0.229; option subnet-mask 255.255.255.0; option broadcast-address 192.168.0.255; option routers 192.168.0.1; }
# nano /etc/rc.d/rc.hotspot
#!/bin/sh # Script to start/stop a hostapd-based access point # edited for slackware distro # Symbols for needed programs IPTABLES=/usr/sbin/iptables IFCONFIG=/sbin/ifconfig DHCPD=/usr/sbin/dhcpd HOSTAPD=/usr/sbin/hostapd # Symbols for internal and external interfaces NET_INT=wlan0 NET_EXT=ppp0 # IP address for the AP INT_ADDR=192.168.0.1 case "$1" in start) echo "Starting AP mode for $NET_INT at address $INT_ADDR" # Disable packet forwarding echo 0 > /proc/sys/net/ipv4/ip_forward # Stop any existing hostapd and dhcpd daemons killall hostapd killall dhcpd #Set up forwarding $IPTABLES -t nat -A POSTROUTING -o $NET_EXT -j MASQUERADE $IPTABLES -A FORWARD -i $NET_EXT -o $NET_INT -m state \ --state RELATED,ESTABLISHED -j ACCEPT $IPTABLES -A FORWARD -i $NET_INT -o $NET_EXT -j ACCEPT # Enable packet forwarding echo 1 > /proc/sys/net/ipv4/ip_forward # Get the internal interface in the right state $IFCONFIG $NET_INT down $IFCONFIG $NET_INT up $IFCONFIG $NET_INT $INT_ADDR # dhcpd needs to have a leases file available - create it if needed if [ ! -f /var/state/dhcp/dhcpd.leases ]; then touch /var/state/dhcp/dhcpd.leases fi # Bring up the DHCP server $DHCPD -cf /etc/dhcpd.conf $NET_INT # Bring up hostapd $HOSTAPD -B -P /var/run/hostapd.pid /etc/hostapd/hostapd.conf ;; stop) echo "Stopping AP mode on $NET_INT" # Stop hostapd and dhcpd daemons kill -INT $(cat /var/run/hostapd.pid) kill -INT $(cat /var/run/dhcpd.pid) ;; *) echo "Usage: $0 {start|stop}" exit 1 ;; esac
#nano /etc/rc.d/rc.local
# Start hotspot service if [ -x /etc/rc.d/rc.hotspot ]; then . /etc/rc.d/rc.hotspot start fi
#chmod +x /etc/rc.d/rc.hotspot
#/etc/rc.d/rc.hotspot start
0 komentar:
Posting Komentar