3

I had successfully set up my raspberry pi as an access point as WiFi repeater followed this guide: Access point as WiFi router/repeater, optional with a bridge.

I would like to set up my raspberry pi to broadcast multiple WiFi/SSIDs like how a router can have two or more WiFi to connect to.

I wonder if I could build this with on-chip built-in RPi4 or with additional WiFi dongle(s).

If it’s possible with an only built-in chip of RPi4, how to set it up?

If it’s need additional WiFi-dongle(s), how to set it up?

Thank you.

2

An access point is defined by its ssid. If you want to have more than one ssid then you have to create additional access points, one for each ssid. The built-in WiFi device of a Raspberry Pi can only spawn one access point. You can verify it with:

rpi ~$ iw phy0 info
--- snip ---
valid interface combinations:
         * #{ managed } <= 1, #{ P2P-device } <= 1, #{ P2P-client, P2P-GO } <= 1,
           total <= 3, #channels <= 2
         * #{ managed } <= 1, #{ AP } <= 1, #{ P2P-client } <= 1, #{ P2P-device } <= 1,
           total <= 4, #channels <= 1

Here you find in the second combination #{ AP } <= 1, that means: number of access points less or equal one. So you have to add an USB/WiFi dongle for each additional ssid. Because you used systemd-networkd following the setup Access point as WiFi router/repeater, optional with a bridge it is not a big issue to add an access point. Just plug in a compatible USB/WiFi dongle and you will find an interface wlan1. Using the example in the setup then configure it.

To setup wpa_supplicant for the additional access point using wlan1 create these files with your settings:

rpi ~$ sudo -Es
rpi ~# cat > /etc/wpa_supplicant/wpa_supplicant-wlan1.conf <<EOF
country=DE
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
    ssid="RPiNet2"
    mode=2
    frequency=2412
    key_mgmt=WPA-PSK
    proto=RSN WPA
    psk="verySecretPassword"
}
EOF

rpi ~# chmod 600 /etc/wpa_supplicant/wpa_supplicant-wlan1.conf
rpi ~# systemctl disable wpa_supplicant.service
rpi ~# systemctl enable wpa_supplicant@wlan1.service

rpi ~# cat > 16-wlan1.network <<EOF
[Match]
Name=wlan1
[Network]
Address=192.168.5.1/24
DHCPServer=yes
[DHCPServer]
DNS=84.200.69.80 1.1.1.1
EOF

rpi ~# systemctl start wpa_supplicant@wlan1.service
rpi ~# systemctl daemon-reload
rpi ~# systemctl restart systemd-networkd.service

Now you should find a second ssid RPiNet2 on the air.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.