I´ve set up 1x 4b with 4x zero 2w´s with the 2022-04-04-2-bullseye-ClusterCTRL-arm64-lite-CNAT.zip image and the corresponding client images. And since the usb-connection isn´t that fast, i´ve decided to try to split the network traffic over wifi. So far what i´ve done/achieved:
For the controler i´ve done:
#i´ve scp´ed my ssh key to /root/.shh/isd_ra
sudo apt install dnsmasq hostapd iptables pssh
#configuring dhcpcd
sudo nano /etc/dhcpcd.conf
>interface wlan0
>nohook wpa_supplicant
sudo systemctl restart dhcpcd
#configuring dnsmasq
sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf_backup
sudo nano /etc/dnsmasq.conf
>interface=wlan0
>no-dhcp-interface=eth0
>dhcp-range=192.168.179.10,192.168.179.50,255.255.255.0,24h
>dhcp-option=option:dns-server,192.168.179.1
sudo systemctl restart dnsmasq
sudo systemctl enable dnsmasq
#configuring hostapd
sudo nano /etc/hostapd/hostapd.conf
>interface=wlan0
>ssid=<ssid>
>router
channel=1
>hw_mode=g
>ieee80211n=1
>ieee80211d=1
>country_code=<wifi-country-code>
>wmm_enabled=1
>auth_algs=1
>wpa=2
>wpa_key_mgmt=WPA-PSK
>rsn_pairwise=CCMP
>wpa_passphrase=<wifi-key>
>ignore_broadcast_ssid=1
sudo nano /etc/default/hostapd
>RUN_DAEMON=yes
>DAEMON_CONF="/etc/hostapd/hostapd.conf"
sudo systemctl unmask hostapd
sudo systemctl start hostapd
sudo systemctl enable hostapd
#configuring pssh
sudo nano /etc/root/.config/pssh-hosts
>p1
>p2
>p3
>p4
sudo nano /root/.bash_aliases
>alias pssh='parallel-ssh -i -h ~/.config/pssh-hosts -t 0' $1
sudo nano /root/.bashrc
>if [ -f ~/.bash_aliases ]; then
>. ~/.bash_aliases
>fi
sudo nano /etc/hosts
>172.19.181.1 p1
>172.19.181.2 p2
>172.19.181.3 p3
>172.19.181.4 p4
#configuring iptables for nating the wlan0
For the client´s i´ve just customized the image with the rpi-imager tool...
hostname: p1-4
ssh: activate with public key
add user: <user> + <password>
wifi: <ssid> + hidden ssid + <wifi-key> + <country>
timezone: <timezone>
After flashing the images to micro-sd cards and inserting them, powereing the clients with "sudo clusterctrl on" and waiting for the clients to resize the file-system and boot up
root@cluster:~# pssh uptime
[1] 10:09:11 [SUCCESS] p4
10:09:11 up 6 min, 0 users, load average: 0.00, 0.07, 0.04
[2] 10:09:11 [SUCCESS] p1
10:09:11 up 6 min, 0 users, load average: 0.00, 0.05, 0.03
[3] 10:09:11 [SUCCESS] p2
10:09:11 up 6 min, 0 users, load average: 0.00, 0.08, 0.06
[4] 10:09:11 [SUCCESS] p3
10:09:11 up 6 min, 0 users, load average: 0.08, 0.07, 0.04
So far so good, the clients are running, getting an usb-ip and an wifi ip and access the internet via nat-ing on the controler... Now my question: to make the 4x zero 2w´s use the wifi gateway to communicate with everything except the usb-subnet (
172.19.181.0/24) i just have to delete the usb0 gateway from the clients?
root@p1:~# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 172.19.181.254 0.0.0.0 UG 203 0 0 usb0
0.0.0.0 192.168.179.1 0.0.0.0 UG 302 0 0 wlan0
172.19.181.0 0.0.0.0 255.255.255.0 U 203 0 0 usb0
192.168.179.0 0.0.0.0 255.255.255.0 U 302 0 0 wlan0