Bridge between eth1 and wifi

Hi I am trying to use my yun as a wireless bridge (among other things). I want create a bridge between eth1 e wifi interfaces who transfer trasparent data.
I make some prove, then go to "interfaces" and create a bridge between my arduino wifi & Eth1. When I press save and apply, the yun says applying changes, please wait. It then drops off my wifi network and disappears. I have to do a 30 second reset and start all over again.

I found this link (BridgeNetworkConnections - Debian Wiki). It's possible to make on arduino yun?

Am i doing something wrong? does the yun even support this? I had assumed this would be rather trival.

Any help would be greatly appreciated

Thanks!

Setup bridge mode

Thanks for reponse but don't work.
I'll explain. Basically when I run the tutorial and tap save & apply lose my connection . Probably something wrong with the IP addresses . My wired interface via eth1 have following specifications:

IP - > 192.168.1.9
SUBNET - > 255.255.0.0

Start from fresh:

Reset to factory settings

Mrricca92:
Thanks for reponse but don't work.
I'll explain. Basically when I run the tutorial and tap save & apply lose my connection . Probably something wrong with the IP addresses . My wired interface via eth1 have following specifications:

IP - > 192.168.1.9
SUBNET - > 255.255.0.0

The WAN is for eth1, setup WAN as:

IP - > 192.168.1.9
SUBNET - > 255.255.0.0

make sure Yun is working at 192.168.0.0/255.255.0.0, say ping 192.168.0.1.

Hi,

excuse me I tried to follow your advice but nothing to do. Does not work.
Attached is a picture showing how I set the Arduino Yun, maybe something wrong .

Cattura.JPG

Which way you want?

(192.168.1.0 network) -> (Yun LAN wlan0/wifi) -> bridge -> (Yun WAN eth1) ->Others

(192.168.1.0 network) -> (Yun WAN eth1) -> bridge -> (Yun LAN wlan0/wifi)->Others

The second one.

Enclosed is a picture that shows the block diagram.

Where XXX is a wbserver with this address (http://192.168.1.9:8080/index.htm). And the blue arrow indicates the wired portion (eth1).

Start from fresh:

Reset to factory settings

Setup bridge:

nano setbridge.sh
uci set network.lan.proto=none
uci delete network.lan.ipaddr
uci delete network.lan.netmask
uci set network.wan.proto=none
uci delete network.wan.metric
uci set network.br1=interface
uci set network.br1.type=bridge
uci set network.br1.proto=static
uci set network.br1.ifname=eth1
uci set network.br1.ipaddr=192.168.0.200
uci set network.br1.netmask=255.255.255.0
uci set network.br1.gateway=192.168.0.1
uci set network.br1.broadcast=192.168.0.255
uci set network.br1.dns=8.8.8.8
uci set wireless.@wifi-iface[0].network='br1 lan'
uci commit

Change IP address base on yours.

Sample:

uci set network.br1.ipaddr=192.168.1.9
uci set network.br1.netmask=255.255.0.0
uci set network.br1.gateway=192.168.0.1
uci set network.br1.broadcast=192.168.255.255
/bin/ash setbridge.sh

Power cycling Yun.

Setup password for wifi ap:

uci set wireless.@wifi-iface[0].encryption=psk
uci set wireless.@wifi-iface[0].key=password
uci commit
wifi down; wifi up

The output of ifconfig:

root@Arduino:~# ifconfig
br-br1    Link encap:Ethernet  HWaddr 90:A2:DA:F8:06:76
          inet addr:192.168.0.200  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3570 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1757 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:507932 (496.0 KiB)  TX bytes:725845 (708.8 KiB)

eth1      Link encap:Ethernet  HWaddr 90:A2:DA:F8:06:76
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:11490 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6368 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:10938789 (10.4 MiB)  TX bytes:1423788 (1.3 MiB)
          Interrupt:4

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr 90:A2:DA:F0:06:76
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3158 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7383 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:418323 (408.5 KiB)  TX bytes:8066749 (7.6 MiB)

I like your drawing!

[Router] <------------ over wifi ----------> [YUN] <------------ over wifi -------------> [computer]
I want a configuration like this…
Which files do I need to change…
I was directed here (https://wiki.openwrt.org/doc/recipes) and I found this(https://wiki.openwrt.org/doc/recipes/bridgedap is actually what I want but not through br-lan config. WAN_WAN probably.
I read few resources and I became a bit confused .
Can some-one direct me how to setup the Yun in bridged wireless mode so that it can act as pseudo-router AP later for other host computers.

dattasaurabh82:
[Router] <------------ over wifi ----------> [YUN] <------------ over wifi -------------> [computer]
I want a configuration like this…
Which files do I need to change…
I was directed here (https://wiki.openwrt.org/doc/recipes) and I found this(https://wiki.openwrt.org/doc/recipes/bridgedap is actually what I want but not through br-lan config. WAN_WAN probably.
I read few resources and I became a bit confused .
Can some-one direct me how to setup the Yun in bridged wireless mode so that it can act as pseudo-router AP later for other host computers.

What you ask is 802.11s.

Okay so I modified the config files :
Here you can find it(to contrast with the default config files) :

Now it appears as an access-point with desired SSID and is in br-lan mode.
It gives Ip address to the hosts it is connected to and has static ip and all. Can SSH into it and everything is fine
But the internet doesn't work(It doesn't have access to the internet from the router) .. That means Can't ping to an external server. Even when my computer is connected to it, the computer can't access internet.

Can you look at the modified config files of Yun and help me fix the problem ..

Also do I need a separate usb wifi to channel out the internet(One wifi chip to access router via wifi and another usb wifi helps acting as AP) if I'm using it in Br-LAN mode?

Am I doing it wrong currently ..

How does things like wrtnode and all work like a router with one wifi chip

dattasaurabh82:
How does things like wrtnode and all work like a router with one wifi chip

The Yun IS a router, just as the wrtnode module IS a router. 99.9% of the time, the usage is to route from the Ethernet being the WAN to the WiFi being the WAN. If the device has multiple Ethernet ports, then one is typically the WAN connection and the reminder are LAN.

However, there are a few people who want to use them the other way: the WiFi is the WAN and Ethernet is the LAN. That's the way I have my home network set up: my Internet is through a cellular MiFi device, my home router (running DD-WRT) connects to it via WiFi, then distributes the LAN to the rest of the house using Ethernet - most devices are wired, but I have a dedicated AP (not a router, just a bridge) to give wireless access to local clients. But not a lot of people do that.

As rare as that situation is, your situation is even less common. You want to use your WiFi radio as both an access point (LAN) and a client (LAN) at the same time. This is quite unusual. I use this mode in my motorhome while traveling: a router (also running DD-WRT) is both a client to the MiFi Internet device, and an access point to the local wireless clients. Its a tricky system to set up, and it's fragile.

The good news is that it can be done with the Atheros chip set on the Yun. The bad news is that it has some significant restrictions:

  • The AP mode must use the same channel number as the client mode
  • The AP mode won't work if you don't currently have a client connection
  • The throughput speed is significantly reduced.

Item one isn't that bad. Item two is a big one: if your connection to the Internet is down, none of your local devices connected to the AP mode side will be able to connect or talk to each other. In my case, in the motorhome, if the MiFi device is not on and in range of my router, the whole WiFi network is down and unusable. I can live with that limitation, but it can cause problems. The third issue, speed, is because for a local system to get to the Internet, the data goes to the router using one mode of the radio, it has to be buffered in the router and while the radio switches modes, and then finally the data can be sent out using the other mode of the radio. It can switch back and forth between modes so it looks like both are happening at once, but it is really only in one mode or the other at any one point in time. With a WiFi to Ethernet bridged connection, it can be moving data from one interface to the other simultaneously.

You are probably running into trouble because most of the documentation out there, which talks about bridging networks, is talking about going from Ethernet to WiFi, with the WiFi acting as client OR AP, but not both. Don't be looking for information how to use it as a router: it already is and that isn't what you want. You need to look for discussions about using both AP and Client mode simultaneously. There is precious little out there about it, and what there is assumes you know what you're talking about - definitely not tutorial level stuff. For example: OpenWrt Forum Archive

ShapeShifter:
You are probably running into trouble because most of the documentation out there, which talks about bridging networks, is talking about going from Ethernet to WiFi, with the WiFi acting as client OR AP, but not both.

Okay so let’s say we set up two wifi ports.

  • One is the default wifi chip on board of Yun
  • Another is: say I setup an usb wifi on Yun(like these down below I found)

configuring a 2nd usb wifi
http://www.lucadentella.it/en/2014/11/08/yun-adattatore-wifi-usb/
making it, as well, as an access point.

Now Yun say has two WANs(radio0 and radio1) and one LAN(ethernet).

Now Should it be following according to https://wiki.openwrt.org/doc/recipes/bridgedap
and then make changes in network and wireless files accordingly ?

I mean Say radio0 is for WAN0 to home router and and radio1 - WAN1 as access point for other clients/hosts.

sonnyyu:
A wireless mesh network (WMN) is a communications network made up of radio nodes organized in a mesh topology. The coverage area of the radio nodes working as a single network is sometimes called a mesh cloud. Access to this mesh cloud is dependent on the radio nodes working in harmony with each other to create a radio network. A mesh network is reliable and offers redundancy. When one node can no longer operate, the rest of the nodes can still communicate with each other, directly or through one or more intermediate nodes. The picture below illustrates how wireless mesh networks can self form and self heal. Openwrt suport WMN well. Plus WMN will extend communication distance. Node 1 to node 9 could be 4*maximum communication distance.

inbox:mesh.olsr [Old OpenWrt Wiki]

I have only one Yun, can not start test WMN, anyone could show us light?

The mesh wifi network (B.A.T.M.A.N, OLSR, 802.11s ) is only requirement of single radio.

The benefit of mesh network:

  • redundancy
  • bandwidth auto scalable
  • self form
  • self heal
  • extended communications distance

A mesh architectures allowing otherwise out-of-range nodes 1–4 to still connect to the Internet.

Shea Stadium, NYC.

60,372 seats, to support Wifi of them plus size of Stadium.

The mesh network is only way to go?

P.S.

Largest stadiums by capacity:

Rungnado May Day Stadium, 150,000 seats, Pyongyang, North Korea

I am not sure get Wifi connected there is the highest priority.

sonnyyu:
The output of ifconfig:

root@Arduino:~# ifconfig

br-br1    Link encap:Ethernet  HWaddr 90:A2:DA:F8:06:76
          inet addr:192.168.0.200  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3570 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1757 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:507932 (496.0 KiB)  TX bytes:725845 (708.8 KiB)

eth1      Link encap:Ethernet  HWaddr 90:A2:DA:F8:06:76
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:11490 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6368 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:10938789 (10.4 MiB)  TX bytes:1423788 (1.3 MiB)
          Interrupt:4

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0    Link encap:Ethernet  HWaddr 90:A2:DA:F0:06:76
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3158 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7383 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:418323 (408.5 KiB)  TX bytes:8066749 (7.6 MiB)

I followed your guide and seems to work something. So I tried to ping from my computer to the device with IP 192.168.1.9 and it works, but when I try to connect to the webserver (http://192.168.1.9:8080/index.htm) with the browser don't works.

Below is my code in setbridge.sh

uci set network.lan.proto=none
uci delete network.lan.ipaddr
uci delete network.lan.netmask
uci set network.wan.proto=none
uci delete network.wan.metric
uci set network.br1=interface
uci set network.br1.type=bridge
uci set network.br1.proto=static
uci set network.br1.ifname=eth1
uci set network.br1.ipaddr=192.168.1.10
uci set network.br1.netmask=255.255.0.0
uci set network.br1.gateway=192.168.1.1
uci set network.br1.broadcast=192.168.1.128
uci set network.br1.dns=8.8.8.8
uci set wireless.@wifi-iface[0].network='br1 lan'
uci commit

Then I have two questions:

  1. What do you mean "Power cycling Yun"?
  2. In my case I do not need DNS right ?, because I work locally