Cara Membuat Hotspot di Linux Deepin (Debian)

1. Open terminal and type:
sudo apt-get install hostapd dnsmasq
sudo service hostapd stop
sudo service dnsmasq stop
sudo update-rc.d hostapd disable
sudo update-rc.d dnsmasq disable
3. You need edit dnsmasq.conf
sudo gedit /etc/dnsmasq.conf
Then add following content to the end of dnsmasq.conf
# Bind to only one interface
# Choose interface for binding
# Specify range of IP addresses for DHCP leasses
4. Edit hostapd.conf
sudo gedit /etc/hostapd.conf
Add following content to hostapd.conf
# Define interface
# Select driver
# Set access point name
# Set access point harware mode to 802.11g
# Set WIFI channel (can be easily changed)
# Enable WPA2 only (1 for WPA, 2 for WPA2, 3 for WPA + WPA2)
Note that: you have set a hotspot called myhotspot(seeline 6: ssid=myhotspot), the password is yourpassword(see line 13: wpa_passphrase=yourpassword), you can change the password to any string you want.

5. Create a script in you home directory, take for example:
copy followingcontent into it:
# Start
# Configure IP address for WLAN
sudo ifconfig wlan0
# Start DHCP/DNS server
sudo service dnsmasq restart
# Enable routing
sudo sysctl net.ipv4.ip_forward=1
# Enable NAT
sudo iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
# Run access point daemon
sudo hostapd /etc/hostapd.conf
# Stop
# Disable NAT
sudo iptables -D POSTROUTING -t nat -o ppp0 -j MASQUERADE
# Disable routing
sudo sysctl net.ipv4.ip_forward=0
# Disable DHCP/DNS server
sudo service dnsmasq stop
sudo service hostapd stop
6.Save it and open a terminal:
sudo ./
The output maybe like this:

* Restarting DNS forwarder and DHCP server dnsmasq                      [ OK ]
/etc/resolvconf/update.d/libc: Warning: /etc/resolv.conf is not a symbolic link to /run/resolvconf/resolv.conf
net.ipv4.ip_forward = 1
Configuration file: /etc/hostapd.conf
Failed to update rate sets in kernel module
Using interface wlan0 with hwaddr xxxxxxxxx and ssid 'myhotspot'


Posting Komentar

0 Komentar