1

I would like to bridge eth0 and wlan0 on Raspberry Pi. The connections are as follows:

                 ________________________________________ 
                |                  RPi                   |
AP with DHCP --- eth0                               wlan0 --- Devices
                |________________________________________|

I would like RPi as well as other devices connected through it to get IP address from DHCP server, so the Raspberry Pi does not get involved. Do I have only to setup /etc/network/interfaces:

iface lo inet loopback

auto eth0
allow-hotplug eth0
iface eth0 inet manual
iface wlan0 inet manual

auto bridge
allow-hotplug wlan0

# Added by hostapd setup
allow-hotplug bridge
iface bridge inet dhcp
  bridge_ports wlan0 eth0
  wireless-power off

and hostapd to make Raspberry an AP?

Usual scenario is different:

                 ________________________________________ 
                |                  RPi                   |
AP with DHCP --- wlan0                               eth0 --- Devices
                |________________________________________|

I've read that in such scenario I have to additionaly use one of these approaches:

https://wiki.debian.org/BridgeNetworkConnections

https://wiki.debian.org/BridgeNetworkConnectionsProxyArp

Does my use case need also these additional steps?

1

1 Answer 1

2

Just some general information first to understand the different setups. In the first setup you have an access point on the RasPi with interface wlan0 that can other devices connect by WiFi. The wired interface eth0 is connected as uplink to the internet router, no matter if it also has an access point. That isn't used in this case.
The RasPi is an access point with a wired uplink.

The second setup is just the other way around. The wlan0 interface is connected as client to the internet router/access point by WiFi. Other devices are wired connected to the RasPi to interface eth0. If you want to connect more than one device you need an additional switch maybe with 5 or 8 or more wired ports.
The RasPi is a router with a WiFi client uplink.

You want to bridge interfaces eth0 and wlan0. This is only possible in the first case. Bridging a WiFi client uplink as in the second case must be supported by the WiFi device but the built-in WiFi device of a Raspberry Pi don't do it. For details look at Raspberry Pi WiFi to Ethernet Bridge for a server?.

For the first setup - bridging an access point with a wired port (uplink) - there are many tutorials available on the web. I prefer to use systemd-networkd and you can find one example at Setting up a Raspberry Pi as an access point - the easy way. Use section Setting up an access point with a bridge.

For the second setup - using a wireless client uplink - there is a workaround available. You can emulate a bridge with proxy arp. How to do it you can look at Workaround for a wifi bridge on a Raspberry Pi with proxy arp.

Because your use case is the first setup, you do not need to use additional steps for proxy arp. Bridging the interfaces is part of the setup.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.