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.