3

Is there a way to make all internet traffic go through one network connection when there are multiple connections?

I've connected my mobile broadband modem into my Ubuntu Jaunty box so that I now have two running connections: the mobile broadband and an ethernet connection.

The problem is that internet traffic is going through the ethernet connection rather than the mobile connection. Where I live, ISPs cap bandwidth after you have used your quota, and we have been capped at my house, so I need internet traffic to go through the faster mobile connection. I need access to the home network so disabling ethernet is not an option

2 Answers 2

4

You can do this with a static route

Details for how to do this can be found here http://www.ubuntugeek.com/howto-add-permanent-static-routes-in-ubuntu.html

You will define one route for your internal network to whichever interface that is attached to, and then you'll set the default route (0.0.0.0/0) to the other interface.

3
  • Ahh ok. Should either of them be going through the gateway of the home network?
    – nedned
    Oct 26, 2009 at 1:40
  • 1
    Whatever needs to stay locally on your internal network. You've said that you cannot unplug the interface that is connected to your broadband modem because you need to be able to access other things on your network. So for that interface make a route that applies to traffic internal on your network. If your internal network is 192.168.1.0 with a netmask of 255.255.255.0 it would look like 192.168.1.0/24 and you would say anything from that route would use your broadband router/modem as the gateway.
    – MDMarra
    Oct 26, 2009 at 1:50
  • Success! Thanks heaps. It turned out that there was already an appropriate entry in the routing tables for the local network so I just needed to add the default entry for the mobile broadband modem.
    – nedned
    Oct 26, 2009 at 2:25
4

In Ubuntu you can also try selecting "Edit connections" from the Network Manager, edit the ethernet connection, under IPv4 Settings select Routes... and tick "Use this connection only for resources on its network".

The explanations of the option is "If enabled, this connection will never be used as the default network connection." This should achieve what you want. You could also defined separate connection profiles, one of which uses the ethernet as the default connection and another that doesn't.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .