Go Down

Topic: Bridge between eth1 and wifi (Read 6542 times) previous topic - next topic

Mrricca92

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 (https://wiki.debian.org/BridgeNetworkConnections#Manual_bridge_setup). 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!

sonnyyu

#1
Dec 23, 2015, 02:59 pm Last Edit: Dec 23, 2015, 02:59 pm by sonnyyu

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

sonnyyu


sonnyyu

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.




Mrricca92

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 .

sonnyyu

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




Mrricca92

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).

sonnyyu

#8
Dec 28, 2015, 01:37 am Last Edit: Dec 28, 2015, 04:33 pm by sonnyyu
Start from fresh:

Reset to factory settings


Setup bridge:

Code: [Select]
nano setbridge.sh

Code: [Select]
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:

Code: [Select]
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



Code: [Select]
/bin/ash setbridge.sh

Power cycling Yun.

Setup password for wifi ap:

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





sonnyyu

The output of ifconfig:

Code: [Select]
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)






sonnyyu


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.

sonnyyu

[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.



https://github.com/o11s/open80211s/wiki/HOWTO


dattasaurabh82

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

https://gist.github.com/dattasaurabh82/d654dd069df0da71a718

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

ShapeShifter

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: https://forum.openwrt.org/viewtopic.php?id=26008

Go Up