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
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)
Change the config of hostapd
/etc/hostapd/hostapd.conf
Change the config of dnsmasq
/etc/dnsmasq.conf
Restart dnsmasq to apply the new config
Activate forwarding of IPv4
/etc/sysctl.conf
Apply it without reboot with the following command:
Setup the network configuration
/etc/network/interfaces
And restart the network:
Apply iptables rules
Save the iptables rules
Create the WiFi hotspot
You're done!
Best regards
Julian
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
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
Code:
/etc/init.d/dnsmasq restart
Activate forwarding of IPv4
/etc/sysctl.conf
Code:
Just uncomment the following line:
net.ipv4.ip_forward=1
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
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.
• 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.