Since the Raspberry Pi has 2 built in network devices we can customize the Pi to act as a Bridge. A network bridge's basic purpose is to connect two disparate LAN's . In this case using the Pi as a wireless adapter for a non wireless PC or other non wireless device.
Raspberry Pi WiFi to Ethernet Bridge
The Raspberry Pi still uses `wpa_supplicant` for Wi-Fi configuration, even in newer versions of Raspberry Pi OS (including Bookworm). The confusion may stem from changes in how network management is handled, but `wpa_supplicant` remains essential for connecting to Wi-Fi networks.
To create a bridge between the Wi-Fi adapter (`wlan0`) and the Ethernet interface (`eth0`) using **NetworkManager** (the default in Raspberry Pi OS Bookworm), follow these steps:
Step 1: Ensure NetworkManager is installed and active
sudo apt update
sudo apt install network-manager -y
(if you get a msg that network-manager is the most current you can skip the next 2 lines)
sudo systemctl enable NetworkManager
sudo systemctl restart NetworkManager
Step 2: Identify your Ethernet interface name
ip link show
Look for the Ethernet interface (usually `eth0` or `enx...`)
Step 3: Create a bridge interface
sudo nmcli con add type bridge con-name bridge0 ifname br0
Step 4: Add the Ethernet interface to the bridge
Replace `eth0` with your actual Ethernet interface name:
sudo nmcli con add type bridge-slave ifname eth0 master br0
Step 5: Configure the Wi-Fi interface as a bridge slave
This step requires creating a Wi-Fi access point (AP) mode connection and adding it to the bridge:
sudo nmcli con add type wifi con-name wifi-bridge ifname wlan0 ssid "YourNetworkName" \
wifi-sec.key-mgmt wpa-psk wifi-sec.psk "YourPassword" \
wifi.mode ap
Then, add the Wi-Fi connection to the bridge:
sudo nmcli con modify wifi-bridge master br0
Step 6: Enable the bridge and activate connections
sudo nmcli con up bridge0
sudo nmcli con up wifi-bridge
Step 7: Verify the bridge is active
nmcli con show --active
You should see `bridge0`, `wifi-bridge`, and `eth0` (as a slave) listed.
Notes:
- IP Assignment: In bridged mode, devices connected to `eth0` will receive IP addresses from your main network (via DHCP), not from the Pi.
- Wi-Fi Security: Use WPA2/WPA3 PSK for secure access.
- No NAT or Routing Needed: Since it’s a bridge, traffic is forwarded at Layer 2 — no IP forwarding or `iptables` rules required.
- DHCP on Main Network: Ensure your router or DHCP server can assign IPs to devices on the bridge.
This method uses NetworkManager, which is the modern default on Raspberry Pi OS Bookworm, and correctly bridges Wi-Fi and Ethernet at the data link layer. wpa_supplicant is still used under the hood by NetworkManager to manage Wi-Fi authentication.