0

I have followed this documentation to set up the wireless access point on my RPi 3B+ successfully : Documentation link

I followed this until the step: Using the Raspberry Pi as an access point to share an internet connection (bridge)

But I already have an active internet connection with my access point connections without the bridge.

Why do I need to set up the br0 bridge? What is the advantage?

  • 1
    You can't run a bridge on a WiFi interface. The docs you've read use iptables to forward from WiFi to ethernet and vice verse. – Dougie Sep 23 at 10:51
  • 1
    @Dougie Of course you can bridge an access point interface with an uplink interface (client connection). It is only not possible to bridge a WiFi client connection with another client connection (uplink). For this you need WDS enabling 4addr but that's not supported by the built-in wifi device. – Ingo Sep 23 at 11:10
5

You do not need to setup a bridge but it depends on what you want. In general there are two possibilities to connect to your internet router (or any other network gateway). You can use routing or bridging.

With routing you route traffic from one separated subnet to a neighbor subnet. This means you have different ip address ranges, e.g. 192.168.1.0/24 and 192.168.2.0/24 on the subnets. This is the general setup that works on the internet with IPv4. You route traffic all over the world from network to network, provided you use public ip addresses. For example with an access point with wlan0 and a wired uplink connection with eth0 to your internet router then devices connected to wlan0 will have ip addresses from 192.168.2.0/24 and devices connected to eth0 will have ip addresses from 192.168.1.0/24 (at least eth0 itself and the routers ip address). In general you have isolated subnets that need its own DHCP server.
Advantage of routing is that it always works and has no hardware restrictions on a Raspberry Pi.
Disadvantage is that you have to configure external devices, e.g. the internet router with routing information (mainly static routes). If you don't have access to it you can fake it with NAT (network address translation) but with NAT you only have one way routing.

With a bridge you can "merge" two or more interfaces into one subnet, a so called broadcast domain. With our example all devices connected, no matter if connected to wlan0 or eth0, will have an ip address from the same address range, maybe 192.168.1.0/24. The bridge does not work with ip addresses, instead with mac addresses, so it is completely transparent to the network. It seems that devices connected to wlan0 are directly connected to the internet router and its local subnet. A DHCP server on the broadcast domain is available to all devices. This way you can use the DHCP server on the internet router for all devices. A bridge only works on local near by networks and cannot span over wide area networks like routing.
Advantage of a bridge is that you can easily expand your local network with all resources available like printer, internet router DHCP- DNS- and other server.
Disadvantage is that it is restricted to a local area and has hardware limitations on a Raspberry Pi. You can only bridge an access point with another interface. For more details about restrictions look at Raspberry Pi WiFi to Ethernet Bridge for a server?.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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