https://learn.adafruit.com/setting-up-a ... t/overview for the AP and DHCP server for both WLAN0 connections.
I did not do the updating of the hostapd, but I did remove the WPASupplicant.
and
https://www.reddit.com/r/darknetplan/co ... erry_pi_3/ for the Batman-Adv mesh network on the WLAN1 connections.
I have looked at adding a bridge using this forum post:
viewtopic.php?f=36&t=189645
however, once I have the bridge setup, the DHCP server on the AP section stops handing out IP addresses to the Pixels. The batman mesh still functions though.
Here are the various config files which are identical on each pi (except for IP addresses.)
dhcpd.conf
Code: Select all
# dhcpd.conf
#
# Sample configuration file for ISC dhcpd
#
<snip>
# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
authoritative;
<big snip>
subnet 192.168.42.0 netmask 255.255.255.0 {
range 192.168.42.10 192.168.42.50;
option broadcast-address 192.168.42.255;
option routers 192.168.42.1;
default-lease-time 600;
max-lease-time 7200;
option domain-name "local";
option domain-name-servers 8.8.8.8,8.8.4.4;
}
Code: Select all
interface=wlan0
#driver=rtl1871xdrv
#driver=nl80211
ssid=SkynetWiFi
country_code=US
hw_mode=g
channel=6
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=Raspberry
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
wpa_group_rekey=86400
ieee80211n=1
wme_enabled=1
Code: Select all
# interfaces(5) file used by ifup(8) and ifdown(8)
# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.42.1
netmask 255.255.255.0
Script to start mesh network on wlan1
Code: Select all
echo Starting Batman
sudo modprobe batman-adv
echo Sleeping 5 seconds!!!
sleep 5s
echo Setting wlan down
sudo ip link set wlan1 down
sudo ifconfig wlan1 mtu 1532
sudo iwconfig wlan1 mode ad-hoc
sudo iwconfig wlan1 essid Skynet
sudo iwconfig wlan1 ap any
sudo iwconfig wlan1 channel 11
echo Sleeping for 2 seconds
sleep 2s
echo Setting wlan1 up
sudo ip link set wlan1 up
echo Sleeping for 2 seconds
sleep 2s
sudo batctl if add wlan1
echo Sleeping for 2 seconds
sleep 2s
echo Setting bat0 up
sudo ifconfig bat0 up
echo Sleeping for 5 seconds
sleep 5s
sudo ifconfig bat0 172.27.0.1/16
echo Done!!!
Code: Select all
sudo iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
sudo iptables -A FORWARD -i wlan0 -o bat0 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i bat0 -o wlan0 -j ACCEPT
sudo iptables -t nat -S
sudo iptables -S
So as I test, once the Pi's finish booting, I run the script to start the mesh and once the mesh is up, I run the script to set the iptables.
I have the Pixels both able to connect to each node separately and are pingable by the node (White or Black) that they are connected to.
I have each node able to ping each others Batman ip address
What I am not able to do is to get the AP connected Pixels to be able to ping each other, and I can't figure out what I am doing that is not correct.
Can anyone see what I have done wrong, or what I have missed in order to make this work?
Thanks
Glenn