We help IT Professionals succeed at work.

Direct traffic to multiple WiFi Adapters (Linux)

Jax Logan
Jax Logan asked
on
Medium Priority
363 Views
Last Modified: 2012-05-12
Experts,

I have a laptop with linux on it and two WiFi adapters. Both are connected to the WiFi network and get separate IP addresses. How I can stream a movie or download a file from a server using one adapter versus another?

So, as an example I'd like to set up adapter 1 to stream a movie from youtube and adapter 2 to download a file from a backup site.

Thanks!

Chris
Comment
Watch Question

Commented:
Selection of the adapter is done by the linux routing.
To see current routing table use
# ip route

Look for the default route "default via ...."
That will be interface used for all connectivity if there is no more specific route.

All you need to do is add a specific static route through the adapter that is not use for the default route to your server, then linux will use it for the server connection and the other one for all the rest of the traffic.

e.g.
ip route add  X.serv.ip.X   dev    ADAPT2


I hope you also have 2 x AP's that you connect to, remember Wifi is a half-duplex shared medium, on ly one card at a time can talk to the same AP.
Commented:
You should have a look at linux advanced routing - with this you can do stuff like use a different default gateway for connections to a specific port or similar.
http://tldp.org/HOWTO/Adv-Routing-HOWTO/
CERTIFIED EXPERT
Commented:
For #1, if you're streaming a movie from youtube via web browser, then your browser will simply take the system default gateway, and access Youtube that way.  If you change your system default gateway, it will change it for all your graphical applications.   You can however add a static route to your routing table to force the use of a given gateway for certain sites (the example below is Youtube):

  route add -net 74.125.227.0/28 gw [gateway IP address of your preferred wireless controller]

For #2, if you use the 'curl' utility to do your download, you can actually specify an interface to use so something like:

  curl --interface wlan1 http://somesite.com/myfile

Explore More ContentExplore courses, solutions, and other research materials related to this topic.