Skip to content
Permalink
Browse files

working AP only mode, no Joustmania yet

  • Loading branch information...
adangert committed May 13, 2019
1 parent 511c908 commit 46d9a5a8973e50fc70683659a4962bc38d544acd
Showing with 54 additions and 19 deletions.
  1. +0 −1 apfiles/dnsmasq.conf
  2. +27 −13 apfiles/interfaces
  3. +14 −1 apfiles/rc.local
  4. +3 −0 apfiles/station
  5. +2 −0 disable_ap.sh
  6. +8 −4 enable_ap.sh
@@ -17,7 +17,6 @@
#dhcp-range=172.24.1.50,172.24.1.150,12h # Assign IP addresses between 172.24.1.50 and 172.24.1.150 with a 12 hour lease time
#address=/joust.mania/172.24.1.1


interface=lo,uap0
no-dhcp-interface=lo,wlan0
bind-interfaces
@@ -3,24 +3,38 @@
# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'


allow-hotplug wlan0
auto wlan0
iface wlan0 inet dhcp
#wcp-conf /etc/wpa_supplicant/wpa_supplicant.conf


# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback
#allow-hotplug wlan0
#iface wlan0 inet dhcp
# pre-up sleep 10
# wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

auto eth0
iface eth0 inet dhcp
#auto lo
#iface lo inet loopback

#auto eth0
#iface eth0 inet dhcp

#Access point for JoustMania
allow-hotplug wlan0
iface wlan0 inet static
address 172.24.1.1
netmask 255.255.255.0
network 172.24.1.0
broadcast 172.24.1.255
#allow-hotplug wlan0
#iface wlan0 inet static
# address 172.24.1.1
# netmask 255.255.255.0
# network 172.24.1.0
# broadcast 172.24.1.255

#this was already commented out
# wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

allow-hotplug wlan1
iface wlan1 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
#allow-hotplug wlan1
#iface wlan1 inet manual
# wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
@@ -19,6 +19,19 @@ fi

#Access point for JoustMania
#iptables-restore < /etc/iptables.ipv4.nat
hostapd /etc/hostapd/hostapd.conf
#hostapd /etc/hostapd/hostapd.conf

sleep 5
#ifdown wlan0

#sleep 2
#rm -f /var/run/wpa_supplicant/wlan0
#ifup wlan0
#iptables -t nat -A POSTROUTING -s 192.168.2.0/24 ! -d 192.168.2.0.0/24 -j MASQUERADE
#hostapd -B /etc/hostapd/hostapd.conf
#dnsmasq

hostapd -B /etc/hostapd/hostapd.conf
dnsmasq

exit 0
@@ -0,0 +1,3 @@
allow-hotplug wlan0
iface wlan0 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
@@ -33,6 +33,8 @@ mv /etc/rc.local.bak /etc/rc.local

rm /etc/network/interfaces.d/ap

rm /etc/network/interfaces.d/station

rm /etc/udev/rules.d/90-wireless.rules

mv /lib/dhcpcd/dhcpcd-hooks/10-wpa_supplicant.bak /lib/dhcpcd/dhcpcd-hooks/10-wpa_supplicant
@@ -18,11 +18,14 @@ apt-get install -y hostapd dnsmasq

cp ./apfiles/ap /etc/network/interfaces.d/ap

#cp ./apfiles/station /etc/network/interfaces.d/station

cp ./apfiles/90-wireless.rules /etc/udev/rules.d/90-wireless.rules

mv /lib/dhcpcd/dhcpcd-hooks/10-wpa_supplicant /lib/dhcpcd/dhcpcd-hooks/10-wpa_supplicant.bak
cp ./apfiles/10-wpa_supplicant /lib/dhcpcd/dhcpcd-hooks/10-wpa_supplicant


mv /etc/dnsmasq.conf /etc/dnsmasq.conf.bak
cp ./apfiles/dnsmasq.conf /etc/dnsmasq.conf

@@ -32,13 +35,14 @@ cp ./apfiles/hostapd.conf /etc/hostapd/hostapd.conf
mv /etc/default/hostapd /etc/default/hostapd.bak
cp ./apfiles/hostapd /etc/default/hostapd


#for testing
#mv /etc/dhcpcd.conf /etc/dhcpcd.conf.bak
#cp ./apfiles/dhcpcd.conf /etc/dhcpcd.conf
#chown :pi /etc/dhcpcd.conf

#mv /etc/network/interfaces /etc/network/interfaces.bak
#cp ./apfiles/interfaces /etc/network/interfaces
mv /etc/network/interfaces /etc/network/interfaces.bak
cp ./apfiles/interfaces /etc/network/interfaces

#sudo service dhcpcd restart
#ifdown wlan0; ifup wlan0
@@ -58,8 +62,8 @@ cp ./apfiles/hostapd /etc/default/hostapd
#iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT
#sh -c "iptables-save > /etc/iptables.ipv4.nat"

#mv /etc/rc.local /etc/rc.local.bak
#cp ./apfiles/rc.local /etc/rc.local
mv /etc/rc.local /etc/rc.local.bak
cp ./apfiles/rc.local /etc/rc.local

#update-rc.d hostapd enable
#update-rc.d dnsmasq enable

0 comments on commit 46d9a5a

Please sign in to comment.
You can’t perform that action at this time.