OpenMediaVault (PINE A64(+)) 4.13.10 [Nov 21] | OpenMediaVault (A64-LTS / SOPINE) 4.13.10 [Nov 21] | Q4OS (PINE A64(+)) 2.4-r1 [Nov 10] | Volumio (ROCK64) 2.299 [Oct 30] | Q4OS (Pinebook) 2.4-r1 [Oct 30] | DietPi (ROCK64) v156 [Oct 24] | Armbian - Xenial Desktop (Pinebook) 5.34 [Oct 24] | motionEyeOS (PINE A64(+)) 20171003 [Oct 23] | Android Images (ROCK64) 20171012 [Oct 23]

Getting Started | Visit the WIKI | IRC Logs | Forum Rules/Policy


Create a WiFi hotspot on Debian 8
#1
Hello together!

I tried something to create a WiFi hotspot with officially WiFi/bluetooth module by pine64 via ethernet and this is my solution.
Feel free to discuss about this topic Smile

Note: The WiFi hotspot is using the internet connection via ethernet. I wasn't able to bridge the internet connection from wlan0 to wlan1!
Note 2: I haven't installed NetworkManager on my system. NetworkManager can be responsible for problems with these instructions.



Install hostapd (create a hotspot), dnsmasq (dhcp server) and iptables-persistent (firewall settings)
Code:
apt-get install hostapd dnsmasq iptables-persistent



Change the config of hostapd
/etc/hostapd/hostapd.conf
Code:
interface=wlan0
driver=nl80211
ssid=MyPrivateHotspot
hw_mode=g
channel=6
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=3
wpa_passphrase=MyVeryStrongPassword
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP



Change the config of dnsmasq
/etc/dnsmasq.conf
Code:
no-resolv
interface=wlan0
dhcp-range=10.0.0.3,10.0.0.20,12h
server=8.8.8.8
server=8.8.4.4
Restart dnsmasq to apply the new config
Code:
/etc/init.d/dnsmasq restart



Activate forwarding of IPv4
/etc/sysctl.conf
Code:
Just uncomment the following line:
net.ipv4.ip_forward=1
Apply it without reboot with the following command:
Code:
sysctl -w net.ipv4.ip_forward=1



Setup the network configuration
/etc/network/interfaces
Code:
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp
        pre-up iptables-restore < /etc/network/iptables.rules

iface wlan1 inet manual

auto wlan0
iface wlan0 inet static
        address 10.0.0.1
        broadcast 10.0.0.255
        netmask 255.255.255.0
And restart the network:
Code:
/etc/init.d/networking restart



Apply iptables rules
Code:
iptables -A FORWARD -o eth0 -i wlan0 -s 10.0.0.1/24 -m conntrack --ctstate NEW -j ACCEPT
iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE 



Save the iptables rules
Code:
iptables-save > /etc/network/iptables.rules



Create the WiFi hotspot
Code:
hostapd /etc/hostapd/hostapd.conf



You're done!


Best regards
Julian
My forum topics:
• Create a WiFi hotspot on Debian 8
• Turn your Pine64 into a music server with mpd
• Adjust brightness of LCD on Armbian Desktop with 1 click
• My cases for Pine64 (acryl, lego & wood)

• Pine 64 - DACH - Facebook page for german-speaking Pine64-fans.
Reply
#2
One of the Best WiFi Hotspot Software which I know are
  1. HostedNetworkStarter
  2. MaryFi
  3. My WiFi Router
  4. MyPublicWiFi
  5. 160WiFi
source:-[url= http://merabheja.com/best-free-wifi-hots...r-windows/] http://merabheja.com/best-free-wifi-hots...r-windows/[/url]
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Pine64 doesn't recognize Wifi/BT Module clobeca 3 166 07-13-2017, 08:58 PM
Last Post: MarkHaysHarris777
  Better WiFi/BT module? fonix232 17 1,103 02-13-2017, 04:38 AM
Last Post: xalius
Sad wifi direct bj_jung 2 719 12-29-2016, 10:26 AM
Last Post: happytuna
  Enabling wifi c4tich 10 1,964 12-28-2016, 02:22 PM
Last Post: workaccountbro
  WIFI & Bluetooth? 7777777 14 5,774 12-24-2016, 05:01 AM
Last Post: Toriless
  RF connector on wifi\bt board kb1qzh 1 354 12-15-2016, 06:36 PM
Last Post: tllim
Information Howto: Getting Bluetooth (serial console) working on Debian pfeerick 13 4,288 12-02-2016, 06:01 PM
Last Post: pfeerick
  Wifi module able to share ethernet connection? Connection is unstable! cr2016 12 1,076 10-12-2016, 04:16 AM
Last Post: cr2016
  Losing WiFi Connection on Android Everytime mribunal 4 663 10-10-2016, 06:38 PM
Last Post: mribunal
  Unable to activate wifi on Linux smouton 5 1,511 09-17-2016, 10:35 PM
Last Post: MarkHaysHarris777

Forum Jump:


Users browsing this thread: 1 Guest(s)