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