File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ ethdev=$1
3+
4+ if ! iptables-save | grep MASQUERADE | grep eth0 | grep -q MASQUERADE; then
5+ echo " Masquerade missing, adding 🎭"
6+ iptables -t nat -A POSTROUTING -o " ${ethdev} " -j MASQUERADE
7+ fi
Original file line number Diff line number Diff line change @@ -59,6 +59,8 @@ createAdHocNetwork()
5959 fi
6060 systemctl start dnsmasq
6161 systemctl start hostapd
62+ # We need dhcpcd in host mode for ipv6
63+ systemctl restart dhcpcd
6264 echo 1 > /proc/sys/net/ipv4/ip_forward
6365 echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
6466}
@@ -209,6 +211,9 @@ else #ssid or MAC address not in range
209211 if systemctl status hostapd | grep " (running)" > /dev/null 2>&1
210212 then
211213 echo " Hostspot already active"
214+ # Extra tools to handle hotspot not working
215+ add_masquerade " ${ethdev} "
216+ make_sure_master " ${wifidev} "
212217 elif { wpa_cli status | grep " $wifidev " ; } > /dev/null 2>&1
213218 then
214219 echo " Cleaning wifi files and Activating Hotspot"
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ wifidev=$1
3+
4+ if ! iw wlan0 info | grep type | grep -q AP; then
5+ echo " Access point missing, adding 📶"
6+ systemctl restart hostapd.service
7+ fi
Original file line number Diff line number Diff line change @@ -46,6 +46,8 @@ interface eth0
4646 ia_pd 2 wlan0/1/64 # request prefixes for VLANs
4747" >> /etc/dhcpcd.conf
4848
49+ sed -i ' s/clientid/# clientid/g' /etc/dhcpcd.conf
50+
4951echo "
5052# Auto-hotspot Config
5153# Interface to use
You can’t perform that action at this time.
0 commit comments