[Jan 06] Arch Linux (20171225-1) PINE A64(+) Pinebook A64-LTS/SOPINE | [Jan 04] Linux (0.5.15-136) ROCK64 | [Jan 04] Android (20171204) ROCK64 | [Dec 22] Stretch Mate (0.5.15-136-20171222) ROCK64 | [Dec 21] openHAB 2 (v1.4) PINE A64(+) | [Dec 11] Volumio (2.315) PINE A64(+) A64-LTS/SOPINE | [Dec 11] Armbian (5.35) PINE A64(+) Pinebook A64-LTS/SOPINE | [Dec 8] OpenMediaVault (0.5.15-136) ROCK64

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
  Schematics of Wifi/BT module gamelaster 1 91 01-22-2018, 03:32 AM
Last Post: xalius
  Pine64 doesn't recognize Wifi/BT Module clobeca 3 232 07-13-2017, 08:58 PM
Last Post: MarkHaysHarris777
  Better WiFi/BT module? fonix232 17 1,180 02-13-2017, 04:38 AM
Last Post: xalius
Sad wifi direct bj_jung 2 758 12-29-2016, 10:26 AM
Last Post: happytuna
  Enabling wifi c4tich 10 2,179 12-28-2016, 02:22 PM
Last Post: workaccountbro
  WIFI & Bluetooth? 7777777 14 5,999 12-24-2016, 05:01 AM
Last Post: Toriless
  RF connector on wifi\bt board kb1qzh 1 387 12-15-2016, 06:36 PM
Last Post: tllim
Information Howto: Getting Bluetooth (serial console) working on Debian pfeerick 13 5,009 12-02-2016, 06:01 PM
Last Post: pfeerick
  Wifi module able to share ethernet connection? Connection is unstable! cr2016 12 1,120 10-12-2016, 04:16 AM
Last Post: cr2016
  Losing WiFi Connection on Android Everytime mribunal 4 695 10-10-2016, 06:38 PM
Last Post: mribunal

Forum Jump:


Users browsing this thread: 1 Guest(s)