All you have to do is to open terminal and enter some commands. And Ill publish the steps!
- open terminal and type: sudo lshw | less ; find -netwok section and make sure that driver is ath5k or ath9k. If you made a hotspot with Connectify on Windows7 and it worked, you can skip this step.
- install hostapd and dnsmasq by typing: sudo apt-get install hostapd dnsmasq
- stop those services and prevent them from starting on system start up:
- sudo service hostapd stop
- sudo service dnsmasq stop
- sudo update-rc.d hostapd disable
- sudo update-rc.d dnsmasq disable
- configure dnsmasq:sudo gedit /etc/dnsmasq.conf and add:
- # Bind to only one interface
- bind-interfaces
- # Choose interface for binding
- interface=wlan0
- # Specify range of IP addresses for DHCP leasses
- dhcp-range=192.168.150.2,192.168.150.10
- configure hostapd:sudo gedit /etc/hostapd.conf and add:
- # Define interface
- interface=wlan0
- # Select driver
- driver=nl80211
- # Set access point name
- ssid=myhotspot
- # Set access point harware mode to 802.11g
- hw_mode=g
- # Set WIFI channel (can be easily changed)
- channel=6
- # Enable WPA2 only (1 for WPA, 2 for WPA2, 3 for WPA + WPA2)
- wpa=2
- wpa_passphrase=mypassword
- create a file named start.sh and add the following lines:
- #!/bin/bash
- # Start
- # Configure IP address for WLAN
- sudo ifconfig wlan0 192.168.150.1
- # 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
- start hotspot by starting your script "start.sh"
PS: Im not the author of this tutorial but it helped me and Im sure that it works!
0 comments:
Post a Comment