I followed this guide to try to set up my RPi 3B (Rapian buster) as a wifi bridge.
I performed the "General setup" and then the steps under "Setting up an access point with a bridge".
There's one big difference, I don't want to use eth0
, as this is supposed to be a wifi bridge.
So instead of this in the guide:
RPi
wifi ┌──────bridge──────┐ wired wan
mobile-phone <.~.~.~> │(wlan0) br0 (eth0)│ <-------> router <-----> INTERNET
\ | / DHCP-server
(dhcp (dhcp 192.168.50.1
from router) from router)
I wanted this:
wifi RPi wifi
SSID:Drugdealer-terras ┌──────bridge─────────────────┐ SSID: Drugdealer wan
mobile-phone <.~.~.~.~.~.~.~.~.~.~.~.~> │(wlan0) br0 (wlx00c0ca66080c)│ <.~.~.~.~.~.~.~.~.~> router <-----> INTERNET
\ | / DHCP-server
(dhcp (dhcp / & WDS enabled
from router) from router) 192.168.1.1
wlan0 = the built-in wifi of the RPi
wlx00c0ca66080c = Alfa AWUS036NHA wifi dongle
I left out the ethernet interface for now.
Wifi was working fine with the wifi dongle and built-in wifi before these steps. Current situation is that I don't have internet access on the RPi, so instead of screenshots I unfortunately have to share photos of a screen.
So I followed the steps. I couldn't post them in detail, as stackexchange thought it was spam when I tried to post it. But it is all the steps here, only where it refers to eth0
, I replaced it with wlx00c0ca66080c
.
Since I'm using a wifi dongle instead of eth0
, I still had to tell what it had to connect to, so I created /etc/wpa_supplicant/wpa_supplicant-wlx00c0ca66080c.conf
and put this (the priority line is strictly not needed, but shouldn't harm):
country=BE
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="Drugdealer"
psk="password"
priority=1
}
I removed /etc/wpa_supplicant/wpa_supplicant.conf
and I did this to finish:
rpi ~# chmod 600 /etc/wpa_supplicant/wpa_supplicant-wlx00c0ca66080c.conf
rpi ~# systemctl disable wpa_supplicant.service
rpi ~# systemctl enable wpa_supplicant@wlx00c0ca66080c.service
Reboot.
So what happens after a reboot?
First of all it hangs and eventually fails on systemd-networkd-wait-online.service
:
But after a while I can log in.
sudo systemctl status systemd-networkd-wait-online.service
shows this:
There was a solution given here, so I tried
~$ sudo systemctl edit systemd-networkd-wait-online.service
and then add the slave devices of the bridge
[Service]
ExecStart=
ExecStart=/lib/systemd/systemd-networkd-wait-online --ignore=wlx00c0ca66080c --ignore=wlan0 --quiet
but that didn't seem to help.
However, two things do work: wlx00c0ca66080c
connects to Drugdealer and wlan0
creates an access point Drugdealer-terras.
But br0
doesn't get an ip address, so when connected to Drugdealer-terras I don't get an ip address either.
sudo systemctl status systemd-networkd.service
The error reads: wlx00c0ca66080c: Could not join netdev: Operation not supported
iwconfig
ifconfig
networkctl
EDIT:
I have changed two things:
1. I have made the ethernet interface part of the bridge. The bridge now gets an ip address and at least I can have ssh access if I want. But for the rest of the tests, I have the ethernet disconnected.
2. Several sources (1 | 2) point towards enabling 4addr
for the wifi interface. When I do sudo iw dev wlx00c0ca66080c set 4addr on
and sudo systemctl restart systemd-networkd.service
, I see that wlx00c0ca66080c
becomes part of the bridge:
sudo systemctl status systemd-networkd.service
and sudo bridge link
:
But ifconfig br0
shows no ip address:
4addr
for the wifi interface (link 1 | link 2). When I dosudo iw dev wlx00c0ca66080c set 4addr on
andsudo systemctl restart systemd-networkd.service
, I see that bridging the wifi interface works! But I still don't get an ip address for br0. I would like to hold off using proxy arp for the moment, as I feel I'm very close to a solution. – Nikotine May 01 '20 at 14:304addr
to your question and add the output of this command to it:sudo bridge link
. – Ingo May 01 '20 at 14:42