Results 1 to 6 of 6

Thread: Making two browsers use two different active network connections

  1. #1
    Join Date
    Dec 2008
    Location
    Si Valley
    Beans
    66
    Distro
    Ubuntu 12.04 Precise Pangolin

    Question Making two browsers use two different active network connections

    I have two wired connections: connection A is from work and connection B is from USB phone tethering (or wi-fi). I would like to do work-related activities with browser A (let's say Firefox) and all leisure browsing with browser B (Chrome). Is there any way to do that in Ubuntu? Maybe, I can create some local proxy set-up to utilise only a specific connection and then tell the browser to use this proxy?

    Your input would be highly appreciated

  2. #2
    Join Date
    Jun 2006
    Location
    Houston, TX
    Beans
    1,333
    Distro
    Ubuntu 6.06

    Re: Making two browsers use two different active network connections

    You would need more than just a local proxy. You simply can not have more than one default gateway, and that is how you know the "path to the Internet" for the entire system. You would need a proxy on the local subnet of one network and the default gateway on the other network to do what you want.

    (Short of a complex load balancing routing system)

  3. #3
    Join Date
    Dec 2008
    Location
    Si Valley
    Beans
    66
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Making two browsers use two different active network connections

    Thanks for the response. Let's simplify the task then.

    I have eth0 and wlna0 active connections. The default route for eth0 is 10.0.0.0 and for wlan0 it is 20.0.0.0. Suppose, my IP addresses on eth0 and wlan0 are 10.0.0.1 and 20.0.0.1, respectively. Now, default traffic goes via 10.0.0.0 (eth0), but I would like to go to some website through 20.0.0.0 (wlan0).

    Let's say I want to go to www.google.com only through wlan0. Can I set up a route to achieve this goal? I tried
    Code:
    sudo ip route add 74.125.224.83 via 20.0.0.0 dev wlan0
    , but it did not work, as google website would not load (would be waiting a long time and then showing 404). I got this 74.125.224.83 IP for www.google.com by pinging. Now, this task should be a piece of cake for networking guys
    Last edited by almikul; September 5th, 2013 at 11:54 PM.

  4. #4
    Join Date
    Dec 2008
    Location
    Si Valley
    Beans
    66
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Making two browsers use two different active network connections

    I did some experimenting, and I noticed that I can switch between network connections for default traffic but individual IP addresses still do not work. For instance, doing:
    Code:
    sudo ip route del default
    sudo ip route add default via 20.0.0.0 dev wlan0
    will work, but if I want to specify a particular IP or a subnet:
    Code:
    sudo ip route add <specific IP> via 20.0.0.0 dev wlan0
    it does not work. Maybe, I am not specifying destination IP or subnet correctly?

  5. #5
    Join Date
    Jun 2006
    Location
    Houston, TX
    Beans
    1,333
    Distro
    Ubuntu 6.06

    Re: Making two browsers use two different active network connections

    Routes are for networks, not addresses, and networks all have netmasks.
    Code:
    ip route add 74.125.224.0/24 via 20.0.0.1 dev wlan0
    Try that.

  6. #6
    Join Date
    Dec 2008
    Location
    Si Valley
    Beans
    66
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Making two browsers use two different active network connections

    It works, but only if I add "proto kernel" afterwards. For example:
    Code:
    ip route add 74.125.224.0/24 via 20.0.0.1 dev wlan0 proto kernel
    I don't even know what options "proto kernel" sets, but it works for now Thanks, man!

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •