1

So this is a little bit of a random question but I'm attempting to follow this tutorial to set up a wifi repeater with my Raspberry Pi 3B+.

I can get the Raspberry Pi to generate a network that can accept connections.

The problem I run into is getting the client connection to successfully connect to the original network due to the fact that the original network is configured using WPA2-Enterprise.

I can get the Raspberry Pi to connect to the WPA2-Enterprise network by doing the following:

Editing /etc/wpa_supplicant/wpa_supplicant.conf with:

country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
      ssid="MainNetworkSSID"
      scan_ssid=1
      key_mgmt=WPA-EAP
      pairwise=CCMP TKIP
      group=CCMP TKIP
      eap=PEAP
      identity="MyUsername"
      password="MyPassword"
      phase1="peapver=0"
      phase2="MSCHAPV2"
}

And editing /etc/network/interfaces with:

auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0

iface wlan0 inet dhcp
        pre-up wpa_supplicant -B -Dwext -i wlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf
        post-down killall -q wpa_supplicant

But when I go to set up the repeater it wont connect to the original network. I tried using the edits I made to wpa_supplicant.conf in wpa_supplicant-wlan0.conf but this didn't seem to help. The Enterprise network does not require any certificates to join so I think it should be possible in theory, but I may be wrong. Any help with this would be greatly appreciated!

DailyRPG
  • 21
  • 5

2 Answers2

1

Unfortunately, I still could not get systemd-networkd to connect to the main network no matter the driver that was being used. I did find another solution entirely, however, that seems to have worked. I installed this modified ubuntu-mate image that supports the 3B+ and then used the built-in hotspot function on ubuntu to generate the access point. Ubuntu-mate image: https://downloads.ubiquityrobotics.com/pi.html

DailyRPG
  • 21
  • 5
0

I haven't tested a WPA2-Enterprise connection because I haven't one but for my understanding it should make no difference to build a wifi repeater as far as you can establish the connection. So I suggest first to configure and test the connection with systemd-networkd. When it is running then you can do the next steps to combine it with the access point.

Because we use systemd-networkd we have to do all with it. Networking and dhcpcd is completely switched off. This is done with Step 1: setup systemd-networkd but without installing hostapd at this step:

rpi ~$ sudo -Es
# enable persistent journaling, useful for troubleshooting
rpi ~# mkdir -p /var/log/journal
rpi ~# systemd-tmpfiles --create --prefix /var/log/journal #ignore warnings (*)

# disable debian networking and dhcpcd
rpi ~# systemctl mask networking.service
rpi ~# systemctl mask dhcpcd.service
rpi ~# sudo mv /etc/network/interfaces /etc/network/interfaces~
rpi ~# sed -i '1i resolvconf=NO' /etc/resolvconf.conf

# enable systemd-networkd
rpi ~# systemctl enable systemd-networkd.service
rpi ~# systemctl enable systemd-resolved.service
rpi ~# ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf

(*) You will get one or two confusing warnings "...Cannot set file attribute..." This are not errors and doesn't matter in this case.

Then setup wpa_supplicant for client connection with:

rpi ~# cat >/etc/wpa_supplicant/wpa_supplicant-wlan0.conf <<EOF
country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
    ssid="MainNetworkSSID"
    scan_ssid=1
    key_mgmt=WPA-EAP
    pairwise=CCMP TKIP
    group=CCMP TKIP
    eap=PEAP
    identity="MyUsername"
    password="MyPassword"
    phase1="peapver=0"
    phase2="MSCHAPV2"
}
EOF

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

This will setup wpa_supplicant the same way you have done with Debian networking. The pre-up you have done in /etc/network/interfaces you will find at line ExecStart= with:

rpi ~# systemctl cat wpa_supplicant@wlan0.service

Your post-down is managed by systemd automagically. To compare:

pre-up wpa_supplicant -B -Dwext -i wlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf

ExecStart=/sbin/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant-%I.conf -Dnl80211,wext -i%I

%I is expanded to wlan0. Don't use option -B in ExecStart= because the service is already running in the background. Recommended driver is nl80211 so it is set at the first position with option -Dnl80211,wext so I would try it first. If you really need only the old driver wext then you can set -Dwext with:

rpi ~# systemctl --full edit wpa_supplicant@wlan0.service

Now we have to setup the interface wlan0:

rpi ~# cat > /etc/systemd/network/08-wlan0.network <<EOF
[Match]
Name=wlan0
[Network]
# If you need a static ip address toggle commenting next three lines (example)
DHCP=yes
#Address=192.168.10.60/24
#Gateway=192.168.10.1
# Optional: if you want to connect to your own DNS server, set it here (example)
#DNS=192.168.10.10 8.8.8.8
EOF

Now reboot and you should have a wifi client connection. If not then you have first to fix it before going on to configure the access point and combine it with the client connection.

Ingo
  • 40,606
  • 15
  • 76
  • 189
  • Thanks for the reply! Unfortunately, I still could not get systemd-networkd to connect to the main network no matter the driver that was being used. I did find another solution entirely, however, that seems to have worked. I installed this modified ubuntu-mate image that supports the 3B+ and then used the built-in hotspot function on ubuntu to generate the access point. Ubuntu-mate image: [link](https://downloads.ubiquityrobotics.com/pi.html) – DailyRPG Jan 23 '19 at 16:15
  • @DailyRPG Please make an answer to your solution. Only accecpting an answer with a click on the tick on its left side will finish the question and it will not pop up again year for year. – Ingo Mar 03 '20 at 13:19