Raspberry Pi runs with Raspian, a Debian compiled for  ARM architecture. Pi has an ethernet adapter and usually a USB WLAN adapter is also attached in order to be able to have wireless access to Pi. Given this hardware you can use the Raspberry Pi as a  ethernet to WLAN bridge and/or as an access point with a cable connection. The following article explains ho to create a ethernet to WLAN bridge on Debian and Raspberry Pi running Raspbian.
 
Update March 1st, 2014: Until kernel 3.6.11+ everything works as described below. Starting with 3.10.25+ ist doesn't work any more and a router has to be configured.
  
Make sure your WLAN connection and ethernet connaction works when you start to configure the WLAN bridge. Then install the following package:
 
apt-get install bridge-utils
 
Now adapt your file /etc/network/interfaces accordingly:
 
auto lo

iface lo inet loopback

iface eth0 inet manual

auto wlan0
iface wlan0 inet manual

auto br0
iface br0 inet dhcp
bridge_ports wlan0 eth0
bridge_stp off
bridge_maxwait 15

wpa-iface wlan0
wpa-bridge br0
wpa-driver wext
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
 
Start the bridge with
 
ifup br0
 
and 
 
ifconfig br0
 
should give a similar result. It's important  you have an IP address on the bridge which is from the DHCP pool of your local router.
 
br0       Link encap:Ethernet  HWaddr 94:44:52:1f:40:34 
          inet addr:192.168.0.107  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::9644:52ff:fe1f:4034/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:861 errors:0 dropped:0 overruns:0 frame:0
          TX packets:131 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:101477 (99.0 KiB)  TX bytes:15534 (15.1 KiB)
 
Now it's time to connect another system on the ethernet connector.
 
Unfortunately  this system has to be configured with a static IP which has to come from the same subnet your PI got when it connected via WLAN. DHCP requests unfortunatley are not routed through the bridge. It's probably possible to get this done with ebtables - but there is no solution for this available right now. 
 
Today (5.2.2014) I configured my Pi again because there was an issues reported, and following the instructions I got a DHCP address and I had no static IP to configure.
 
You have to configure your system carefully because DHCP doesn't help any more. All information excluding the IP which has to be a free IP in your local subnet can be extracted from the existing connection your bridge has.
 
1) Free static IP address from your local subnet  (e.g. 192.168.0.222 would be a valid IP in the above example)
2) Netzwerk mask ifconfig br0 | grep -i mask | sed 's/.*ask[0-9]*//'
3) Default Gateway route -n | grep ^0.0.0.0 | awk '{ print $2; }'
4) DNS Server cat /etc/resolv.conf | grep nameserver | cut -f 2 -d ' '
 
It takes some time until you can access systems behind the Pi because the arp Cache needs some time until it's filled over the WLAN (Test of arp cache with sudo arp).  Pi can be connected to immediately.
 
Usefull links with more detailed information:
help.ubuntu.com: Bridging ethernet connections  

Add comment

Spam Kommentare sind sinnlos !
Vor der Publizierung wird jeder Beitrag auf Spam geprüft. Leider dauert es deswegen bis ein Kommentar sichtbar wird. Dafür erhält aber kein Subscriber Spam eMails.
Die eMail ist optional und nicht öffentlich sichtbar. Sie ist notwendig um eMail Benachrichtigungen zu Antworten auf Kommentare zu erhalten. Sie wird auch u.U. auch vom Seitenbetreiber genutzt um offline Kontakt aufzunehmen.

Spam comments are useless !
Any comment will be reviewed first and checked for spam. Unfortunately this delays the publishing of comments but will protect subscribers from spam.
eMail is optional and hidden and is required to get update notifications for any comments. In addition your eMail may be used by the website owner to get in contact with you offline.


Comments   

0 #1 Kevin 2016-11-23 04:17
I searched the Internet all night trying to figure out why this setup doesn't work anymore and this page told me exactly the reason. This page needs to be at the top of Google searches results for any of the keywords "Raspberry Pi Ethernet Wireless Bridge". Thank you!!
Quote