Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Assume you have two connections in Mobile Broadband and WiFi.

I would like to allocate manually given packages to given connections. For instance, my bank connection to Mobile Broadband and my internet surfing and software downloads to WiFi.

  1. How does Ubuntu 11.10 or 11.04 allocate the usage of two connections to Google Chrome?

  2. How can you manually decide which internet connection to use with Wget? Do you need any external command to do the allocation? - In my opinion, it would be much more orthogonal and efficient if you could have an external program to do the allocation. - I could then simply launch my Google Chrome to the wanted connection manually.

share|improve this question

1 Answer 1

up vote 4 down vote accepted

This is a question of packet routing, e.g. deciding which packets (addressed to which IP addresses) go out which interface. To answer question 1, both connections' packets are routed to the same interface. Use the route command to show your current routing setup. Use the ifconfig -a command to see your interfaces and the IP addresses assigned to them.

There are two ways to force wget to use a particular internet connection: use the --bind-address=ADDRESS option to wget (See man wget for details); OR add a route to an IP address/netmask pointing to the interface packets for that address (those addresses) should use. Using route affects all packets to that IP. See man route. You want something like:

sudo route add -host <*bank's IP*> dev <*MobileBroadband's interface*>

You have to do this once per reboot, or once every time your Mobile Broadband comes up.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.