Setup Bridged Wireless Access Point on Raspberry Pi 4

                                         +- RPi -------+
                                     +---+ 10.10.0.2   |          +- Laptop ----+
                                     |   |     WLAN AP +-)))  (((-+ WLAN Client |
                                     |   |  Bridge     |          | 10.10.0.5   |
                                     |   +-------------+          +-------------+
                 +- Router ----+     |
                 | Firewall    |     |   +- PC#2 ------+
(Internet)---WAN-+ DHCP server +-LAN-+---+ 10.10.0.3   |
                 |   10.10.0.1 |     |   +-------------+
                 +-------------+     |
                                     |   +- PC#1 ------+
                                     +---+ 10.10.0.4   |
                                         +-------------+

Dependencies

sudo apt install -y hostapd
sudo systemctl unmask hostapd
sudo systemctl enable hostapd

Create a bridge device and populate the bridge

Create /etc/systemd/network/bridge-br0.netdev and add below content to create br0 interface:

[NetDev]
Name=br0
Kind=bridge

Create /etc/systemd/network/br0-member-eth0.network and add below content to enslave eth0 to br0:

[Match]
Name=eth0

[Network]
Bridge=br0

Enable service systemd-networkd:

sudo systemctl enable systemd-networkd

Define the bridge device IP configuration

Deny interfaces wlan0 and eth0 from getting IP address by editing /etc/dhcpcd.conf:

denyinterfaces wlan0 eth0
interface br0

Enable wireless device wlan

sudo rfkill unblock wlan

Configure the AP Software

Edit /etc/hostapd/hostapd.conf:

country_code=US
interface=wlan0
bridge=br0
ssid=YOUR_SSID
hw_mode=g
channel=7
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=YOUR_PASSWORD
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

Change YOUR_SSID and YOUR_PASSWORD to your desired values.

Reboot

sudo reboot

References

See also

comments powered by Disqus