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


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 ( to the other interface.

  • Ahh ok. Should either of them be going through the gateway of the home network? – nedned Oct 26 '09 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 with a netmask of it would look like and you would say anything from that route would use your broadband router/modem as the gateway. – MDMarra Oct 26 '09 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 '09 at 2:25

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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